/* ════════════════════════════════════════════════════════════════
   MÉCAREMAP — ESTIMATION EN LIGNE (estimation.html, logique : js/estimation.js)
   S'appuie sur css/rdv.css (carte, champs, étapes, ticket, confirmation) et css/reprog.css
   (configurateur) ; ici : le configurateur dans la carte, les cartes de préparation, les options,
   les créneaux, le ticket « Votre estimation », le récapitulatif et la barre du bas sur mobile.
   Thème clair : variables de css/rdv.css + quelques réglages en bas du fichier.
   60 i/s : seules transform / opacity sont animées.
   ════════════════════════════════════════════════════════════════ */

/* ════════════ ÉTAPES : 6 voyants ════════════ */
.es-page .rv-steps { grid-template-columns: repeat(6, 1fr); width: 560px; }
.es-page .rv-steps-bar { left: calc(100% / 12); right: calc(100% / 12); }
.es-steps li.is-skip { opacity: .35; }
.es-page .rv-bh:focus, .es-page #es-done-h:focus { outline: none; }
.es-page .rv-bh .es-opt-tag { font: 500 12px/1 var(--rv-body); font-style: normal; letter-spacing: 0; text-transform: none; color: var(--rv-mute); }

/* ════════════ LIENS, NOTES ════════════ */
.es-link { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.es-link:hover { color: var(--rv-head); }
.es-link-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; padding: 8px 13px 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--rv-line-2); background: none; cursor: pointer; font: 600 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-dim); transition: color .25s, border-color .25s; }
.es-link-back:hover { color: var(--rv-head); border-color: var(--line-strong); }
.es-link-back svg.i { width: 14px; height: 14px; }
.es-note { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; padding: 12px 14px; border-radius: var(--r-md); font-size: 13px; line-height: 1.55; color: var(--rv-dim); background: var(--tint); border: 1px solid var(--rv-line); }
.es-note svg.i { width: 16px; height: 16px; margin-top: 2px; color: var(--text); }
.es-note.is-warn svg.i, .es-note--circuit svg.i { color: var(--rv-gold); }
.es-note a { color: var(--text); font-weight: 700; text-underline-offset: 3px; }
.es-hint { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-size: 13px; color: var(--rv-mute); }
.es-hint svg.i { width: 16px; height: 16px; }
.es-fees { margin: -4px 0 14px; font-size: 12px; line-height: 1.5; color: var(--rv-mute); }
.es-for b { color: var(--rv-head); }
.es-for .es-link { margin-left: 4px; font-size: 13px; }

/* ════════════ 01 · CONFIGURATEUR DANS LA CARTE ════════════ */
.rp--est { z-index: auto; padding-bottom: 0; margin-bottom: 8px; }
.rp--est .rp-search { max-width: none; height: 56px; margin: 0 0 14px; animation: none; }
.rp--est .rp-search input, .rp--est .rp-typer { font-size: 16px; }
.rp--est .rp-console { width: auto; margin: 0; animation: none; box-shadow: none; border: 1px solid var(--rv-line); background: var(--rv-field); scroll-margin-top: 96px; }
.rp--est .rp-stage { min-height: 250px; padding: 18px; }
/* rail compact (la console est étroite dans la carte) : libellé pour l'étape en cours, pastilles pour les autres */
.rp--est .rp-rail { padding: 10px 12px; gap: 8px; }
.rp--est .rp-node:not(.is-cur) { flex: 0 0 auto; }
.rp--est .rp-node:not(.is-cur) .rp-nl { display: none; }
.rp--est .rp-node > button { padding: 4px; gap: 8px; }
.rp--est .rp-nd { width: 30px; height: 30px; }
.rp--est .rp-reset span { display: none; }
.rp--est .rp-reset { padding: 9px; }
.rp--est .rp-type { height: 150px; }
.rp--est .rp-type-img { bottom: 54px; max-height: 56%; }
.rp--est .rp-type-floor { bottom: 50px; }
.rp--est .rp-type-txt { left: 14px; right: 50px; bottom: 13px; }
.rp--est .rp-type .rp-go { right: 12px; bottom: 12px; width: 30px; height: 30px; }
/* tuile « Autre véhicule » : bandeau sur toute la largeur, sous les quatre types */
.rp--est .rp-type--autre { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; height: auto; min-height: 68px; padding: 12px 16px; transform: none; }
.rp--est .rp-type--autre .rp-type-txt { position: static; flex: 1; min-width: 0; }
.rp--est .rp-type--autre .rp-type-txt small { white-space: normal; }
.rp--est .rp-type--autre .rp-go { position: static; flex: none; }
.rp-type-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-md); color: var(--text); background: var(--tint); border: 1px solid var(--line-strong); }
.rp-type-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* véhicule choisi : en-tête compact (la page passe à l'étape suivante) */
.rp--est .rp-rh--est { margin: 0; padding: 0; border-bottom: 0; }
.rp--est .rp-rh--est .rp-rh-name { font-size: clamp(20px, 2.4vw, 26px); }
/* véhicule hors base */
.es-autre { animation: rvIn .5s var(--rv-ease) backwards; }

/* ════════════ 02 · PRÉPARATIONS ════════════ */
.es-stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.es-stage { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 0; padding: 14px 16px; border-radius: var(--r-lg); cursor: pointer; text-align: left; font: inherit; color: var(--rv-ink); background: var(--rv-field); border: 1px solid var(--rv-line-2); transition: border-color .25s, background-color .25s, box-shadow .25s, transform .35s var(--rv-spring); }
.es-stage:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.es-stage:focus-visible, .es-opt:focus-visible, .es-hour:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.es-st-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.es-st-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); color: var(--text); background: var(--tint); border: 1px solid var(--line-strong); transition: color .25s, background-color .25s, border-color .25s; }
.es-st-h b { flex: 1; min-width: 0; font: 800 15px/1.2 var(--rv-body); color: var(--rv-head); }
.es-st-p { flex: none; font: 800 17px/1 var(--rv-tech); color: var(--rv-head); white-space: nowrap; }
.es-st-p.is-devis { font: 600 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-gold); }
.es-st-g { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.es-gain { display: inline-flex; align-items: baseline; gap: 8px; }
.es-gain b { font: 800 20px/1 var(--rv-tech); color: var(--rv-ok); }
.es-gain i { font: 700 13px/1 var(--rv-body); font-style: normal; color: var(--rv-dim); }
.es-gain.is-eco b { font-size: 15px; }
.es-gto { font-size: 12px; color: var(--rv-mute); }
.es-stage > small { font-size: 12.5px; line-height: 1.45; color: var(--rv-mute); }
.es-st-eco { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rv-ok); }
.es-st-eco svg.i { width: 14px; height: 14px; }
.es-stage[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), transparent 75%) var(--rv-field); box-shadow: inset 0 0 0 1px var(--accent); }
.es-stage[aria-pressed="true"] .es-st-ic { color: #fff; background: var(--accent); border-color: var(--accent); }
.es-stage.is-none { justify-content: center; border-style: dashed; }
.es-stage.is-none .es-st-h b { overflow-wrap: normal; hyphens: manual; }

/* autres prestations : cartes de css/rdv.css + prix */
.es-svc { grid-template-rows: auto auto auto; }
.es-svc .rv-ic { grid-row: span 3; }
.es-svc .es-svc-p { grid-column: 2; margin-top: 2px; font: 800 13px/1.2 var(--rv-body); font-style: normal; color: var(--rv-head); }
.es-svc .es-svc-p.is-devis { font: 600 10.5px/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-gold); }
.es-pack { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-md); font-size: 13px; line-height: 1.5; color: var(--rv-dim); background: rgba(78,224,143,.07); border: 1px solid rgba(78,224,143,.3); animation: rvIn .4s var(--rv-ease) backwards; }
.es-pack svg.i { width: 16px; height: 16px; margin-top: 2px; color: var(--rv-ok); }
.es-pack b { color: var(--rv-head); }
.es-pack s { color: var(--rv-mute); }

/* ════════════ 03 · OPTIONS ════════════ */
.es-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.es-opt { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md); cursor: pointer; text-align: left; font: inherit; color: var(--rv-ink); background: var(--rv-field); border: 1px solid var(--rv-line-2); transition: border-color .25s, background-color .25s, transform .35s var(--rv-spring); }
.es-opt:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.es-opt-ck { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--rv-line-2); transition: background-color .25s, border-color .25s, transform .35s var(--rv-spring); }
.es-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.es-opt[aria-pressed="true"] .es-opt-ck { transform: scale(1.06); border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.es-opt-t { min-width: 0; }
.es-opt-t b { display: block; font: 800 13.5px/1.2 var(--rv-body); color: var(--rv-head); }
.es-opt-t small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--rv-mute); }
.es-circ { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; padding: 3px 7px; border-radius: var(--r-xs, 4px); font: 600 9.5px/1 var(--font-ui); font-style: normal; letter-spacing: .06em; text-transform: uppercase; color: var(--rv-gold); border: 1px solid rgba(232,201,106,.35); }
.es-circ svg.i { width: 11px; height: 11px; }
.es-opt-p { text-align: right; white-space: nowrap; }
.es-opt-p s { display: block; margin-bottom: 3px; font-size: 11.5px; color: var(--rv-mute); }
.es-opt-p b { font: 800 14px/1.1 var(--rv-body); color: var(--rv-head); }
.es-opt-p b.is-devis { font: 600 10.5px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-gold); }

/* ════════════ 05 · CRÉNEAUX ════════════ */
.es-days { margin-bottom: 12px; }
.es-day.is-skel { height: 74px; cursor: default; border-color: var(--rv-line); background: linear-gradient(90deg, var(--rv-field) 30%, var(--tint) 50%, var(--rv-field) 70%); background-size: 300% 100%; animation: esSkel 1.3s linear infinite; }
@keyframes esSkel { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.es-hours { min-height: 60px; }
.es-hours-day { margin: 2px 0 12px; font: 700 14.5px/1.3 var(--rv-body); color: var(--rv-head); }
.es-hgroup { margin-bottom: 14px; animation: rvIn .45s var(--rv-ease) backwards; }
.es-hgroup + .es-hgroup { animation-delay: .06s; }
.es-hgroup > span { display: block; margin-bottom: 8px; font: 600 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.es-hour { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 6px; border-radius: var(--r-md); cursor: pointer; font: inherit; color: var(--rv-dim); background: var(--rv-field); border: 1px solid var(--rv-line-2); transition: border-color .25s, background-color .25s, transform .35s var(--rv-spring); }
.es-hour b { font: 800 16px/1 var(--rv-tech); color: var(--rv-head); }
.es-hour small { font-size: 11px; color: var(--rv-mute); }
.es-hour:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.es-hour[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.es-hour[aria-pressed="true"] small { color: var(--accent-text); }

/* ════════════ 06 · RÉCAPITULATIF ════════════ */
.es-hp { position: absolute !important; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.es-recap { margin: 6px 0 16px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--rv-field); border: 1px solid var(--rv-line-2); }
.es-rc-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.es-rc-h > b { font: 600 13px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--rv-head); }
.es-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: var(--r-sm); font: 600 10.5px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-gold); background: rgba(232,201,106,.06); border: 1px solid rgba(232,201,106,.35); }
.es-badge svg.i { width: 13px; height: 13px; }
.es-rc-rows { display: grid; margin: 0 0 6px; }
.es-rc-rows > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px dashed var(--rv-line-2); }
.es-rc-rows dt { font: 600 10.5px/1.6 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-rc-rows dd { display: flex; justify-content: space-between; gap: 10px; margin: 0; font-size: 13px; line-height: 1.45; color: var(--rv-head); }
.es-rc-rows dd > span { min-width: 0; overflow-wrap: anywhere; }
.es-rc-rows .es-link { flex: none; font-size: 12px; color: var(--rv-dim); }
.es-rc-lines { margin: 4px 0 0; padding: 10px 0 0; list-style: none; border-top: 1px solid var(--rv-line-2); }
.es-rc-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; line-height: 1.4; color: var(--rv-dim); }
.es-rc-lines b, .es-tk-lines li b { flex: none; font: 800 13.5px/1.4 var(--rv-body); color: var(--rv-head); white-space: nowrap; }
.es-rc-lines b.is-devis, .es-tk-lines b.is-devis { font-weight: 700; color: var(--rv-gold); }
.es-rc-lines b.is-free, .es-tk-lines b.is-free { color: var(--rv-ok); }
.es-rc-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rv-line-2); }
.es-rc-total > span { font: 600 11px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-rc-total > b { font: 900 26px/1 var(--rv-tech); color: var(--rv-head); font-variant-numeric: tabular-nums; }
.es-rc-sub { margin: 6px 0 0; text-align: right; font-size: 12.5px; color: var(--rv-dim); }
.es-rc-sub b { color: var(--rv-head); }
.es-rc-legal { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--rv-mute); }

/* ════════════ CONFIRMATION ════════════ */
.es-done .es-done-total { margin: 10px auto 0; font-size: 16px; color: var(--rv-head); }
.es-done .es-done-total b { font: 900 22px/1 var(--rv-tech); }
.es-next4 { grid-template-columns: repeat(4, 1fr); }

/* ════════════ TICKET « VOTRE ESTIMATION » ════════════ */
.es-side { gap: 12px; }
.es-ticket { padding: 20px; }
.es-ticket .rv-tk-h span { padding: 4px 8px; border-radius: var(--r-sm); color: var(--rv-gold); border: 1px solid rgba(232,201,106,.35); }
.es-tk-veh { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; padding: 12px; border-radius: var(--r-md); background: var(--rv-field); border: 1px solid var(--rv-line); }
.es-tk-logo { flex: none; display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: var(--r-md); color: var(--rv-mute); background: var(--tint); border: 1px solid var(--rv-line); transition: color .3s; }
.es-tk-logo img { width: 72%; height: 72%; object-fit: contain; }
.es-tk-logo svg.i { width: 22px; height: 22px; }
.es-tk-veh > div { min-width: 0; }
.es-tk-veh small { display: block; font: 600 10.5px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-tk-veh b { display: block; margin-top: 5px; font: 800 14.5px/1.25 var(--rv-body); color: var(--rv-mute); overflow-wrap: anywhere; }
.es-tk-veh em { display: block; margin-top: 3px; font-size: 12px; font-style: normal; color: var(--rv-dim); }
.es-tk-veh.is-set b { color: var(--rv-head); }
.es-tk-veh.is-set .es-tk-logo { color: var(--rv-ok); }
.es-tk-lines { margin: 4px 0 0; padding: 0; list-style: none; }
.es-tk-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; line-height: 1.4; color: var(--rv-dim); border-top: 1px dashed var(--rv-line-2); }
.es-tk-lines li:first-child { border-top: 0; }
.es-tk-lines li.is-new { animation: esIn .5s var(--rv-ease) backwards; }
.es-tk-lines li.is-upd b { animation: rvFlash .6s var(--rv-ease); }
.es-tk-lines li.es-tk-empty { justify-content: center; padding: 14px; text-align: center; font-size: 12.5px; color: var(--rv-mute); border: 1px dashed var(--rv-line-2); border-radius: var(--r-md); }
@keyframes esIn { from { opacity: 0; transform: translate3d(12px, 0, 0); } }
.es-tk-total { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 12px; margin: 10px 0 2px; padding: 14px 0 2px; border-top: 1px solid var(--rv-line-2); }
.es-tk-total > span { font: 600 11px/1.2 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-tk-total > b { display: inline-block; font: 900 30px/1 var(--rv-tech); color: var(--rv-head); text-align: right; font-variant-numeric: tabular-nums; transform-origin: 100% 50%; }
.es-tk-total > small { grid-column: 1 / -1; text-align: right; font-size: 12px; line-height: 1.5; color: var(--rv-dim); }
.es-tk-total > small b { color: var(--rv-head); }
.es-tk-total.is-pulse > b { animation: esPulse .6s var(--rv-ease); }
@keyframes esPulse { 35% { transform: scale(1.06); } }
.es-tk-meta { margin-top: 10px; }

/* ════════════ BARRE DU BAS (total + Continuer) ════════════ */
.es-nav-total { display: none; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; margin-left: auto; }
.es-nav-total small { font: 600 10px/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--rv-mute); }
.es-nav-total b { font: 900 18px/1 var(--rv-tech); color: var(--rv-head); white-space: nowrap; font-variant-numeric: tabular-nums; }
.es-s { display: none; }

/* ════════════ RESPONSIVE ════════════ */
@media (max-width: 1080px) {
  .es-nav-total { display: flex; }
  .es-nav-total + .rv-next { margin-left: 0; }
}
@media (max-width: 900px) {
  .es-next4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .es-page .rv-nav { gap: 10px; }
  .es-page .rv-back { padding: 0 14px; }
  .es-l { display: none; }
  .es-s { display: inline; }
  .rp--est .rp-search { height: 54px; }
  .rp--est .rp-stage { padding: 14px; min-height: 220px; }
  .es-stages, .es-opts { grid-template-columns: 1fr; }
  .es-stage.is-none > small { display: none; }
  .es-next4 { grid-template-columns: 1fr; }
  .es-rc-rows > div { grid-template-columns: 1fr; gap: 4px; }
  .es-recap { padding: 14px; }
}
@media (max-width: 560px) {
  .es-steps li:not(.is-on) > span { opacity: 0; }
  .es-hgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .es-hour b { font-size: 15px; }
}
@media (max-width: 380px) {
  .es-hgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .es-autre, .es-pack, .es-hgroup, .es-tk-lines li.is-new, .es-tk-lines li.is-upd b, .es-tk-total.is-pulse > b, .es-day.is-skel { animation: none !important; }
}

/* ════════════ THÈME CLAIR ════════════ */
html[data-theme="light"] .es-stage, html[data-theme="light"] .es-opt, html[data-theme="light"] .es-hour,
html[data-theme="light"] .es-recap, html[data-theme="light"] .es-tk-veh { background: #fff; box-shadow: 0 10px 24px -20px rgba(20,24,40,.45); }
html[data-theme="light"] .es-stage[aria-pressed="true"] { background: linear-gradient(180deg, var(--accent-soft), transparent 75%) #fff; }
html[data-theme="light"] .es-opt[aria-pressed="true"], html[data-theme="light"] .es-hour[aria-pressed="true"] { background: var(--accent-soft); }
html[data-theme="light"] .rp--est .rp-console { background: #fff; }
html[data-theme="light"] .es-tk-logo:has(img) { background: #17181e; border-color: #17181e; }
html[data-theme="light"] .es-pack { background: rgba(18,161,80,.06); border-color: rgba(18,161,80,.3); }
html[data-theme="light"] .es-badge, html[data-theme="light"] .es-circ, html[data-theme="light"] .es-ticket .rv-tk-h span { border-color: rgba(154,122,34,.35); background: rgba(154,122,34,.05); }
