/* Recherche par véhicule (Marque / Modèle / Version / Motorisation).
   Remplace l'ancien panneau "Filtrer" des pages pièces : même bouton
   pilule, même panneau qui glisse depuis la gauche sur fond assombri.
   En tête du panneau, la voiture vue de face dont les feux s'allument à
   chaque étape. Données : vehicules/*.json (catalogue CORTECO / TecDoc). */

.veh-toggle {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 20px; color: var(--ink); font: inherit; font-weight: 700; font-size: 0.9rem;
  margin: 0 0 20px; cursor: pointer;
}
.veh-toggle svg { width: 17px; height: 17px; flex-shrink: 0; }
.veh-toggle .veh-sel { color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.veh-toggle.has { border-color: rgba(255,122,48,0.6); box-shadow: 0 0 0 3px rgba(255,122,48,0.12); }
.veh-toggle .veh-clr { display: none; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; background: rgba(255,255,255,0.1); font-size: 0.9rem; flex-shrink: 0; }
.veh-toggle.has .veh-clr { display: inline-flex; }

/* Véhicule choisi (choix d'Arina, 13/10) : le véhicule sur une plaque
   d'immatriculation, puis une rangée d'onglets soulignés en orange.
   Sur les cartes : un cachet rond (même taille et même police partout) et la
   phrase complète sous le titre. */
.veh-bar { margin: 0 0 22px; }
.veh-line { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 0 0 18px; }
.veh-plate { display: inline-flex; align-items: stretch; max-width: 100%; border-radius: 9px; overflow: hidden; background: #f4f5f7; box-shadow: 0 0 0 3px #1b1f2e, 0 10px 24px rgba(0,0,0,0.4); }
.veh-plate .eu, .veh-plate .dep { flex-shrink: 0; width: 30px; background: #0b3a9e; color: #fff; font-size: 0.75rem; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; }
.veh-plate .eu i { width: 12px; height: 12px; border-radius: 50%; border: 2px dotted var(--gold); margin-bottom: 5px; }
.veh-plate .txt { min-width: 0; padding: 8px 18px; color: #0b0c17; }
.veh-plate .txt strong { display: block; font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1.45rem; letter-spacing: .04em; line-height: 1.15; text-transform: uppercase; }
.veh-plate .txt span { display: block; font-size: 0.8rem; font-weight: 700; color: #4a5068; }
.veh-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.veh-acts button { background: none; border: 1px solid rgba(255,255,255,0.25); color: #fff; border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: background .2s, color .2s; }
.veh-acts button:hover { background: rgba(255,255,255,0.08); }
.veh-acts .chg { border-color: var(--orange); color: var(--orange); }
.veh-acts .chg:hover { background: var(--orange); color: #fff; }
@media (max-width: 600px) {
  .veh-plate .txt { padding: 7px 12px; }
  .veh-plate .txt strong { font-size: 1.15rem; }
}

.veh-rail { position: relative; border-bottom: 1px solid rgba(255,255,255,0.12); }
.veh-scroller { display: flex; align-items: flex-end; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.veh-scroller::-webkit-scrollbar { display: none; }
.veh-rail.more-r .veh-scroller { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 70px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 70px), transparent); }
.veh-rail.more-l .veh-scroller { -webkit-mask-image: linear-gradient(90deg, transparent, #000 70px); mask-image: linear-gradient(90deg, transparent, #000 70px); }
.veh-rail.more-l.more-r .veh-scroller { -webkit-mask-image: linear-gradient(90deg, transparent, #000 70px, #000 calc(100% - 70px), transparent); mask-image: linear-gradient(90deg, transparent, #000 70px, #000 calc(100% - 70px), transparent); }
.veh-arr { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: none; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); background: #1a2042; color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
.veh-arr.l { left: -6px; } .veh-arr.r { right: -6px; }
.veh-rail.more-l .veh-arr.l, .veh-rail.more-r .veh-arr.r { display: flex; }
.veh-arr:hover { background: var(--orange); border-color: var(--orange); }
.veh-tab { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; background: none; border: none; color: var(--ink-soft); font: inherit; font-size: 0.9rem; font-weight: 700; padding: 13px 15px; cursor: pointer; transition: color .2s; }
.veh-tab svg { width: 17px; height: 17px; flex-shrink: 0; }
.veh-tab sup { vertical-align: baseline; font-size: 0.78rem; color: var(--ink-mute); }
.veh-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); box-shadow: 0 0 14px rgba(255,122,48,0.8); transform: scaleX(0); transition: transform .25s; }
.veh-tab:hover { color: #fff; }
.veh-tab.on { color: #fff; }
.veh-tab.on sup { color: var(--orange); }
.veh-tab.on::after { transform: scaleX(1); }
.veh-note { margin: 14px 2px 0; color: var(--ink-soft); font-size: 0.88rem; }

/* Avec un véhicule, les produits compatibles passent devant : on ne force plus de
   retour à la ligne entre cartes avec / sans menu de contenance (ça laissait des
   trous). Les cartes d'une ligne ont la même hauteur (boutons alignés) ; sur une
   ligne mélangée, le JS réserve la place du menu pour aligner aussi les prix. */
.pieces-main.veh-on .pieces-row-break { display: none; }
.pieces-main.veh-on #pieces-grid { align-items: stretch; }


/* résumé dans le panneau : nombre de produits par type */
.veh-sum { list-style: none; margin: 0; padding: 0; }
.veh-sum li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 0.88rem; }
.veh-sum li svg { width: 17px; height: 17px; color: #fff; flex-shrink: 0; }
.veh-sum li b { margin-left: auto; color: #fff; font-family: 'Teko', sans-serif; font-size: 1.25rem; font-weight: 600; line-height: 1; }

/* panneau */
.veh-ov { position: fixed; inset: 0; background: rgba(5,7,20,0.6); z-index: 549; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.veh-ov.is-open { opacity: 1; pointer-events: auto; }
.veh-drw {
  position: fixed; top: 0; left: 0; bottom: 0; width: 92%; max-width: 380px; z-index: 550;
  background: #11152b; border-right: 1px solid var(--line); padding: 20px; overflow-y: auto; color: var(--ink);
  box-shadow: 20px 0 60px rgba(0,0,0,0.5); transform: translateX(-100%); transition: transform .3s ease;
  scrollbar-width: thin; scrollbar-color: var(--orange) transparent;
}
.veh-drw.is-open { transform: translateX(0); }
.veh-drw::-webkit-scrollbar { width: 6px; }
.veh-drw::-webkit-scrollbar-track { background: transparent; }
.veh-drw::-webkit-scrollbar-thumb { background: var(--orange); border-radius: 999px; }
.veh-head { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.veh-head h3 { font-family: 'Teko', sans-serif; font-size: 1.5rem; color: #fff; margin: 0; letter-spacing: .02em; line-height: 1; }
.veh-reset { margin-left: auto; background: none; border: none; padding: 0; color: var(--blue-glow); font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.veh-x { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(255,255,255,0.08); color: #fff; font-size: 1.15rem; line-height: 1; cursor: pointer; }

/* listes */
.veh-fld { margin-bottom: 14px; }
.veh-fld label { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); }
.veh-fld label .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.08); color: var(--ink-soft); font-size: 0.72rem; }
.veh-fld.done label .n { background: var(--orange); color: #fff; }
.veh-fld select {
  width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: rgba(255,255,255,0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b7bede' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); border-radius: 12px; color: #fff; padding: 12px 38px 12px 14px; font: inherit; font-size: 0.92rem;
}
.veh-fld select:disabled { opacity: .4; cursor: not-allowed; }
.veh-fld select option { background: #11152b; }
.veh-loading { color: var(--ink-mute); font-size: 0.85rem; margin: 0 0 12px; }

/* résultat */
.veh-res { margin-top: 18px; }
.veh-car { border-radius: 14px; padding: 14px 16px; background: rgba(255,122,48,0.08); border: 1px solid rgba(255,122,48,0.35); }
.veh-car small { display: block; color: var(--orange); font-weight: 800; font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; }
.veh-car strong { display: block; color: #fff; font-size: 1.02rem; margin: 3px 0 2px; }
.veh-car span { color: var(--ink-soft); font-size: 0.82rem; }
.veh-res h4 { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); margin: 18px 0 8px; }
.veh-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; color: var(--ink-soft); }
.veh-item b { display: block; color: #fff; font-weight: 700; }
.veh-item i { display: block; margin-top: 2px; color: var(--gold); font-style: normal; font-size: 0.76rem; }
.veh-ok { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; background: #1f9d55; color: #fff; font-size: 0.72rem; }
.veh-none { color: var(--ink-soft); font-size: 0.88rem; margin: 0; }
.veh-none a, .veh-tip a { color: var(--orange); }
.veh-uni { margin: 10px 0 0; font-size: 0.84rem; color: var(--ink-soft); }
.veh-uni b { color: #fff; }
.veh-tip { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.8rem; color: var(--ink-mute); background: rgba(77,168,255,0.07); border: 1px solid rgba(77,168,255,0.2); }
.veh-go { display: block; width: 100%; margin-top: 16px; padding: 13px 18px; border: none; border-radius: 999px; background: var(--orange); color: #fff; font: inherit; font-weight: 800; font-size: 0.92rem; text-align: center; text-decoration: none; cursor: pointer; box-sizing: border-box; }
.veh-go:disabled { background: rgba(255,255,255,0.08); color: var(--ink-mute); cursor: not-allowed; }

/* en-tête : voiture vue de face */
.veh-hdr { position: relative; overflow: hidden; margin: -4px -20px 18px; padding: 8px 14px 14px; text-align: center; border-bottom: 1px solid var(--line); background: radial-gradient(80% 70% at 50% 100%, #1c2550 0%, #0e1226 70%); }
.veh-cv { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; overflow: visible; stroke-linecap: round; stroke-linejoin: round; }
.veh-steps { display: flex; justify-content: center; gap: 6px; margin: 6px 0 8px; }
.veh-steps i { width: 26px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.12); transition: background .4s; }
.veh-steps i.on { background: var(--orange); }
.veh-cap { margin: 0; min-height: 2.6em; color: var(--ink-mute); font-size: 0.86rem; }
.veh-cap b { color: #fff; font-family: 'Teko', sans-serif; font-size: 1.45rem; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.veh-cap span { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 0.8rem; }
.veh-cap span.eng { color: var(--gold); font-weight: 700; }
.veh-cv .body { fill: #161c38; stroke: var(--blue-glow); stroke-width: 1.4; }
.veh-cv .glass { fill: #0b1024; stroke: var(--blue-glow); stroke-width: 1.1; }
.veh-cv .det { fill: #10152c; stroke: var(--blue-glow); stroke-width: 1; }
.veh-drw.is-open .veh-cv .ln { stroke-dasharray: var(--len); animation: vehDraw 1.4s ease-out both; }
.veh-cv .tyre { fill: #05060c; stroke: #2a3359; stroke-width: 1.2; }
.veh-cv .shadow { fill: rgba(0,0,0,0.55); }
.veh-cv .hl { fill: #0b0e1d; stroke: var(--blue-glow); stroke-width: 1.2; transition: fill .4s; }
.veh-cv .drl { stroke: #39406a; stroke-width: 2.2; transition: stroke .35s, filter .35s; }
.veh-cv .grille { fill: #0b0e1d; stroke: var(--blue-glow); stroke-width: 1.1; transition: stroke .4s, filter .4s; }
.veh-cv .gl { stroke: rgba(77,168,255,0.4); stroke-width: .8; transition: stroke .4s; }
.veh-cv .badge { fill: #161c38; stroke: var(--blue-glow); stroke-width: 1; }
.veh-cv .bt { fill: #fff; font: 600 8px 'Teko', sans-serif; text-anchor: middle; letter-spacing: .04em; }
.veh-cv .plate { fill: #eef1fb; }
.veh-cv .edge { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 1.4; }
.veh-cv .mid { stroke: rgba(255,216,61,0.5); stroke-width: 2; stroke-dasharray: 6 8; }
.veh-cv .beam { fill: url(#vehBeam); opacity: 0; transition: opacity .6s; }
.veh-cv .flare { fill: url(#vehFlare); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .4s, transform .5s cubic-bezier(.3,1.4,.5,1); pointer-events: none; }
.veh-hdr:not([data-step='0']) .drlL,
.veh-hdr[data-step='2'] .drlR, .veh-hdr[data-step='3'] .drlR, .veh-hdr[data-step='4'] .drlR { stroke: #fff; filter: drop-shadow(0 0 3px #bfe0ff) drop-shadow(0 0 6px #4da8ff); }
.veh-hdr[data-step='3'] .grille, .veh-hdr[data-step='4'] .grille { stroke: var(--orange); filter: drop-shadow(0 0 4px rgba(255,122,48,0.8)); }
.veh-hdr[data-step='3'] .gl, .veh-hdr[data-step='4'] .gl { stroke: rgba(255,122,48,0.7); }
.veh-hdr[data-step='4'] .hl { fill: #fff6cc; }
.veh-hdr[data-step='4'] .flare { opacity: 1; transform: scale(1); }
.veh-hdr[data-step='4'] .beam { opacity: 1; }
.veh-hdr[data-step='4'] .mid { animation: vehRoad .5s linear infinite; }
.veh-hdr.kick .veh-cv { animation: vehBump .35s ease-out; }
@keyframes vehDraw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes vehRoad { to { stroke-dashoffset: -14; } }
@keyframes vehBump { 0% { transform: translateY(0); } 40% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .veh-hdr *, .veh-drw.is-open .veh-cv .ln { animation: none !important; transition: none !important; }
}

/* Onglet Déstockage (choix d'Arina, 13/10) : étiquette de prix jaune, juste après "Tout" */
.veh-tab.ds { margin: 7px 6px 7px 12px; padding: 7px 14px 7px 21px; color: #1a1300; background: var(--gold); clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 8px 8px 0; font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; transition: filter .2s; }
.veh-tab.ds::before { content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--navy-950); }
.veh-tab.ds::after { display: none; }
.veh-tab.ds em { font-style: normal; color: #fff; background: #e0262c; padding: 2px 7px; border-radius: 5px; font-size: 0.8rem; text-transform: none; }
.veh-tab.ds:hover, .veh-tab.ds.on { color: #1a1300; filter: brightness(1.08); }
.veh-tab.ds.on { box-shadow: inset 0 -3px 0 var(--orange); }

/* Essuie-glaces (choix d'Arina, 13/10) : avant / arrière sur la photo de tous les balais */
.wp-pos { position: absolute; left: 10px; bottom: 30px; z-index: 3; pointer-events: none; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; color: #fff; font-size: 12.5px; font-weight: 800; line-height: 1.2; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.wp-pos svg { width: 30px; height: 18px; flex-shrink: 0; }
.wp-pos.av { background: rgba(27,88,196,0.95); }
.wp-pos.ar { background: rgba(230,97,28,0.95); }

/* Compatibilité (choix d'Arina, 13/10, variante 2) : la carte est entourée de
   la couleur et le mot est écrit dans le bord haut, sans fond ni pastille.
   Le bord est dessiné par ::before, avec une coupure (--gap, mesurée en JS)
   là où passe le mot. Rien sur la photo, hauteur de carte inchangée. */
.pieces-card.veh-fit { position: relative; border-color: transparent; }
.pieces-card.veh-fit::before { content: ""; position: absolute; inset: -1px; z-index: 1; pointer-events: none; border: 2px solid var(--fit); border-radius: inherit; box-shadow: inset 0 0 22px -12px var(--fit2);
  clip-path: polygon(0 0, 16px 0, 16px 4px, calc(16px + var(--gap, 0px)) 4px, calc(16px + var(--gap, 0px)) 0, 100% 0, 100% 100%, 0 100%); }
.pieces-card.veh-fit.ok { --fit: #1f9d55; --fit2: #3ddc84; }
.pieces-card.veh-fit.oil { --fit: #1b58c4; --fit2: #6cb4ff; }
.pieces-card.veh-fit.cond { --fit: var(--orange-dark); --fit2: #ff9a52; }
.veh-lab { position: absolute; top: -10px; left: 15px; z-index: 2; padding: 0 7px; line-height: 18px; font-size: 13px; font-weight: 800; white-space: nowrap; color: var(--fit2); text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.wp-pos { max-width: calc(100% - 46px); box-sizing: border-box; }
.wp-pos span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .wp-pos { font-size: 11px; gap: 5px; padding: 5px 9px 5px 7px; } .wp-pos svg { width: 24px; height: 15px; } }
