/*
  Flujo de reserva público: servicio -> día y hora -> datos -> confirmación. Usa el mismo sistema
  de diseño que la landing (site.css y el estilo elegido), así reservar se siente parte del sitio.
*/

.booking {
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem);
}

.booking h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.booking h2 {
  font-size: 1.2rem;
}

.lead-sm {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Pasos */

.stepper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  counter-reset: none;
}

.step-label {
  white-space: nowrap;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  margin-inline: 0.4rem;
  background: var(--border);
  border-radius: 2px;
}

.step.is-done:not(:last-child)::after {
  background: var(--accent);
}

.step-dot {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--bg);
}

.step-dot .icon {
  width: 15px;
  height: 15px;
  stroke-width: 3;
}

.step.is-current {
  color: var(--text);
  font-weight: 700;
}

.step.is-current .step-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.step.is-done .step-dot {
  border-color: var(--accent);
  color: var(--link);
}

@media (max-width: 560px) {
  .step-label {
    display: none;
  }

  .step.is-current .step-label {
    display: inline;
  }
}

/* Estructura */

.booking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.booking-aside {
  position: sticky;
  top: calc(var(--header-h) + 1.25rem);
  display: grid;
  gap: 1rem;
}

@media (max-width: 900px) {
  .booking-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .booking-aside {
    position: static;
  }

  /* El resumen del turno va arriba (se lo ve mientras se elige); la ayuda, al final. */
  .booking-aside--summary {
    order: -1;
  }

  .booking-aside--summary .summary-card {
    padding: 0.85rem 1.1rem;
  }

  .booking-aside--summary .summary-card h2 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
  }

  .booking-aside--summary .summary-list > div {
    padding: 0.3rem 0;
  }
}

.back-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.back-inline:hover {
  color: var(--text);
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
}

.summary-card h2 {
  margin-bottom: 0.9rem;
}

.summary-list {
  margin: 0;
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.summary-list .summary-total {
  border-bottom: 0;
  font-size: 1.1rem;
}

.summary-list .summary-total dd {
  color: var(--heading);
}

.summary-card .link-arrow {
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.help-list {
  display: grid;
  gap: 0.6rem;
}

.help-list a,
.help-list span {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
}

.help-list a:hover {
  color: var(--link);
}

.summary-card .status-pill {
  margin: 1rem 0 0;
}

/* Paso 1: servicios */

.option-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.option-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.option-main {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
}

.option-main strong {
  font-size: 1.1rem;
}

.option-side {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: none;
}

.option-arrow {
  color: var(--link);
  transition: transform 0.2s var(--ease);
}

.option-card:hover .option-arrow {
  transform: translateX(4px);
}

.empty {
  margin-top: 1.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty-sm {
  margin-top: 0.75rem;
  padding: 1.5rem 1rem;
}

/* Paso 2: profesional, día y horario */

.picker {
  border: 0;
  padding: 0;
  margin: 1.75rem 0 0;
  min-width: 0;
}

.picker legend {
  padding: 0;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1.05rem;
}

.with-pro {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--accent-soft);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill,
.day {
  position: relative;
  display: block;
  cursor: pointer;
}

.pill input,
.day input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.pill-body {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.pill:hover .pill-body {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.pill input:checked + .pill-body,
.day input:checked + .day-body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.pill input:focus-visible + .pill-body,
.day input:focus-visible + .day-body {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.pill .avatar {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.day-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.3rem 0.3rem 0.8rem;
  margin-inline: -0.3rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.day {
  flex: none;
  scroll-snap-align: start;
}

.day-body {
  display: grid;
  justify-items: center;
  gap: 0.05rem;
  width: 68px;
  padding: 0.7rem 0.3rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.15;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.day:hover .day-body {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-2px);
}

.day-name {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.day-num {
  font-size: 1.45rem;
  font-weight: 700;
  font-family: var(--font-head);
}

.day-month {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
}

.slots-panel {
  margin-top: 1.25rem;
}

.slots {
  margin-top: 0.75rem;
  min-height: 8rem;
  transition: opacity 0.2s;
}

.slots.htmx-request {
  opacity: 0.45;
}

.slots-date {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.slot-group {
  margin-top: 1rem;
}

.slot-group h3 {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.6rem;
}

.slot {
  display: block;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-decoration: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.slot:hover,
.slot:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: translateY(-2px);
}

/* Paso 3: datos */

.booking-form {
  margin-top: 1.75rem;
  display: grid;
  gap: 1.1rem;
  max-width: 560px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-btn);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.field.has-error input,
.field.has-error textarea {
  border-color: #dc2626;
}

.field-help {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-error {
  margin-top: 0.35rem;
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
}

.theme-barbershop .field-error {
  color: #f87171;
}

.btn-block {
  width: 100%;
}

.fineprint {
  color: var(--muted);
  font-size: 0.88rem;
}

/* Avisos */

.alerts {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 500;
}

.alert-error {
  background: color-mix(in srgb, #dc2626 12%, var(--bg));
  border-color: color-mix(in srgb, #dc2626 45%, var(--bg));
}

.alert-success {
  background: color-mix(in srgb, #16a34a 12%, var(--bg));
  border-color: color-mix(in srgb, #16a34a 45%, var(--bg));
}

/* Confirmación */

.confirmation {
  max-width: 620px;
}

.success-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 0 8px rgb(22 163 74 / 0.18);
  animation: pop 0.5s var(--ease) both;
}

.success-mark .icon {
  width: 32px;
  height: 32px;
  stroke-width: 3;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

.ticket {
  margin-top: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1.5rem 1.5rem;
}

.reference {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.1rem;
  padding: 1rem 1.25rem;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.reference-label {
  flex-basis: 100%;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.reference-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 1.7rem;
  letter-spacing: 0.18em;
  color: var(--heading);
  margin-right: auto;
}

.confirmation .fineprint {
  margin-top: 1rem;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.5rem 0;
}

@media (max-width: 480px) {
  .option-card {
    padding: 1rem;
  }

  .option-side {
    gap: 0.5rem;
  }

  .actions-row .btn {
    width: 100%;
  }
}
