/* ==========================================================================
   Écran « Options + choix réserver / devis » — composants propres à l'écran.
   Mêmes tokens que ../assets/tunnel.css.

   Composants préfixés va- : candidats à remonter dans tunnel.css (réutilisables)
     va-count-pill    pastille « 2 options ajoutées »
     va-opt           carte d'option (icône, nom, description, prix, action)
     va-opt--featured carte mise en avant (assurance annulation)
     va-optgroup      groupe d'options repliable (+ va-optrow, ligne d'option)
     va-clamp         description coupée à 2 lignes + bouton « Voir plus »
     va-stepper       sélecteur de quantité (− n +), cibles 44 px
     va-addbtn        bouton « Ajouter » / « Ajoutée » (aria-pressed)
     va-decide        bloc de fin d'étape : deux boutons + une ligne chacun
     va-bottombar-actions  colonne droite de la barre du bas (bouton + lien)
   Préfixe oc- : mise en page propre à cet écran.
   ========================================================================== */

/* Pastille de compte ------------------------------------------------------ */
.va-count-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--va-teal-light); color: var(--va-teal-strong);
  font-size: var(--fs-sm); font-weight: 700;
}
.va-count-pill svg { width: 14px; height: 14px; }

/* Icône d'option (pictogramme dans un carré crème) ------------------------- */
.va-opt-icon {
  flex: none; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--va-cream); color: var(--va-ink);
}
.va-opt-icon svg { width: 24px; height: 24px; }
.is-added .va-opt-icon { background: var(--va-teal-light); color: var(--va-teal-strong); }

/* Carte d'option ------------------------------------------------------------ */
.va-opt {
  display: flex; flex-direction: column; gap: var(--sp-4);
  background: var(--va-surface);
  border: 1.5px solid var(--va-border-strong);
  border-radius: var(--va-radius-card);
  padding: var(--sp-5);
  transition: border-color .25s var(--va-ease), box-shadow .25s var(--va-ease);
}
.va-opt.is-added { border-color: var(--va-teal); box-shadow: 0 0 0 3px var(--va-teal-light); }
.va-opt-top { display: flex; gap: var(--sp-4); align-items: flex-start; }
.va-opt-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-2); font-size: var(--fs-md); font-weight: 700; line-height: 1.25; }
.va-opt-desc { margin-top: 4px; font-size: var(--fs-sm); color: var(--va-muted); line-height: 1.45; }
.va-opt-foot {
  margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--va-border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.va-price { font-size: var(--fs-md); font-weight: 900; line-height: 1.15; white-space: nowrap; }
.va-price small { font-size: var(--fs-sm); font-weight: 600; color: var(--va-muted); }
.va-price-sub { display: block; font-size: var(--fs-xs); color: var(--va-muted); font-weight: 400; margin-top: 2px; }

/* Carte mise en avant (assurance annulation, UXB-16) */
.va-opt--featured {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--sp-4) var(--sp-5); align-items: center;
  background: linear-gradient(0deg, rgba(231, 252, 251, .55), rgba(231, 252, 251, .55)), var(--va-surface);
  border-color: rgba(17, 151, 143, .45);
}
.va-opt--featured .va-opt-icon { width: 56px; height: 56px; background: var(--va-surface); color: var(--va-teal-strong); }
.va-opt--featured .va-opt-icon svg { width: 28px; height: 28px; }
.va-opt-benefit { margin-top: 4px; font-size: var(--fs-base); font-weight: 600; color: var(--va-ink); line-height: 1.4; }
.va-opt-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); text-align: right; }

/* Bouton Ajouter / Ajoutée -------------------------------------------------- */
.va-addbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 112px; padding: 0 var(--sp-5);
  border-radius: 999px; border: 1.5px solid var(--va-border-strong);
  background: var(--va-surface); color: var(--va-ink);
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  transition: border-color .25s var(--va-ease), background-color .25s var(--va-ease);
}
.va-addbtn:hover { border-color: var(--va-teal); color: var(--va-teal-strong); }
.va-addbtn svg { width: 16px; height: 16px; }
.va-addbtn .va-addbtn-on { display: none; }
.va-addbtn[aria-pressed="true"] { background: var(--va-teal-light); border-color: var(--va-teal); color: var(--va-teal-strong); }
.va-addbtn[aria-pressed="true"] .va-addbtn-on { display: inline-flex; align-items: center; gap: 6px; }
.va-addbtn[aria-pressed="true"] .va-addbtn-off { display: none; }
.va-addbtn:focus-visible { border-radius: 999px; }

/* Sélecteur de quantité ----------------------------------------------------- */
.va-stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--va-teal); border-radius: 999px; background: var(--va-teal-light);
}
.va-stepper button {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--va-teal-strong); border-radius: 50%;
}
.va-stepper button:hover { background: rgba(14, 122, 116, .10); }
.va-stepper button svg { width: 18px; height: 18px; }
.va-stepper output { min-width: 28px; text-align: center; font-weight: 900; font-size: var(--fs-base); }

/* Groupes repliables (UXB-15) ---------------------------------------------- */
.va-optgroup + .va-optgroup { border-top: 1px solid var(--va-border); }
.va-optgroup-trigger { padding: var(--sp-4) var(--sp-6); min-height: 76px; gap: var(--sp-4); }
.va-optgroup-trigger:hover { background: #FBFAF7; }
.va-optgroup-trigger:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 3px var(--va-teal-strong); }
.va-optgroup-trigger .va-opt-icon { width: 44px; height: 44px; border-radius: 12px; }
.va-optgroup-trigger .va-opt-icon svg { width: 22px; height: 22px; transform: none !important; }
.va-optgroup-text { flex: 1; min-width: 0; }
.va-optgroup-title { display: block; font-size: var(--fs-md); font-weight: 700; line-height: 1.25; }
.va-optgroup-meta { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--va-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.va-optgroup-right { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.va-optgroup-panel { padding: 0 var(--sp-6) var(--sp-3); }

.va-optrow {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 128px auto; gap: var(--sp-4); align-items: center;
  padding: var(--sp-4) 0;
}
.va-optrow + .va-optrow { border-top: 1px dashed var(--va-border-strong); }
.va-optrow .va-opt-icon { width: 40px; height: 40px; border-radius: 10px; }
.va-optrow .va-opt-icon svg { width: 20px; height: 20px; }
.va-optrow-name { font-size: var(--fs-base); font-weight: 700; line-height: 1.3; }
.va-optrow .va-price { font-size: var(--fs-base); text-align: right; }
.va-optrow .va-addbtn { min-width: 112px; }

/* Description coupée à 2 lignes + « Voir plus » */
.va-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.is-expanded > .va-clamp, .is-expanded .va-clamp { -webkit-line-clamp: unset; display: block; }
.va-more { margin-top: 2px; font-size: var(--fs-xs); min-height: 24px; }

/* Bloc de fin d'étape : réserver ou demander un devis (UXB-03) -------------- */
.va-decide { padding: var(--sp-6); }
.va-decide-title { font-size: var(--fs-md); font-weight: 700; line-height: 1.25; }
.va-decide-lead { margin-top: 4px; font-size: var(--fs-sm); color: var(--va-muted); }
.va-decide-option { margin-top: var(--sp-4); }
.va-decide-option .va-btn { width: 100%; }
.va-decide-why {
  margin-top: var(--sp-2); display: flex; gap: 8px; align-items: flex-start;
  font-size: var(--fs-sm); line-height: 1.45; color: var(--va-ink);
}
.va-decide-why svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--va-teal-strong); }
.va-decide-why strong { font-weight: 700; }
.va-decide-or {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-top: var(--sp-4); font-size: var(--fs-xs); font-weight: 600; color: var(--va-muted);
}
.va-decide-or::before, .va-decide-or::after { content: ""; flex: 1; height: 1px; background: var(--va-border-strong); }

/* Panneau : note sous une ligne de frais */
.va-row-note { margin-top: 2px; font-size: var(--fs-xs); line-height: 1.5; color: var(--va-muted); }

/* Mise en page de l'écran --------------------------------------------------- */
.oc-head-meta { margin-bottom: var(--sp-2); }
.oc-popular { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.oc-popular .va-opt--featured { grid-column: 1 / -1; }
.oc-note { margin-top: calc(var(--sp-2) * -1); }
.oc-aside-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
/* Colonne plus haute que l'écran : elle défile avec la page puis reste calée
   en bas, pour que le choix réserver / devis reste visible (au lieu de rester
   calée en haut, ce qui masquerait les boutons jusqu'à la fin de la liste). */
#oc-aside { top: auto; bottom: var(--sp-6); }

/* Variantes d'agence : paiement en ligne (défaut) / sur demande uniquement */
.oc-mode-pay .oc-req-only, .oc-mode-request .oc-pay-only { display: none !important; }

/* ==========================================================================
   Téléphone (< 860px)
   ========================================================================== */
@media (max-width: 859.98px) {
  .oc-popular { grid-template-columns: 1fr; gap: var(--sp-3); }
  .va-opt { padding: var(--sp-4); gap: var(--sp-3); }
  .va-opt-icon { width: 44px; height: 44px; }
  .va-opt-name { font-size: var(--fs-base); }
  .va-opt-foot { padding-top: var(--sp-3); }
  .va-opt--featured { grid-template-columns: 48px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
  .va-opt--featured .va-opt-icon { width: 48px; height: 48px; }
  .va-opt--featured .va-opt-side {
    grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; text-align: left;
    padding-top: var(--sp-3); border-top: 1px solid rgba(17, 151, 143, .25);
  }
  .va-opt-benefit { font-size: var(--fs-sm); }

  .va-optgroup-trigger { padding: var(--sp-3) var(--sp-4); min-height: 68px; gap: var(--sp-3); }
  .va-optgroup-trigger .va-opt-icon { width: 40px; height: 40px; }
  .va-optgroup-title { font-size: var(--fs-base); }
  .va-optgroup-panel { padding: 0 var(--sp-4) var(--sp-2); }
  .va-optrow { grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-3); }
  .va-optrow .va-opt-icon { display: none; }
  .va-optrow-text { grid-column: 1 / -1; }
  .va-optrow .va-price { text-align: left; }

  .va-decide { padding: var(--sp-5); }

  /* Barre du bas : montant à gauche ; à droite le bouton et, dessous, le lien devis */
  .va-bottombar-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0; flex: none; }
  .va-bottombar-actions .va-btn { min-height: 48px; }
  .va-bottombar-link {
    display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
    font-size: var(--fs-sm); font-weight: 600; color: var(--va-teal-strong);
    text-decoration: underline; text-underline-offset: 3px;
  }
  .oc-page { padding-bottom: calc(var(--va-bottombar-h) + 40px + var(--sp-8)); }
}
