/* ═══════════════════════════════════════════════════════════════
   PRIMMATE — pages/reserva.css
   Página de reserva pública sin login
═══════════════════════════════════════════════════════════════ */

/* ── Encabezado de la página ────────────────────────────────── */
.booking-page { background: var(--bg-primary); min-height: 100vh; }

.booking-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-8) 0 var(--space-6);
  margin-top: 72px;
}

.booking-hero__inner { display: flex; flex-direction: column; gap: var(--space-2); }

.booking-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  margin-bottom: var(--space-3);
  width: fit-content;
}
.booking-back:hover { color: var(--gold); }

.booking-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
}

.booking-hero__sub {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* ── Layout principal ────────────────────────────────────────── */
.booking-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-12);
  align-items: start;
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}

/* ── Stepper lateral ─────────────────────────────────────────── */
.booking-steps {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
}

.step::before {
  content: '';
  position: absolute;
  left: 23px; top: 52px;
  width: 2px; height: var(--space-2);
  background: var(--border);
}
.step:last-child::before { display: none; }

.step--active  { background: var(--gold-subtle); }
.step--done    { background: transparent; }
.step--locked  { opacity: 0.45; pointer-events: none; }

.step__num {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.step--active  .step__num { border-color: var(--gold); color: var(--gold); }
.step--done    .step__num { border-color: var(--gold); background: var(--gold); color: #000; }

.step__label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.step--active .step__label { color: var(--gold); }
.step--done   .step__label { color: var(--text-secondary); }

.step__value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-top: 2px;
  font-weight: 500;
}

/* ── Paneles del formulario ──────────────────────────────────── */
.booking-panel { display: none; }
.booking-panel.active { display: block; animation: fadeSlide 0.3s ease; }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.booking-panel__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.booking-panel__sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.booking-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* ── Selector de barbero ─────────────────────────────────────── */
.barber-selector {
  display: flex;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.barber-option input { display: none; }

.barber-option__card {
  width: 180px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-3) var(--space-4);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.barber-option__card:hover {
  border-color: var(--gold-border);
  transform: translateY(-3px);
}

.barber-option input:checked + .barber-option__card {
  border-color: var(--gold);
  background: var(--gold-subtle);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.barber-option__photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
  display: block;
  transition: transform 0.3s ease;
}

.barber-option input:checked + .barber-option__card .barber-option__photo,
.barber-option__card:hover .barber-option__photo {
  transform: scale(1.03);
}

.barber-option__avatar {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 2px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gold);
  margin: 0 auto var(--space-4);
}

.barber-option__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.barber-option__title {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ── Selector de servicio ────────────────────────────────────── */
.service-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.service-option input { display: none; }

.service-option__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-6);
  cursor: pointer;
  transition: var(--transition);
}

.service-option__card:hover { border-color: var(--gold-border); }

.service-option input:checked + .service-option__card {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.service-option__name {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.service-option__dur {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.service-option__price {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Calendario ──────────────────────────────────────────────── */
.cal-wrap { margin-bottom: var(--space-6); }

.cal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: calIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes calIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.cal__month {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

.cal__nav {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: var(--transition);
  line-height: 0;
}

.cal__nav:hover:not([disabled]) { color: var(--gold); background: var(--gold-subtle); }
.cal__nav[disabled]              { opacity: 0.25; cursor: not-allowed; }

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: var(--space-4) var(--space-5);
}

.cal__dow {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--space-3);
}

.cal__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-family: var(--font-heading);
  font-weight: 500;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.cal__day--empty   { background: none; }

.cal__day--past,
.cal__day--closed  { color: var(--text-muted); opacity: 0.3; }

.cal__day--available {
  color: var(--text-primary);
  cursor: pointer;
  border: 1.5px solid transparent;
}

.cal__day--available:hover {
  border-color: var(--gold-border);
  background: var(--gold-subtle);
  color: var(--gold);
  transform: scale(1.08);
}

.cal__day--selected {
  background: var(--gold) !important;
  color: #000 !important;
  font-weight: 700;
  border-color: var(--gold) !important;
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.35);
}

.cal__day--today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.cal__day--selected.cal__day--today::after { background: #000; }

/* ── Slots de horario ────────────────────────────────────────── */
.slots-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: var(--space-6) 0;
}

.slots-hint--loading {
  opacity: 0.6;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 0.3; }
}

/* Skeleton del calendario (mientras carga la disponibilidad) */
.cal-skeleton {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: var(--space-4) var(--space-5);
}
.cal-skeleton__cell {
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  background-image: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-elevated) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}

.time-slots { margin: var(--space-6) 0; }

.slots-appear {
  animation: slotsIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.slots-section-label {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--space-3);
}

.slot-btn {
  padding: 10px 18px;
  min-height: var(--touch-min);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.slot-btn:hover     { border-color: var(--gold-border); color: var(--text-primary); }
.slot-btn.selected  { border-color: var(--gold); background: var(--gold-subtle); color: var(--gold); font-weight: 700; }
.slot-btn:disabled  { opacity: 0.3; cursor: not-allowed; }

/* ── NUEVO: Barra de progreso mobile (reemplaza stepper) ───── */
.booking-progress {
  display: none;
  margin-bottom: var(--space-6);
}

.booking-progress__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
}

.booking-progress__step {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

.booking-progress__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.booking-progress__track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.booking-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: var(--radius-full);
  width: 25%;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Resumen de reserva ──────────────────────────────────────── */
.booking-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: none;
}

.booking-summary.visible { display: block; }

.booking-summary__title {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}

.booking-summary__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.booking-summary__row:last-child { border-bottom: none; }
.booking-summary__row strong { color: var(--text-primary); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .booking-layout {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-top: var(--space-6);
  }

  /* Ocultar stepper lateral y mostrar barra de progreso en su lugar */
  .booking-steps { display: none; }
  .booking-progress { display: block; }

  .booking-hero { padding: var(--space-6) 0 var(--space-4); }
  .booking-hero__title { font-size: var(--text-3xl); }

  /* Barberos en grid 2 columnas mobile (en vez de wrap chico) */
  .barber-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }
  .barber-option__card { width: 100%; }

  /* Botones en orden natural: Atrás arriba, Continuar abajo (primario al alcance del pulgar) */
  .booking-nav { flex-direction: column; }
  .booking-nav .btn { width: 100%; justify-content: center; }

  /* Service-option más cómodo de tocar */
  .service-option__card { min-height: 64px; }
}

@media (max-width: 480px) {
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}
