/* ===================================================================
   RESERVATIONS — page-specific styles
   ================================================================== */

/* ---------- BOOKING SECTION ---------- */
.booking-section {
  padding: clamp(4rem, 8vw, 6rem) clamp(1.5rem, 8vw, 8rem);
  background: var(--cream);
}
.booking-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* ---------- EXPECT CARD ---------- */
.expect-card {
  background: var(--beige);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 3vw, 3rem);
}
.expect-card h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}
.expect-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.expect-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  /* `min-width: 0` lets the text column shrink below its content's
     intrinsic min-width — without it, an unbreakable word like
     "argumentaire" would force the card wider than its viewport at
     320px. */
  min-width: 0;
}
/* Target only the text column (the icon is `.expect-ico`). `min-width: 0`
   lets it shrink, `flex: 1` makes it claim the remaining row width, and
   `overflow-wrap: anywhere` lets long French words like "argumentaire"
   break at any character on tight phones. */
.expect-list li > div:not(.expect-ico) {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.expect-ico {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.expect-ico svg {
  width: 100%;
  height: 100%;
  stroke: var(--indigo);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.expect-ico-fill svg {
  fill: var(--indigo);
  stroke: none;
}
.expect-list strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}
.expect-list span {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
.expect-tz {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(47, 39, 31, 0.08);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}
.expect-tz strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- BOOKING CARD ---------- */
.booking-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 3vw, 3rem);
  border: 1px solid rgba(47, 39, 31, 0.06);
}
.booking-header {
  margin-bottom: 2rem;
}
.booking-header h2 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}
.booking-header p {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- STEPPER ---------- */
.stepper {
  display: flex;
  gap: 0;
  list-style: none;
  margin-bottom: 2rem;
  position: relative;
}
.stepper::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--beige);
  z-index: 0;
}
.stepper-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  z-index: 1;
}
.stepper-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Archivo Black", sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  transition: all 0.3s ease;
}
.stepper-item.is-active .stepper-index {
  background: var(--indigo);
  color: #fff;
}
.stepper-item.is-done .stepper-index {
  background: var(--ink);
  color: var(--cream);
}
.stepper-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}
.stepper-item.is-active .stepper-label {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- FORM ---------- */
.step-heading {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--ink);
  outline: none;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.optional-chip {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--cream);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}
.form-row input,
.form-row textarea {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(47, 39, 31, 0.12);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(50, 66, 143, 0.08);
}
.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
  border-color: var(--red);
}
.form-row textarea {
  resize: vertical;
  min-height: 80px;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- DATE PICKER (flatpickr) ---------- */
#date-picker .flatpickr-calendar {
  box-shadow: none;
  border-radius: 12px;
  border: 1px solid rgba(47, 39, 31, 0.08);
  background: var(--cream);
  font-family: "Inter", sans-serif;
}
#date-picker .flatpickr-day.selected,
#date-picker .flatpickr-day.selected:hover {
  background: var(--indigo);
  border-color: var(--indigo);
  color: #fff;
}
#date-picker .flatpickr-day.today {
  border-color: var(--indigo);
  color: var(--indigo);
}
#date-picker .flatpickr-day:hover {
  background: rgba(50, 66, 143, 0.08);
}
#date-picker .flatpickr-months .flatpickr-month {
  color: var(--ink);
}
#date-picker .flatpickr-current-month .flatpickr-monthDropdown-months,
#date-picker .flatpickr-current-month input.cur-year {
  color: var(--ink);
}
#date-picker .flatpickr-weekday {
  color: var(--muted);
}
#date-picker .flatpickr-day.flatpickr-disabled {
  color: rgba(47, 39, 31, 0.2);
}

/* ---------- TIME SLOTS ---------- */
#time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
}
.slots-loading,
.slots-none {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 1rem 0.5rem;
}
.time-slot-option {
  position: relative;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(47, 39, 31, 0.12);
  background: var(--cream);
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.time-slot-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.time-slot-option:hover {
  border-color: var(--indigo);
}
.time-slot-option.is-selected {
  border-color: var(--indigo);
  border-width: 2px;
  background: rgba(50, 66, 143, 0.08);
  font-weight: 600;
}
.time-slot-option .slot-time {
  font-size: 0.92rem;
  color: var(--ink);
}
.time-slot-option .slot-sub {
  font-size: 0.68rem;
  color: var(--muted);
}

/* ---------- STEP ACTIONS ---------- */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}
.step-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- REVIEW ---------- */
.review {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
}
.review-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(47, 39, 31, 0.06);
}
.review-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}
.review-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}
a.review-value {
  color: var(--indigo);
  text-decoration: none;
}
a.review-value:hover {
  text-decoration: underline;
}
.review-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* ---------- SUCCESS ---------- */
.success-wrap {
  text-align: center;
  padding: 1rem 0;
}
.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
}
.success-icon svg {
  width: 100%;
  height: 100%;
}
.success-icon circle {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 2;
}
.success-icon path {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-wrap h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.success-wrap > p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.success-summary {
  background: var(--cream);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.success-summary .review-row:last-child {
  border-bottom: none;
}
.success-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.success-footnote {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

#confirm-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- NOTIFICATION (errors only — kept by reservations.js) ---------- */
.notification {
  position: fixed;
  top: 90px;
  right: 1.5rem;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: var(--z-toast);
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 360px;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.notification.show {
  opacity: 1;
  transform: translateY(0);
}
.notification .close-btn {
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
}
.notification .close-btn:hover {
  opacity: 1;
}

/* ---------- TIME-SLOT SKELETON LOADER ---------- */
/* Placeholder slots that fade in while /availability is loading. Same
   shell as a real .time-slot-option so the layout doesn't shift when
   the real data lands. .skel and its keyframes live in shared.css. */
.time-slot-skel {
  pointer-events: none;
  border-color: rgba(47, 39, 31, 0.06);
  background: var(--white);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.time-slot-skel .skel-line {
  height: 0.95rem;
  width: 60px;
  margin: 0;
}

/* Required-field marker for the booking form (asterisk next to label
   text). Optional fields keep their existing chip; this matches the
   visual weight without being noisy. */
.required-marker {
  color: var(--red);
  font-weight: 700;
  margin-left: 0.18rem;
}

/* Step-1 hint: greens out + checkmarks when date+time are selected so the
   user gets visible confirmation, not just a button enabled state. */
#step1-hint {
  transition: color 200ms ease;
}
#step1-hint.is-ready {
  color: var(--green);
  font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  /* `minmax(0, 1fr)` instead of plain `1fr` — without it the track's
     implicit minimum is `auto`, which means an unbreakable word inside
     a card can force the column wider than the viewport on tight phones. */
  .booking-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 480px) {
  /* Mobile: 2-column slot grid + bigger tap targets (WCAG 44px). */
  #time-slots {
    grid-template-columns: 1fr 1fr !important;
  }
  .time-slot-option {
    min-height: 48px;
  }
}

/* Tight phones (~320–380px): the cards' generous clamp() padding
   eats most of the viewport, leaving the body copy ~150px wide and
   words wrap mid-character. Trim the gutters and dial down a few
   font sizes so everything fits without horizontal overflow. */
@media (max-width: 380px) {
  .booking-section {
    padding: 4rem 0.85rem 3rem;
  }
  .expect-card,
  .booking-card {
    padding: 1.5rem 1.15rem;
  }
  .expect-card h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  .expect-list {
    gap: 1.1rem;
  }
  .expect-list li {
    gap: 0.7rem;
  }
  .expect-ico {
    width: 30px;
    height: 30px;
    padding: 6px;
  }
  .expect-list strong {
    font-size: 0.92rem;
  }
  .expect-list span {
    font-size: 0.84rem;
    line-height: 1.5;
  }
  .expect-tz {
    font-size: 0.74rem;
  }
  .booking-header h2 {
    font-size: 1.2rem;
  }
  .booking-header p {
    font-size: 0.85rem;
  }
  /* Stepper indicator + label can run too wide for 4 steps on a phone. */
  .stepper {
    gap: 0;
    margin-bottom: 1.5rem;
  }
  .stepper-index {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }
  .stepper-label {
    font-size: 0.65rem !important;
  }
}
