/* ==========================================================
   Booking page — builds on ../styles.css
   ========================================================== */

.book-page { background: var(--surface); }
.book { padding: 32px 0 80px; }
.book__back { display: inline-block; margin-bottom: 20px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--caption); }
.book__back:hover { color: var(--primary); }
.book__head { max-width: 640px; margin-bottom: 28px; }
.book__head h1 { font-size: clamp(2rem, 4vw, 3rem); }
.book__head .lead { color: var(--caption); margin: 0; }

/* Stepper */
.stepper { list-style: none; margin: 0 0 24px; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper li {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 6px;
  border-radius: 999px; background: #fff; border: 1px solid var(--border);
  font-size: 15px; color: var(--caption);
}
.stepper span {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface); font-size: 13px; font-weight: 700; color: var(--caption);
}
.stepper .is-current { border-color: var(--primary); color: var(--heading); font-weight: 600; }
.stepper .is-current span { background: var(--primary); color: #fff; }
.stepper .is-done span { background: var(--blue-50); color: var(--primary); }

/* Layout */
.book__grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.book__panel {
  background: #fff; border-radius: 20px; padding: 32px; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.pane h2 { font-size: 1.5rem; margin-bottom: 18px; }
.pane__sub { margin: -10px 0 18px; color: var(--caption); }
.pane__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.hint { margin: 18px 0 0; font-size: 14px; color: var(--caption); }

/* Calendar */
.picker { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: start; }
.cal { width: 100%; }
.times { border-left: 1px solid var(--border); padding-left: 32px; min-height: 100%; }
.times__day { margin: 6px 0 16px; font-weight: 600; color: var(--heading); }
.times__day.is-empty { font-weight: 400; color: var(--caption); }
.cal__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal__month { font-size: 1rem; color: var(--heading); }
.cal__nav {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
  font-size: 20px; line-height: 1; color: var(--heading); cursor: pointer;
}
.cal__nav:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.cal__nav:disabled { opacity: .35; cursor: default; }
.cal__dow, .cal__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__dow span { text-align: center; font-size: 11px; font-weight: 600; color: var(--caption); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.day {
  position: relative; height: 42px; border-radius: 50%; border: 0; background: transparent;
  font: 500 15px var(--font); color: var(--heading); cursor: pointer; transition: all .15s;
}
.day:not(:disabled) { background: var(--blue-50); color: var(--primary); font-weight: 600; }
.day:hover:not(:disabled) { background: var(--blue-100); }
.day:disabled { color: #c3cad8; cursor: default; }
.day.is-today::after {
  content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--orange);
}
.day[aria-pressed="true"], .day[aria-pressed="true"]:hover { background: var(--primary); color: #fff; }
.day:focus-visible, .slot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Time slots */
.slots__group + .slots__group { margin-top: 18px; }
.slots__group h3 { font-size: 14px; font-weight: 600; color: var(--caption); margin-bottom: 10px; }
.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  height: 44px; border-radius: var(--r-md); border: 1px solid #d9e3f5; background: #fff;
  font: 500 15px var(--font); color: var(--heading); cursor: pointer; transition: all .15s;
}
.slot:hover { border-color: var(--primary); color: var(--primary); }
.slot[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Details */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field--full { grid-column: 1 / -1; }
.field small { font-weight: 400; color: var(--caption); }
.field textarea.is-invalid, .field select.is-invalid { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-row[hidden] { display: none; }
.field select {
  width: 100%; height: 48px; font: 16px var(--font); color: var(--heading); cursor: pointer;
  padding: 0 36px 0 14px; border-radius: var(--r-md); border: 1px solid #d9e3f5; background: var(--surface);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6578' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px;
}
.field select:focus { outline: none; background-color: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--blue-50); }
.field.is-invalid legend { color: #b4232a; }
.field.is-invalid .opt span { border-color: var(--danger); }
.form__error { margin-top: 16px; }


/* Done */
.pane--done { text-align: center; }
.pane--done .pane__actions { justify-content: center; }
.done__tick { width: 64px; height: 64px; margin: 4px auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); color: var(--primary); }
.done__tick svg { width: 32px; height: 32px; }
#done-when { font-size: 1.1rem; color: var(--heading); font-weight: 500; }
.done__copy {
  width: 100%; margin-top: 16px; font: 14px/1.5 var(--font); color: var(--foreground); text-align: left;
  padding: 12px 14px; border-radius: var(--r-md); border: 1px solid #d9e3f5; background: var(--surface); resize: none;
}

/* Summary */
.summary {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--navy); color: #aab3c5; border-radius: 20px; padding: 24px;
}
.summary h3 { color: #fff; margin-bottom: 14px; }
.summary ul { list-style: none; margin: 0 0 16px; padding: 0; }
.summary li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.summary small { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.summary span { color: #fff; font-weight: 500; }
.summary p { margin: 0; font-size: 14px; }

@media (max-width: 860px) {
  .picker { grid-template-columns: 1fr; gap: 20px; }
  .cal { max-width: 360px; margin-inline: auto; }
  .times { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
  .times { scroll-margin-top: calc(var(--header-h) + 12px); }
  .day { height: 44px; }
  .book__grid { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; padding: 18px 20px; }
  .summary ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; margin: 0; }
  .summary li:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .summary h3, .summary p { display: none; }
}

@media (max-width: 680px) {
  body.book-page { padding-bottom: 0; }
  .book { padding: 20px 0 56px; }
  .book__panel { padding: 22px 18px; }
  .stepper { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 0 16px; scrollbar-width: none; }
  .stepper li { flex: none; }
  .fields { grid-template-columns: 1fr; }
  .pane__actions .btn { flex: 1; }
  /* Step 1 already shows the chosen day/time, so keep the calendar near the top */
  .book-page[data-step="1"] .summary { display: none; }
  .book__head .lead { display: none; }
  .book__back { margin-bottom: 12px; }
  /* Only the current step shows its label */
  .stepper li:not(.is-current) { padding-right: 6px; font-size: 0; }
  .stepper li:not(.is-current) span { font-size: 13px; }
  .pane h2 { font-size: 1.3rem; }
  .book__head { margin-bottom: 20px; }
  .book__head .lead { font-size: 15px; }
  .slots__grid { grid-template-columns: repeat(3, 1fr); }
  .field-row { gap: 8px; }
  .field select { padding: 0 28px 0 12px; background-position: right 10px center; }
  .options { gap: 6px; }
  .opt span { padding: 9px 13px; }
}
