/* ==========================================================================
   Public booking — wireframe: Aud chips → Date+Calendar | Sticky times
   Mobile-first. Touch ≥ 44px. Brand tokens only.
   ========================================================================== */

.booking-page.landing-section {
  --bk-radius: 1rem;
  --bk-radius-sm: 0.75rem;
  --bk-shadow: 0 4px 18px color-mix(in srgb, var(--brand-900, #0b3d2c) 8%, transparent);
  --bk-brand: var(--brand-700, #0b5e42);
  padding-block: var(--space-4, 1rem) var(--space-8, 2rem);
  padding-inline: 0;
  width: 100%;
  max-width: none;
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--bk-brand) 8%, transparent), transparent 55%),
    var(--bg, #f6f8f7);
}

.booking-shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--space-3, 0.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

@media (min-width: 768px) {
  .booking-shell {
    padding-inline: var(--space-5, 1.25rem);
    gap: var(--space-5, 1.25rem);
  }
}

/* —— Header —— */
.booking-header {
  text-align: center;
}

.booking-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--bk-brand);
  letter-spacing: -0.02em;
}

.booking-intro {
  margin: 0.35rem auto 0;
  color: var(--text-muted, #5c6b66);
  font-size: var(--fs-sm, 0.9rem);
  max-width: 40rem;
  line-height: 1.5;
}

/* —— Slim progress (centered) —— */
.booking-progress {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0.5rem 0;
  background: color-mix(in srgb, var(--bg, #f6f8f7) 88%, transparent);
  backdrop-filter: blur(8px);
}

.booking-progress__list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 28rem;
}

.booking-progress__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  color: var(--text-muted, #5c6b66);
  font-size: 0.8rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.booking-progress__item:not(:last-child)::after {
  content: "";
  flex: 0 0 auto;
  width: 1.35rem;
  height: 2px;
  margin-inline-start: 0.35rem;
  background: var(--border, #d7e0dc);
  border-radius: 1px;
}

.booking-progress__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--gray-100, #eef2f0);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.booking-progress__item--current {
  color: var(--bk-brand);
}

.booking-progress__item--current .booking-progress__dot {
  background: var(--bk-brand);
  color: #fff;
}

.booking-progress__item--done {
  color: var(--bk-brand);
}

.booking-progress__item--done .booking-progress__dot {
  background: color-mix(in srgb, var(--bk-brand) 18%, #fff);
  color: var(--bk-brand);
}

@media (max-width: 480px) {
  .booking-progress__label {
    font-size: 0.72rem;
  }
}

/* —— Panels —— */
.booking-panel {
  background: var(--surface, #fff);
  border: 1px solid color-mix(in srgb, var(--border, #d7e0dc) 80%, transparent);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  padding: var(--space-4, 1rem);
}

.booking-panel__title {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bk-brand);
  text-align: center;
}

.booking-warning {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: var(--bk-radius-sm);
  background: color-mix(in srgb, #c9a227 12%, #fff);
  border: 1px solid color-mix(in srgb, #c9a227 35%, #d7e0dc);
}

.booking-warning__icon {
  color: #a67c00;
}

/* —— Audiologist chips (site theme) —— */
.booking-panel--aud {
  background: var(--brand-50, #eef8f3);
  border-color: var(--brand-200, #a7ddc8);
}

.aud-chip-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-block: 0.1rem 0.25rem;
  /* flex-start (not center): center + overflow-x clips the first chip off-screen */
  justify-content: flex-start;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-padding-inline: 0.25rem;
}

/* Center the row when chips fit; keep both ends reachable when they overflow */
.aud-chip-row::before,
.aud-chip-row::after {
  content: "";
  margin-inline: auto;
}

.aud-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-height: 48px;
  max-width: 12rem;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  border: 1px solid var(--brand-200, #a7ddc8);
  border-radius: var(--radius, 0.75rem);
  background: var(--surface, #fff);
  color: var(--text, #1a2e28);
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: var(--elevation-1, 0 2px 8px rgba(11, 94, 66, 0.06));
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.aud-chip-row.has-selection .aud-chip:not(.is-selected) {
  opacity: 0.42;
  filter: grayscale(0.55);
  box-shadow: none;
  border-color: color-mix(in srgb, var(--border, #d7e0dc) 80%, transparent);
  background: color-mix(in srgb, var(--gray-50, #f3f5f4) 70%, #fff);
}

.aud-chip-row.has-selection .aud-chip:not(.is-selected):hover,
.aud-chip-row.has-selection .aud-chip:not(.is-selected):focus-visible {
  opacity: 0.72;
  filter: grayscale(0.2);
}

.aud-chip:focus-visible {
  outline: 2px solid var(--brand-700, #0b5e42);
  outline-offset: 2px;
}

.aud-chip.is-selected {
  border-color: var(--brand-700, #0b5e42);
  background: var(--surface, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-700, #0b5e42) 22%, transparent);
}

.aud-chip__avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-100, #d6f0e5);
  display: grid;
  place-items: center;
  border: 2px solid var(--brand-100, #d6f0e5);
}

.aud-chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aud-chip__initials {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--brand-700, #0b5e42);
  line-height: 1;
}

.aud-chip__name {
  font-weight: 700;
  font-size: 0.84rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7.75rem;
  color: var(--brand-800, #084c36);
}

.aud-chip--any {
  border-style: dashed;
}

.aud-chip--any .aud-chip__avatar {
  background: linear-gradient(145deg, var(--brand-50, #eef8f3), var(--brand-100, #d6f0e5));
  border-color: var(--brand-200, #a7ddc8);
}

/* —— Desktop 2-column —— */
.booking-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 1rem);
}

@media (min-width: 960px) {
  .booking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-5, 1.25rem);
    align-items: start;
  }

  .booking-layout__times {
    position: sticky;
    top: 3.25rem;
  }
}

/* —— Date bar + calendar —— */
.booking-calendar .calendar-day.selected a.calendar-date-link,
.booking-calendar .calendar-day.selected span.calendar-date-link {
  background: var(--bk-brand, #0b5e42) !important;
  color: #fff !important;
  border-color: var(--bk-brand, #0b5e42) !important;
  font-weight: 700;
  box-shadow: none;
}

.booking-calendar .calendar-day.selected.today a.calendar-date-link,
.booking-calendar .calendar-day.selected.today span.calendar-date-link {
  background: var(--bk-brand, #0b5e42) !important;
  color: #fff !important;
  box-shadow: none;
}

.booking-calendar .calendar-card {
  padding: 0.65rem 0.25rem 0.35rem;
  box-shadow: none;
  border: none;
  background: transparent;
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.booking-calendar .calendar-header {
  margin-block-end: 0.55rem;
  justify-content: center;
  gap: 0.75rem;
}

.booking-calendar .calendar-nav-btn {
  width: 36px;
  height: 36px;
}

.booking-calendar .calendar-month-year {
  padding: 0.3rem 0.85rem;
}

.booking-calendar .month-name {
  font-size: 0.95rem;
}

.booking-calendar .year-number {
  font-size: 0.8rem;
}

.booking-calendar .weekday {
  padding: 0.35rem 0;
  font-size: 0.75rem;
}

.booking-calendar .calendar-days {
  gap: 4px;
}

.booking-calendar .calendar-day {
  min-height: 2.5rem;
  max-height: none;
  aspect-ratio: 1;
}

.booking-calendar .calendar-day a,
.booking-calendar .calendar-day span.calendar-date-link {
  font-size: 0.9rem;
  border-width: 2px;
}

.booking-calendar .calendar-day.holiday a,
.booking-calendar .calendar-day.holiday span.calendar-date-link,
.booking-calendar .calendar-day.weekend a,
.booking-calendar .calendar-day.weekend span.calendar-date-link,
.booking-calendar .calendar-day.friday a,
.booking-calendar .calendar-day.friday span.calendar-date-link {
  color: var(--danger, #c0392b) !important;
  font-weight: 700;
}

.booking-calendar .calendar-footer {
  margin-block-start: 0.5rem;
  padding-block-start: 0.5rem;
}

.booking-calendar .today-btn {
  min-height: 36px;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
}

/* —— Time slots —— */
.shift-section + .shift-section {
  margin-block-start: 1rem;
}

.shift-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--bk-brand, #0b5e42);
  text-align: center;
  letter-spacing: 0.01em;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (min-width: 520px) {
  .time-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .time-slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .time-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.time-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding: 0.45rem 0.35rem;
  border-radius: var(--bk-radius-sm);
  border: 2px solid var(--border, #d7e0dc);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.time-slot--solo {
  min-height: 44px;
}

.time-slot__time {
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.time-slot__avail {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.9;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
}

.time-slot--available,
.time-slot.is-bookable {
  border-color: color-mix(in srgb, var(--bk-brand) 45%, #d7e0dc);
  background: color-mix(in srgb, var(--bk-brand) 8%, #fff);
  color: var(--bk-brand);
}

.time-slot--available:focus-visible,
.time-slot.is-bookable:focus-visible {
  outline: 2px solid var(--bk-brand);
  outline-offset: 2px;
}

.time-slot.is-selected {
  border-color: var(--bk-brand);
  background: var(--bk-brand);
  color: #fff;
}

.time-slot--full {
  border-color: color-mix(in srgb, #b42318 45%, #d7e0dc);
  color: #9b1c1c;
  background: color-mix(in srgb, #b42318 10%, #fff);
  cursor: not-allowed;
  opacity: 0.9;
}

.time-slot--disabled,
.time-slot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--gray-50, #f3f5f4);
}

.booking-empty {
  padding: 1.25rem 0.5rem;
  text-align: center;
}

.booking-empty__text {
  margin: 0;
  color: var(--text-muted, #5c6b66);
  font-size: 0.9rem;
}

/* —— Skeleton —— */
.booking-slots-skeleton .skeleton-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.skeleton-chip {
  display: block;
  width: 4.5rem;
  height: 44px;
  border-radius: var(--bk-radius-sm);
  background: linear-gradient(
    90deg,
    #e8eeeb 0%,
    color-mix(in srgb, var(--bk-brand) 12%, #e8eeeb) 45%,
    #e8eeeb 100%
  );
  background-size: 200% 100%;
  animation: bk-shimmer 1.1s ease-in-out infinite;
}

@keyframes bk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.booking-page.is-loading .booking-panel--times {
  opacity: 0.92;
}

/* —— Modal —— */
.booking-modal {
  align-items: flex-end;
  padding: 0;
  z-index: 1100;
}

@media (min-width: 640px) {
  .booking-modal {
    align-items: center;
    padding: var(--space-5, 1.25rem);
  }
}

.booking-modal-dialog {
  max-width: 36rem;
  width: 100%;
  max-height: min(92vh, 44rem);
  overflow: auto;
  border-radius: 1rem 1rem 0 0;
  padding: 0.85rem 1rem 1.05rem;
  background: var(--surface, #fff);
  box-shadow: var(--elevation-2, 0 12px 40px rgba(6, 61, 43, 0.2));
  border: 1px solid var(--border, #d7e0dc);
  margin: 0;
}

@media (min-width: 640px) {
  .booking-modal-dialog {
    width: min(36rem, 100%);
    border-radius: 1rem;
  }
}

.booking-modal-dialog > .card__title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-800, #084c36);
}

.modal-stepper {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.7rem;
  padding: 0.35rem;
  border-radius: 0.65rem;
  background: var(--brand-50, #eef8f3);
  border: 1px solid var(--brand-100, #d6f0e5);
}

.modal-stepper__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  color: var(--text-muted, #5c6b66);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
}

.modal-stepper__circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border, #d7e0dc);
  font-size: 0.72rem;
  font-weight: 700;
}

.modal-stepper__label {
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-stepper__step--current {
  color: var(--brand-700, #0b5e42);
}

.modal-stepper__step--current .modal-stepper__circle {
  background: var(--brand-700, #0b5e42);
  border-color: var(--brand-700, #0b5e42);
  color: #fff;
}

.modal-stepper__step--done {
  color: var(--brand-700, #0b5e42);
}

.modal-stepper__step--done .modal-stepper__circle {
  background: var(--brand-100, #d6f0e5);
  border-color: var(--brand-200, #a7ddc8);
  color: var(--brand-700, #0b5e42);
}

.booking-modal .modal-panel[hidden],
.booking-modal .booking-guest-step[hidden] {
  display: none !important;
}

.booking-modal .form-group {
  margin-bottom: 0.55rem;
}

.booking-modal .form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--brand-800, #084c36);
}

.booking-modal .form-control {
  width: 100%;
  min-height: 40px;
  border-radius: 0.55rem;
  border: 1px solid var(--border, #d7e0dc);
  padding: 0.4rem 0.65rem;
  background: var(--surface, #fff);
  color: var(--text, #1a2e28);
  font-size: 0.9rem;
}

.booking-modal .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.booking-modal .card__hint {
  margin: 0 0 0.55rem;
  color: var(--text-muted, #5c6b66);
  font-size: 0.78rem;
  line-height: 1.4;
}

.booking-guest-msg {
  color: var(--danger, #c0392b) !important;
  font-weight: 700;
}

.booking-summary {
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  background: var(--brand-50, #eef8f3);
  border: 1px solid var(--brand-100, #d6f0e5);
  margin-bottom: 0.65rem;
}

.booking-summary__title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-700, #0b5e42);
}

.booking-summary__list {
  margin: 0;
  display: grid;
  gap: 0.3rem;
}

.booking-summary__row {
  display: grid;
  grid-template-columns: minmax(3.5rem, 30%) 1fr;
  gap: 0.35rem;
  align-items: baseline;
  font-size: 0.8rem;
}

.booking-summary__row dt {
  margin: 0;
  color: var(--text-muted, #5c6b66);
  font-weight: 600;
}

.booking-summary__row dd {
  margin: 0;
  font-weight: 700;
  color: var(--text, #1a2e28);
  text-align: start;
  word-break: break-word;
}

.booking-service-field {
  margin-bottom: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--brand-50, #eef8f3) 75%, #fff);
  border: 1px solid var(--brand-100, #d6f0e5);
}

.booking-service-field__head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.4rem;
}

.booking-service-field__label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-800, #084c36);
}

.booking-service-field__hint {
  font-size: 0.72rem;
  color: var(--text-muted, #5c6b66);
  line-height: 1.35;
}

.service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.service-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 32px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--brand-200, #a7ddc8);
  background: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--brand-800, #084c36);
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.service-chip__check {
  display: none;
}

.service-chip__text {
  line-height: 1.25;
}

.service-chip.is-selected {
  border-color: var(--brand-700, #0b5e42);
  background: var(--brand-700, #0b5e42);
  color: #fff;
  box-shadow: none;
}

.service-chip.is-selected .service-chip__check {
  display: none;
}

.service-chip:focus-visible {
  outline: 2px solid var(--brand-700, #0b5e42);
  outline-offset: 2px;
}

.booking-service-note {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, #f4a261 12%, #fff);
  border: 1px solid color-mix(in srgb, #e76f51 28%, #f4d6c0);
}

.booking-service-note__title {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #9a3412;
}

.booking-service-note__body {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #7c2d12;
  white-space: pre-line;
}

.booking-note-field textarea {
  min-height: 2.5rem;
  resize: vertical;
}

.booking-confirm-hint {
  margin-bottom: 0.45rem !important;
}

.booking-otp-boxes {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.booking-otp-box {
  width: 3rem;
  min-height: 48px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.required-star {
  color: #b42318;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-chip,
  .aud-chip,
  .time-slot,
  .calendar-card--animated {
    animation: none !important;
    transition: none !important;
  }
}

html[data-theme="dark"] .booking-page.landing-section,
[data-theme="dark"] .booking-page.landing-section {
  background: var(--bg);
}

html[data-theme="dark"] .booking-panel,
[data-theme="dark"] .booking-panel,
html[data-theme="dark"] .aud-chip,
[data-theme="dark"] .aud-chip,
html[data-theme="dark"] .time-slot,
[data-theme="dark"] .time-slot,
html[data-theme="dark"] .quick-btn,
[data-theme="dark"] .quick-btn {
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .time-slot--available,
html[data-theme="dark"] .time-slot.is-bookable,
[data-theme="dark"] .time-slot--available,
[data-theme="dark"] .time-slot.is-bookable {
  background: color-mix(in srgb, var(--bk-brand) 22%, var(--surface));
  border-color: var(--brand-500, #2f8f6d);
}
