/* ==========================================================================
   Reservas online — página pública (reservas.html) y gestión (reserva.html)
   Usa las variables de style.css / theme.css para respetar el modo oscuro.
   ========================================================================== */

.booking-page { max-width: 760px; padding-bottom: 64px; }
.booking-page [hidden] { display: none !important; }
.booking-head { margin: 8px 0 22px; }
.booking-card, .booking-done { scroll-margin-top: 150px; }
.booking-kicker { margin: 0 0 4px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.booking-head h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.1; }
.booking-lead { margin: 0; color: var(--muted); max-width: 58ch; }

.booking-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(var(--shadow-color, 15,15,15), .04);
}
.booking-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.15rem; }
.step-n {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-cta); color: #fff; font-size: .85rem; font-weight: 700;
}
[data-theme="dark"] .step-n { color: #052a27; }
.step.is-disabled { opacity: .55; }
.step.is-disabled .chip-row, .step.is-disabled .service-block { pointer-events: none; }

.hint { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }
.hint.small { font-size: .8rem; margin-top: 2px; }

/* ---------- carga / mensajes ---------- */
.booking-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner-lg { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary-cta); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.booking-msg h2 { display: block; }

/* ---------- chips (personas y horas) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-width: 48px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2, #f7f8f9); color: var(--accent);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background var(--transition-fast, .15s), border-color var(--transition-fast, .15s), transform var(--transition-fast, .15s);
}
.chip:hover:not(:disabled) { border-color: var(--primary-cta); }
.chip:active:not(:disabled) { transform: scale(.97); }
.chip:focus-visible { outline: 3px solid rgba(63,214,203,.45); outline-offset: 2px; }
.chip[aria-checked="true"], .chip.is-selected { background: var(--primary-cta); border-color: var(--primary-cta); color: #fff; }
[data-theme="dark"] .chip[aria-checked="true"], [data-theme="dark"] .chip.is-selected { color: #052a27; }
.chip:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* ---------- calendario ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { margin: 0; font-weight: 700; text-transform: capitalize; }
.cal-nav { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--accent); cursor: pointer; display: grid; place-items: center; }
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-day {
  position: relative; aspect-ratio: 1 / 1; min-height: 40px;
  border-radius: 10px; border: 1px solid transparent;
  background: var(--surface-2, #f7f8f9); color: var(--accent);
  font: inherit; font-weight: 600; cursor: pointer;
}
.cal-day::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #2fb8ad; }
.cal-day.is-full::after { background: #d6a2a2; }
.cal-day:hover:not(:disabled) { border-color: var(--primary-cta); }
.cal-day:focus-visible { outline: 3px solid rgba(63,214,203,.45); outline-offset: 2px; }
.cal-day.is-today { border-color: var(--border); box-shadow: inset 0 0 0 1px var(--muted); }
.cal-day.is-selected { background: var(--primary-cta); color: #fff; }
.cal-day.is-selected::after { background: #fff; }
[data-theme="dark"] .cal-day.is-selected { color: #052a27; }
.cal-day:disabled { background: transparent; color: var(--muted); opacity: .45; cursor: not-allowed; }
.cal-day:disabled:not(.is-full)::after, .cal-empty::after { display: none; }
.cal-day.is-full:disabled { opacity: .6; }
.cal-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; font-size: .8rem; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; }
.dot:first-child { margin-left: 0; }
.dot-free { background: #2fb8ad; }
.dot-full { background: #d6a2a2; }

/* ---------- servicios y horas ---------- */
.service-block { padding: 14px 0; border-top: 1px solid var(--border); }
.service-block:first-child { border-top: 0; padding-top: 0; }
.service-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.service-head h3 { margin: 0; font-size: 1rem; }
.service-left { font-size: .82rem; color: var(--muted); }
.service-left.is-low { color: #b7791f; font-weight: 600; }
.service-closed { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- datos ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row input, .form-row textarea { font-size: 16px; } /* evita el zoom de iOS */
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.privacy-box { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2, #f7f8f9); border: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.privacy-box p { margin: 0 0 12px; line-height: 1.55; }
.privacy-box.has-error { border-color: #e05252; }
.privacy-box .field-error { margin-top: 6px; }
.privacy-box.has-error .field-error { display: block; }
.check { display: flex; align-items: flex-start; gap: 10px; color: var(--accent); font-size: .92rem; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--primary-cta); }

#turnstile-box:not(:empty) { margin-top: 16px; }

.booking-summary:not(:empty) {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  border: 1px dashed var(--primary-cta); font-weight: 600; line-height: 1.5;
}
.form-submit { margin-top: 16px; }
.btn-lg { width: 100%; min-height: 52px; font-size: 1.05rem; justify-content: center; }
#booking-status { margin-top: 12px; }

/* ---------- confirmación ---------- */
.booking-done { text-align: center; padding: 34px 22px; }
.booking-done h2 { display: block; font-size: 1.5rem; margin: 10px 0; }
.done-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(63,214,203,.18); color: #138a80; }
[data-theme="dark"] .done-icon { color: #8fe9df; }
.done-summary { font-size: 1.1rem; font-weight: 700; }
.booking-done .btn { margin-top: 10px; }

/* ---------- gestionar reserva ---------- */
.mg-status { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: rgba(63,214,203,.18); color: #0b5a53; }
.mg-status.is-cancelled { background: rgba(224,82,82,.12); color: #a33131; }
[data-theme="dark"] .mg-status { color: #8fe9df; }
[data-theme="dark"] .mg-status.is-cancelled { color: #ff9c9c; }
.mg-details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 18px; }
.mg-details div { padding: 12px; border-radius: 10px; background: var(--surface-2, #f7f8f9); }
.mg-details dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mg-details dd { margin: 2px 0 0; font-weight: 700; }
.mg-details dd::first-letter { text-transform: uppercase; }
.btn-danger { color: #c53030 !important; border-color: #c53030 !important; }
.btn-danger-solid { background: #c53030 !important; border-color: #c53030 !important; color: #fff !important; }
.mg-confirm { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid rgba(224,82,82,.35); }
.mg-confirm .btn { margin: 6px 6px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .chip, .cal-day { transition: none; }
  .spinner-lg { animation-duration: 1.5s; }
}
