/* ─── Page Hero ─────────────────────────────────── */
.page-hero {
  background: var(--brown-dark);
  padding: calc(var(--nav-h) + 3.5rem) 2rem 3.5rem;
  text-align: center;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--ivory);
  margin: 0.5rem 0;
}
.page-hero p {
  color: var(--nude);
  font-size: 0.92rem;
  margin-top: 0.5rem;
}

/* ─── Steps Bar ─────────────────────────────────── */
.booking-steps-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
}
.booking-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  transition: all 0.3s ease;
}
.step-dot span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.step.active .step-dot {
  background: var(--brown-dark);
  border-color: var(--brown-dark);
}
.step.active .step-dot span { color: var(--gold); }
.step.done .step-dot {
  background: var(--gold);
  border-color: var(--gold);
}
.step.done .step-dot span { color: var(--charcoal); }
.step-label {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.step.active .step-label { color: var(--brown-dark); font-weight: 500; }
.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
  min-width: 40px;
}

/* ─── Layout ────────────────────────────────────── */
.booking-main {
  padding: 3rem 2rem 5rem;
  background: var(--ivory);
  min-height: 70vh;
}
.booking-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

/* ─── Steps ─────────────────────────────────────── */
.booking-step { display: none; }
.booking-step.active { display: block; }

.step-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--charcoal);
  margin-bottom: 0.35rem;
}
.step-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.step-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  align-items: center;
}

.btn-ghost-dark {
  display: inline-block;
  background: transparent;
  color: var(--brown);
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-ghost-dark:hover { border-color: var(--brown); color: var(--charcoal); }

/* ─── Accessibility: Focus-visible states ────────────
   Shows a keyboard focus ring only when navigating by Tab,
   not on mouse clicks — using :focus-visible pseudo-class.
   Never suppress focus indicators entirely (WCAG 2.1 §2.4.7) ── */
.service-option:focus-visible,
.slot-btn:focus-visible,
.cal-day:focus-visible,
.btn-primary:focus-visible,
.btn-ghost-dark:focus-visible,
.lookup-btn:focus-visible,
.cancel-btn:focus-visible,
.lookup-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  z-index: 1;
  position: relative;
}

/* ─── Services Select ───────────────────────────── */
.services-select { display: flex; flex-direction: column; gap: 0.75rem; }
.service-option {
  border: 1.5px solid var(--border);
  background: var(--white);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
}
.service-option:hover { border-color: var(--nude); }
.service-option.selected {
  border-color: var(--brown-dark);
  background: var(--ivory);
}
.service-option.selected::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}
.service-opt-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}
.service-opt-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.service-opt-meta {
  text-align: right;
  flex-shrink: 0;
  margin-left: 1.5rem;
}
.service-opt-price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--brown);
  display: block;
}
.service-opt-dur {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─── Calendar ──────────────────────────────────── */
.calendar-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: 400px;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.calendar-header h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--charcoal);
}
.cal-nav {
  background: none;
  border: 1px solid var(--border);
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.cal-nav:hover { background: var(--brown-dark); color: var(--gold); border-color: var(--brown-dark); }

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.calendar-weekdays span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: var(--font-body);
  background: none;
  color: var(--charcoal);
}
.cal-day.empty { cursor: default; }
.cal-day.past { color: var(--border); cursor: not-allowed; }
.cal-day.closed { color: var(--border); cursor: not-allowed; text-decoration: line-through; }
.cal-day.available:hover { background: var(--nude-light); border-color: var(--nude); }
.cal-day.selected { background: var(--brown-dark); color: var(--gold-light); border-color: var(--brown-dark); }
.cal-day.today { font-weight: 600; color: var(--brown); }

/* ─── Time Slots ────────────────────────────────── */
.slots-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 1rem;
}
.slots-title span { font-size: 0.85rem; color: var(--text-muted); font-family: var(--font-body); }

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.slot-btn {
  padding: 0.65rem 0.5rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--charcoal);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.slot-btn:hover { border-color: var(--brown); color: var(--brown); }
.slot-btn.selected { background: var(--brown-dark); color: var(--gold-light); border-color: var(--brown-dark); }

.no-slots {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ─── Form ──────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

.form-group input,
.form-group textarea {
  background: var(--white);
  border: 1.5px solid var(--border);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--charcoal);
  transition: border-color 0.2s ease;
  /* a11y: never suppress the outline entirely — use focus-visible instead */
  outline: none;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--brown); }
/* a11y: keyboard-focus ring shown only when navigating by keyboard (not on click) */
.form-group input:focus-visible,
.form-group textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.form-group input.invalid { border-color: #c0392b; }

/* ─── Payment ───────────────────────────────────── */
.payment-summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}
.payment-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--ivory-dark);
}
.payment-row:last-child { border-bottom: none; font-weight: 600; }
.payment-row .label { color: var(--text-muted); }
.payment-row .value { color: var(--charcoal); }
.payment-row .value { color: var(--charcoal); }

/* Error message shown when booking submission fails */
.booking-error-msg {
  color: #c0392b;
  font-size: 0.83rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
  padding: 0.5rem 0.75rem;
  background: #fdf2f2;
  border-left: 3px solid #c0392b;
  border-radius: 2px;
}

.btn-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(44,34,24,0.3);
  border-top-color: var(--charcoal);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Confirmation ──────────────────────────────── */
.confirmation-wrap {
  text-align: center;
  padding: 3rem 2rem;
}
.confirm-icon {
  width: 72px; height: 72px;
  background: var(--brown-dark);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  font-family: var(--font-display);
}
.confirmation-wrap h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
}
.confirmation-wrap > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.confirm-details {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-width: 440px;
  margin: 0 auto 2rem;
  text-align: left;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--ivory-dark);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row .cl { color: var(--text-muted); }
.confirm-row .cv { color: var(--charcoal); font-weight: 500; }
.confirm-ref { color: var(--brown); font-family: var(--font-display); font-size: 1.1rem; }
.confirm-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ─── Sidebar ───────────────────────────────────── */
.booking-sidebar { position: sticky; top: calc(var(--nav-h) + 80px); }
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.sidebar-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  gap: 0.75rem;
}
.summary-label { color: var(--text-muted); flex-shrink: 0; }
.summary-value { color: var(--charcoal); text-align: right; }
.summary-row--highlight .summary-value { color: var(--brown); font-weight: 600; }
.summary-divider { border-top: 1px solid var(--border); margin: 0.5rem 0; }
.sidebar-empty p { font-size: 0.83rem; color: var(--text-muted); font-style: italic; }
.sidebar-info {
  background: var(--ivory-dark);
  border: 1px solid var(--border);
  padding: 1.25rem;
  font-size: 0.83rem;
}
.sidebar-info h5 {
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.sidebar-info a { color: var(--brown); }
.sidebar-info p { margin-bottom: 0.25rem; }

/* ─── Loading & Errors ──────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  border-radius: 2px;
}

/* ─── Consent Checkbox (PIPEDA/PIPA) ────────────── */
.consent-group {
  background: var(--ivory);
  border: 1.5px solid var(--border);
  padding: 1rem 1.25rem;
  margin-top: .25rem;
}
.consent-group.invalid {
  border-color: #c0392b;
  background: #fef2f2;
}
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-transform: none;
  letter-spacing: 0;
}
.consent-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--brown-dark);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}
.consent-label a {
  color: var(--brown);
  border-bottom: 1px solid var(--nude);
  padding-bottom: 1px;
}
.consent-error {
  color: #c0392b;
  font-size: .78rem;
  margin-top: .5rem;
  margin-bottom: 0;
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 860px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
  .booking-sidebar {
    /* UX-4: Sticky bottom bar so service/price/time stay visible during the flow */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    order: 1;
    margin-bottom: 0;
    background: var(--ivory, #faf8f5);
    border-top: 1px solid var(--border, #E8D5C4);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 0.6rem 1rem;
    max-height: 110px;
    overflow: hidden;
  }
  .booking-sidebar .sidebar-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    border: none;
    box-shadow: none;
    margin: 0;
  }
  .booking-sidebar .sidebar-info { display: none; }
  .booking-content {
    order: 2;
    padding-bottom: 130px; /* space for the sticky bar */
  }
  .form-grid { grid-template-columns: 1fr; }

  /* UX-5: WCAG 2.1 §2.5.8 — interactive elements at least 44×44px on touch. */
  .calendar-day,
  .slot-btn,
  .service-option,
  .btn-primary,
  .btn-ghost-dark,
  .cal-nav {
    min-height: 44px;
    min-width: 44px;
  }
  .calendar-day {
    /* Override tight aspect-ratio on small phones where 1:1 falls below 44px */
    aspect-ratio: auto;
    padding: 0.5rem;
  }
}
@media (max-width: 480px) {
  .booking-steps { gap: 0; }
  .step-line { min-width: 20px; }
  .step-label { display: none; }

  /* UX-5: WCAG 2.1 §2.5.8 — 44×44px minimum touch targets */
  .cal-day {
    min-height: 44px;
    min-width: 44px;
    font-size: 0.9rem;
  }
  .slot-btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  .action-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.6rem 0.8rem;
  }
}

/* v1.4: very small phones (iPhone SE, old Androids). The sticky summary bar
   and the Confirm button were reported overlapping/cramped at ≤380px.
   Tighten sticky bar padding, let the sidebar card wrap, and keep 44px
   minimums on the CTA so touch targets don't regress. */
@media (max-width: 380px) {
  .booking-sidebar {
    padding: 0.45rem 0.75rem;
    max-height: 120px;
  }
  .booking-sidebar .sidebar-card {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  .booking-content {
    padding-bottom: 140px; /* a touch more clearance above sticky bar */
  }
  .step-title { font-size: 1.35rem; }
  .step-subtitle { font-size: 0.8rem; }

  /* Consent checkbox — give the label more breathing room so the tiny
     checkbox has an obvious hit-area and doesn't butt up against text. */
  .consent-label {
    gap: 0.6rem;
    align-items: flex-start;
  }
  .consent-label input[type="checkbox"] {
    min-width: 20px;
    min-height: 20px;
    margin-top: 2px;
  }
  /* Form CTAs go full-width so "Confirm Booking" never gets clipped */
  .step-nav {
    flex-direction: column;
    gap: 0.5rem;
  }
  .step-nav .btn-primary,
  .step-nav .btn-ghost-dark {
    width: 100%;
    min-height: 48px;
  }
}
