/* BOOKING */
.booking-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-top: 28px;
}

.stepper {
  display: flex;
  gap: 0;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.step-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 8px;
  border-radius: 100px;
  background: var(--bg-2);
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: background .2s, color .2s, box-shadow .2s;
}

.step-pill .n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  transition: background .2s, color .2s;
}

.step-pill.done {
  background: var(--brand-gradient);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47,166,160,.25);
}

.step-pill.done .n {
  background: rgba(255,255,255,.85);
  color: var(--brand);
}

.step-pill.current {
  background: #fff;
  border: 1.5px solid var(--brand);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(47,166,160,.14);
}

.step-pill.current .n {
  background: var(--brand-gradient);
  color: #fff;
}

.step-view { display: none; }
.step-view.active {
  display: block;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.area-pick {
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: left;
  background: var(--surface);
  transition: .15s;
  cursor: pointer;
  width: 100%;
}

.area-pick:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.icon-badge {
  display: inline-flex;
  font-size: 26px;
  color: var(--ink);
}
.area-pick .icon-badge { margin-bottom: 2px; }
.icon-badge.fisio { color: var(--fisio); }
.icon-badge.medicina { color: var(--medicina); }
.icon-badge.psicologia { color: var(--psico); }
.area-pick h4 { margin: 10px 0 4px; font-size: 17px; }
.area-pick p { margin: 0; font-size: 13px; color: var(--muted); }

.svc-pick {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: left;
  background: var(--surface);
  cursor: pointer;
  width: 100%;
}

.svc-pick:hover { border-color: var(--brand); }
.svc-pick h4 { font-size: 15.5px; margin: 0 0 8px; }

.cal-time-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
}

@media (max-width: 760px) {
  .cal-time-grid { grid-template-columns: 1fr; }
}

/* Aviso cuando un enlace directo trae un dato que ya no sirve
   (servicio dado de baja, fecha pasada, horario ocupado). */
.link-aviso {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #f0c36d;
  background: #fdf6e3;
  color: #8a6100;
  font-size: 13.5px;
  line-height: 1.4;
}

/* Recordatorio de lo elegido en los pasos 1 y 2, encima del calendario. */
.cal-seleccion {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cal-seleccion .cal-area {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 3px;
}

.cal-seleccion .cal-servicio {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.35;
}

.cal-seleccion .cal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* El precio destaca sobre la duración: es el dato que se va a confirmar. */
.cal-seleccion .cal-precio b {
  color: var(--text);
  font-size: 14px;
}

.cal-seleccion .cal-precio .svc-price-old {
  margin-right: 5px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-nav {
  display: flex;
  gap: 6px;
}

.cal-nav button {
  border: 1px solid var(--border);
  background: var(--surface);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.cal-nav button:hover { border-color: var(--brand); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 6px;
  letter-spacing: .03em;
}

.cal-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  position: relative;
  font-weight: 600;
  cursor: pointer;
}

.cal-day.enabled:hover { border-color: var(--brand); }
.cal-day.disabled {
  opacity: .28;
  pointer-events: none;
}
.cal-day.empty {
  background: transparent;
  pointer-events: none;
}

.cal-day .d {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--medicina);
  position: absolute;
  bottom: 6px;
}

.cal-day.selected {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(47,166,160,.3);
}

.cal-day.selected .d { background: #fff; }

.time-box h4 { font-size: 15.5px; margin-bottom: 12px; }

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.time-slot {
  padding: 8px 0 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.time-slot .cupos-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
}

.time-slot:hover { border-color: var(--brand); }
.time-slot.selected {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(47,166,160,.3);
}
.time-slot.selected .cupos-label { color: rgba(255,255,255,.8); }

.time-slot.disabled {
  cursor: not-allowed;
  opacity: .55;
  background: var(--bg-2);
}
.time-slot.disabled:hover { border-color: var(--border); }
.time-slot.disabled .hora-label { text-decoration: line-through; }
.time-slot.disabled .cupos-label { color: #d9534f; }

.empty-note {
  color: var(--muted);
  font-size: 14px;
  padding: 14px 0;
}

.form-cols {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

@media (max-width: 760px) {
  .form-cols { grid-template-columns: 1fr; }
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.field label .opt {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14.5px;
  background: var(--surface);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.summary-ticket {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  position: sticky;
  top: 90px;
}

.summary-ticket .num {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.summary-ticket .area-name {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
}

.summary-ticket .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  margin-top: 8px;
}

.summary-ticket .tag.fisio {
  background: var(--fisio-soft);
  color: var(--fisio);
}

.summary-ticket .tag.medicina {
  background: var(--medicina-soft);
  color: var(--medicina);
}

.summary-ticket .tag.psicologia {
  background: var(--psico-soft);
  color: var(--psico);
}

.summary-ticket .sep {
  border-top: 1px dashed var(--border);
  margin: 14px 0;
}

.summary-ticket .row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin: 9px 0;
  color: var(--muted);
}

.summary-ticket .row b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
}

.confirm-box {
  text-align: center;
  padding: 30px 10px;
}

.confirm-box .badge {
  font-size: 13px;
  font-weight: 700;
  background: var(--ok-soft);
  color: var(--ok-ink);
  padding: 7px 16px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}


/* ===== MODAL DE RESERVA ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 20, 22, 0.7);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 56px 16px;
  animation: overlayFadeIn .25s ease;
}

@keyframes overlayFadeIn {
  from { background: rgba(10, 20, 22, 0); backdrop-filter: blur(0); }
  to { background: rgba(10, 20, 22, 0.7); backdrop-filter: blur(6px); }
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 700px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  margin: auto;
  animation: modalFadeIn 0.35s cubic-bezier(.16,.84,.44,1);
  border: 1px solid var(--border);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, transform .15s;
  z-index: 10;
}

.modal-close:hover {
  background: var(--danger);
  color: #fff;
  transform: rotate(90deg);
}

/* Modal de reserva - más ancho */
.modal-overlay.booking-modal .modal-box {
  max-width: 900px;
}

/* El modal ya es la tarjeta (fondo blanco + borde + sombra); si el
   booking-panel trae la suya propia adentro se ve como un "marco" doblado.
   Solo aplica dentro del modal — en la página "Reservar" (inline, sin modal)
   el booking-panel sigue siendo su propia tarjeta. */
.modal-overlay.booking-modal .booking-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-top: 0;
}

/* ===== VISOR DE MEDIOS DE LA GALERÍA (imágenes / videos / embeds) ===== */
.modal-overlay.media-modal {
  align-items: center;
  padding: 40px 16px;
}

.modal-box.media-modal-box {
  max-width: 900px;
  padding: 0;
  background: #0c1720;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* Barra fija arriba del video/imagen — título y "X" viven acá, nunca sobre el contenido */
.media-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 18px;
  border: none;
  background: #0c1720;
}

.media-modal-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-modal-header:has(.media-modal-title:empty) .media-modal-title { display: none; }

.media-modal-body {
  width: 100%;
  background: #0c1720;
  line-height: 0;
}

.media-modal-body img,
.media-modal-body video {
  max-height: 82vh;
  width: 100%;
  display: block;
  object-fit: contain;
  border-radius: 0;
}

/* Los embeds (YouTube/TikTok/Facebook) usan el truco de padding-bottom para
   mantener su proporción, pero eso los deja sin ancho dentro de un contenedor
   flex — por eso antes se veían en negro. Forzamos que ocupen todo el ancho. */
.media-modal-body > .embed-16x9,
.media-modal-body > .embed-tiktok {
  width: 100%;
  border-radius: 0;
}

.media-modal-body > .empty-note {
  padding: 40px 24px;
  text-align: center;
  color: rgba(255,255,255,.75);
  background: #0c1720;
}
.media-modal-body > .empty-note a { color: var(--brand-2); font-weight: 700; }

/* Dentro de la barra, la "X" es parte del flujo (no flotante sobre el video) */
.modal-overlay.media-modal .modal-close {
  position: static;
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
  color: #fff;
  width: 32px;
  height: 32px;
}
.modal-overlay.media-modal .modal-close:hover { background: var(--danger); }

@media (max-width: 600px) {
  .modal-overlay.media-modal { padding: 0; align-items: center; }
  .modal-box.media-modal-box { max-width: 100%; }
  .media-modal-body { border-radius: 0; }
}

/* Responsive para móviles */
@media (max-width: 600px) {
  .modal-overlay.booking-modal {
    padding: 0;
  }
  .modal-overlay.booking-modal .modal-box {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    padding: 20px;
  }
  .modal-overlay.booking-modal .modal-close {
    top: 12px;
    right: 12px;
  }
  .modal-overlay.booking-modal .booking-panel {
    border-radius: 0;
    min-height: 100vh;
    padding: 20px 0;
  }
}