/* ============================================================
   Structures de parcours — hero, fil de progression, raccourcis,
   étapes repliables, réglages en accordéon.

   Purement structurel : couleurs, rayons et durées viennent des
   tokens existants, l'esthétique iOS est inchangée.
   ============================================================ */

/* ---------- HERO ---------- */

.hero-service {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--surface-2);
  border-radius: 999px;
}

.hero-service__nom {
  font-weight: 600;
}

.hero-service__prix {
  font-weight: 700;
  color: var(--tint);
  font-variant-numeric: tabular-nums;
}

.hero-service__duree {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-cta {
  margin-top: 20px;
  min-width: 220px;
}

/* ---------- FIL DE PROGRESSION ---------- */

.stepper {
  display: flex;
  gap: 6px;
  list-style: none;
  margin-bottom: 22px;
  counter-reset: etape;
}

.stepper__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  counter-increment: etape;
}

/* La barre au-dessus du libellé matérialise l'avancement. */
.stepper__item::before {
  content: "";
  height: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  transition: background 0.25s var(--ease);
}

.stepper__item.is-done::before,
.stepper__item.is-current::before {
  background: var(--accent);
}

.stepper__item.is-current {
  color: var(--tint);
}

.stepper__item span::before {
  content: counter(etape) ". ";
}

/* ---------- ÉTAPES ---------- */

.step + .step {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.step__titre {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.step__sous-titre {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.step__sous-titre::first-letter {
  text-transform: uppercase;
}

.step__ou {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin: 16px 0 12px;
}

.step__rassurance {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 10px;
}

/* Résumé d'une étape franchie : cliquable pour revenir en arrière. */
.step__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: background 0.2s var(--ease);
}

.step__summary:hover {
  background: var(--accent-soft);
}

.step__label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  min-width: 46px;
}

.step__value {
  font-weight: 600;
  flex: 1;
}

.step__value::first-letter {
  text-transform: uppercase;
}

.step__edit {
  color: var(--tint);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- RACCOURCIS DE DISPONIBILITÉ ---------- */

.quick-picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.quick-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 62px;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--tint);
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.2s var(--ease),
    transform 0.15s var(--ease);
}

.quick-pick:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.quick-pick:active {
  transform: scale(0.96);
}

.quick-pick__jour {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
}

.quick-pick__heure {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- ADMIN : phrases de synthèse et réglages repliés ---------- */

.section-resume {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.section-resume::first-letter {
  text-transform: uppercase;
}

.reglage {
  border-top: 1px solid var(--border);
}

.reglage:first-of-type {
  border-top: none;
}

.reglage__titre {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 12px 4px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

/* Chevron natif remplacé par un marqueur cohérent avec le reste. */
.reglage__titre::-webkit-details-marker {
  display: none;
}

.reglage__titre::after {
  content: "›";
  margin-left: auto;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}

.reglage[open] > .reglage__titre::after {
  transform: rotate(90deg);
}

.reglage__aide {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

.reglage__corps {
  padding: 4px 4px 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
  .hero-cta {
    width: 100%;
    min-width: 0;
  }

  .stepper__item {
    font-size: 0.72rem;
  }

  .quick-picks {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }

  .step__summary {
    padding: 12px;
    gap: 8px;
  }
}

/* ---------- Impression ---------- */

@media print {
  .stepper,
  .hero-cta,
  .quick-picks,
  .step__ou {
    display: none !important;
  }
}

/* ---------- TARIFICATION DYNAMIQUE ----------
   Le prix dépend de l'heure : il s'affiche sur le créneau (seulement
   si la journée en compte plusieurs) puis dans le récapitulatif. */

.slot {
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.slot__heure {
  display: block;
}

.slot__prix {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  opacity: 0.7;
}

.slot.is-selected .slot__prix {
  opacity: 0.9;
}

/* Récapitulatif : le montant d'abord, sa justification ensuite. */
.booking-recap {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
}

.recap__service {
  font-size: var(--text-sm);
  font-weight: 500;
}

.recap__prix {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.recap__palier {
  font-size: var(--text-xs);
  font-weight: 500;
  opacity: 0.85;
}

/* ---------- Grille des tarifs (admin et information) ---------- */

.tarifs-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.tarifs-table th,
.tarifs-table td {
  padding: var(--space-3) var(--space-2);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tarifs-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tarifs-table tr:last-child td {
  border-bottom: none;
}

.tarifs-table .prix {
  font-family: var(--font-display);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.tarifs-table .creneau {
  font-weight: 600;
  white-space: nowrap;
}

/* Prix appliqué, dans les rangées de réservation de l'admin. */
.resa-item .prix-applique {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

/* ---------- Options (cire…) ---------- */

/* Encadré sobre : l'option doit se voir sans concurrencer le bouton
   de confirmation, qui reste l'action principale de l'étape. */
.booking-options {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-4) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.booking-options__titre {
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 44 px de hauteur minimum : la case se coche au doigt. */
.option-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) 0;
  cursor: pointer;
}

.option-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

.option-row__nom {
  font-size: var(--text-sm);
  font-weight: 500;
}

.option-row__prix {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tint);
}

/* Le total, répété au pied du formulaire : on coche ici, le
   récapitulatif du haut de l'étape peut être hors de l'écran. */
.booking-options__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted);
}

.booking-options__total strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Décompte « Coupe 10 € + Cire 5 € » sous le montant total. */
.recap__detail {
  font-size: var(--text-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  /* 0.9 et pas 0.85 : à 0.85 le contraste tombait à 4.59 sur fond clair,
     soit 0.09 au-dessus du seuil AA — trop juste pour y rester. */
  opacity: 0.9;
}

/* ---------- Options dans les rangées de l'admin ---------- */

.resa-item .resa-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

/* Sans option, la colonne ne doit pas consommer l'espacement du rang. */
.resa-item .resa-options:empty {
  display: none;
}

.resa-item .prix-applique {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}

.resa-item .prix-detail {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
}

/* Sur petit écran le rang passe à la ligne et le montant n'est plus
   collé au bord droit : l'aligner à droite le ferait flotter au-dessus
   de son propre décompte, plus large que lui. */
@media (max-width: 767px) {
  .resa-item .prix-applique {
    align-items: flex-start;
  }
}
