/* bydvin.css - BYD Recherche par VIN v4.2 */

#byd-vin-form-wrap { margin-bottom: 16px; }

#byd-vin-form { display: flex; gap: 8px; flex-wrap: wrap; }

#byd-vin-input {
    flex: 1; min-width: 220px;
    padding: 10px 14px; font-size: 15px;
    border: 2px solid #ccc; border-radius: 6px;
    text-transform: uppercase; letter-spacing: 1px;
}
#byd-vin-input:focus { outline: none; border-color: #0070c0; }

#byd-vin-submit {
    padding: 10px 22px; background: #0070c0; color: #fff;
    border: none; border-radius: 6px; font-size: 14px; cursor: pointer;
}
#byd-vin-submit:hover { background: #005a9e; }

/* Carte véhicule */
.byd-vehicle-card {
    background: #e8f4fd; border: 1px solid #b3d4f0;
    border-radius: 6px; padding: 10px 16px; margin-bottom: 14px;
}
.byd-vehicle-title { font-size: 16px; font-weight: 700; color: #0070c0; }
.byd-vehicle-vin   { font-size: 13px; color: #555; margin-top: 2px; }

/* ── Groupes principaux ── */
.byd-groups-title { font-weight: 600; margin-bottom: 10px; color: #333; font-size: 14px; }

.byd-groups {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 20px;
}

.byd-group-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: #f0f4f8; border: 2px solid #d0dce8;
    border-radius: 6px; cursor: pointer;
    font-size: 13px; font-weight: 600; color: #2c3e50;
    transition: all .15s;
}
.byd-group-btn:hover  { background: #ddeeff; border-color: #0070c0; color: #0070c0; }
.byd-group-btn.active { background: #0070c0; border-color: #0070c0; color: #fff; }

.byd-group-count {
    display: inline-block;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px; font-weight: 700;
}
.byd-group-btn.active .byd-group-count { background: rgba(255,255,255,0.3); }

/* ── Grille de sous-catégories ── */
.byd-subcats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.byd-subcat-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    background: #fff;
    transition: all .15s;
    overflow: hidden;
}
.byd-subcat-card:hover  { border-color: #0070c0; box-shadow: 0 3px 10px rgba(0,112,192,.15); transform: translateY(-2px); }
.byd-subcat-card.active { border-color: #0070c0; background: #e8f4fd; box-shadow: 0 3px 10px rgba(0,112,192,.25); }

.byd-subcat-thumb {
    width: 100%; height: auto; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    background: #f8f8f8; border-radius: 6px; margin-bottom: 10px;
    overflow: hidden;
}
.byd-subcat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.byd-subcat-thumb.no-img { background: #f0f0f0; }
.byd-subcat-thumb.no-img::after {
    content: '📋'; font-size: 32px; opacity: 0.4;
}

.byd-subcat-name {
    font-size: 13px; font-weight: 600;
    color: #2c3e50; line-height: 1.3;
    margin-bottom: 4px;
}
.byd-subcat-code-small {
    font-size: 10px; color: #999; font-family: monospace;
}

/* ── Titre système sélectionné ── */
.byd-system-title {
    font-size: 16px; font-weight: 700;
    color: #2c3e50; margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #0070c0;
}
.byd-subcat-code {
    font-size: 12px; font-weight: 400;
    color: #888; font-family: monospace;
}

/* ── Layout GIF + tableau ── */
.byd-layout {
    display: flex; gap: 24px;
    align-items: flex-start; margin-top: 8px;
}
.byd-col-gif {
    flex: 0 0 38%;
    max-width: 38%;
}
.byd-schema-gif {
    width: 100%; height: auto;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fafafa; display: block;
}
.byd-col-table { flex: 1 1 0; overflow-x: auto; min-width: 0; }

/* ── Tableau des pièces ── */
.byd-parts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.byd-parts-table thead tr { background: #2c3e50; color: #fff; }
.byd-parts-table th { padding: 10px 12px; text-align: left; white-space: nowrap; font-size: 13px; }
.byd-parts-table td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
.byd-parts-table tr:hover td { background: #f7f9fc; }

.byd-callout { font-weight: 700; color: #0070c0; text-align: center; width: 28px; }
.byd-ref     { font-family: monospace; font-size: 13px; white-space: nowrap; font-weight: 600; }
.byd-name    { max-width: 280px; font-size: 13px; }
.byd-price   { white-space: nowrap; font-weight: 700; font-size: 14px; color: #2c3e50; }

.byd-add-cart {
    padding: 7px 14px; font-size: 13px;
    background: #0070c0; color: #fff;
    border: none; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
.byd-add-cart:hover    { background: #005a9e; }
.byd-add-cart:disabled { opacity: .7; cursor: default; }

.byd-loading { color: #888; font-style: italic; padding: 10px 0; }
.byd-error   { color: #c0392b; padding: 8px 0; }
.byd-notice  { color: #888; font-style: italic; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .byd-subcats-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .byd-col-gif { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 700px) {
    .byd-layout { flex-direction: column; }
    .byd-col-gif { flex: none; width: 100%; max-width: 100%; }
    .byd-subcats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .byd-subcat-thumb { height: auto; aspect-ratio: 1; }
}
/* ── BYD SVG Interactif - Ajouts CSS v5.0 ────────────────────────────────── */

/* Wrapper SVG : remplace byd-schema-gif */
.byd-svg-wrapper {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.byd-svg-wrapper svg {
    width: 100% !important;
    height: auto !important;
    display: block;
    max-width: 100%;
}

/* Spinner pendant le chargement du SVG */
.byd-svg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #999;
}

/* Ligne tableau active (depuis clic SVG ou clic ligne) */
.byd-parts-table tbody tr[data-callout] {
    cursor: pointer;
    transition: background 0.12s;
}

.byd-parts-table tbody tr[data-callout]:hover {
    background: #f0f7ff;
}

.byd-parts-table tbody tr.byd-row-active {
    background: #dbeeff !important;
    outline: 2px solid #0070c0;
    outline-offset: -2px;
}

.byd-parts-table tbody tr.byd-row-active td {
    color: #003d6b;
    font-weight: 600;
}

.byd-parts-table tbody tr.byd-row-active .byd-callout {
    color: #e63946;
    font-weight: 700;
}

/* Indicateur visuel : numéro callout dans le tableau */
.byd-parts-table td.byd-callout {
    font-weight: 700;
    font-size: 1rem;
    color: #0070c0;
    text-align: center;
    min-width: 2rem;
}


/* ── Colonne Version (multi-versions) ── */
.byd-parts-table th, .byd-parts-table td { padding: 8px 9px; }
.byd-version { font-size: 12px; color: #555; white-space: normal; max-width: 160px; line-height: 1.3; }
.byd-ref { white-space: nowrap; font-family: monospace; font-size: 12px; }

/* ── Pleine largeur : neutralise le flex parent pour donner toute la place ── */
.block-category-inner { display: block !important; }
.block-category-inner > .text-muted { margin-bottom: 12px; }
.byd-category-diagram { width: 100%; }

/* ── Disposition horizontale : schéma à GAUCHE, tableau à droite ── */
.byd-layout { flex-direction: row; align-items: flex-start; gap: 20px; }
.byd-col-gif { flex: 0 0 460px; max-width: 460px; text-align: center; position: sticky; top: 12px; align-self: flex-start; }
.byd-col-gif .byd-schema-gif, .byd-col-gif img { max-width: 100%; width: 100%; height: auto; max-height: 600px; margin: 0 auto; cursor: zoom-in; }
.byd-col-table { flex: 1 1 0; min-width: 0; overflow-x: auto; }

/* Tableau compact */
.byd-parts-table { width: 100%; font-size: 12.5px; }
.byd-parts-table td, .byd-parts-table th { padding: 6px 8px; vertical-align: middle; }
.byd-name { line-height: 1.25; }

/* Colonne Version : police réduite, compacte, sans agrandir les lignes */
.byd-version {
    font-size: 10px;
    color: #777;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    max-width: 130px;
    vertical-align: middle;
}
.byd-parts-table th:nth-child(4), .byd-parts-table td.byd-version { width: 130px; }

@media (max-width: 760px) {
    .byd-layout { flex-direction: column; }
    .byd-col-gif { flex: 0 0 auto; max-width: 100%; width: 100%; }
    .byd-col-gif .byd-schema-gif, .byd-col-gif img { max-width: 420px; max-height: 320px; }
}



/* ===== byd-epc-enhance-v1 (EPC UX: menu vignettes, grille, 50/50, repères) ===== */
.byd-layout{display:flex;gap:24px;align-items:flex-start;}
.byd-layout.byd-hidden{display:none !important;}
.byd-col-gif{position:relative;flex:0 0 50%;max-width:50%;}
.byd-col-gif img{width:100%;height:auto;max-width:100%;max-height:none !important;display:block;cursor:default !important;}
.byd-col-gif,.byd-col-gif *{cursor:default;}
.byd-col-table{flex:0 0 50%;max-width:50%;}
/* Marqueurs repères type TIS */
#byd-marker-layer{position:absolute;left:0;top:0;pointer-events:none;z-index:5;}
#byd-marker-layer .byd-mark{pointer-events:auto;cursor:pointer;}
#byd-marker-layer .byd-mark-c{fill:#ffffff;fill-opacity:.45;stroke:#c00;stroke-width:1.2;stroke-opacity:.5;transition:fill .12s,fill-opacity .12s,stroke-opacity .12s;}
#byd-marker-layer .byd-mark-t{font:700 15px Manrope,sans-serif;fill:#444;opacity:.55;pointer-events:none;transition:fill .12s,opacity .12s;}
#byd-marker-layer .byd-mark.byd-on .byd-mark-c,#byd-marker-layer .byd-mark:hover .byd-mark-c{fill:#ff0000;fill-opacity:.9;stroke:#900;stroke-opacity:1;}
#byd-marker-layer .byd-mark.byd-on .byd-mark-t,#byd-marker-layer .byd-mark:hover .byd-mark-t{fill:#fff;opacity:1;}
/* Lignes tableau surlignées */
.byd-col-table tbody tr.byd-hl{background:#fff4d6 !important;outline:2px solid #f0ad00;}
.byd-col-table tbody tr{cursor:pointer;}
/* Typographie tableau */
.byd-col-table td.byd-name{font:12px/1.2 Manrope,sans-serif;color:#444;}
.byd-col-table td.byd-ref{font-size:14px;font-weight:700;}
.byd-col-table td.byd-version{font-size:11px;line-height:1.35;}
.byd-col-table .byd-vchip{display:block;}
/* Grille des sous-catégories (clic sur un groupe) */
#byd-group-view .ggv-title{font-size:22px;color:#1b3a6b;font-weight:700;margin:0 0 2px;}
#byd-group-view .ggv-sub{font-size:13px;color:#888;margin:0 0 16px;}
#byd-group-view .ggv-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:16px;}
#byd-group-view .ggv-card{border:1px solid #e2e2e2;border-radius:6px;overflow:hidden;cursor:pointer;background:#fff;transition:border-color .12s,box-shadow .12s;}
#byd-group-view .ggv-card:hover,#byd-group-view .ggv-card.byd-hi{border-color:#f0ad00;box-shadow:0 0 0 2px rgba(240,173,0,.35);}
#byd-group-view .ggv-thumb{height:300px;background:#fafafa center/contain no-repeat;display:flex;align-items:center;justify-content:center;color:#bbb;font-size:12px;}
#byd-group-view .ggv-lbl{padding:8px 6px;font-size:13px;color:#1b3a6b;text-align:center;font-weight:600;}
/* Menu vertical à vignettes */
#byd-vmenu .byd-vcard{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:5px;cursor:pointer;}
#byd-vmenu .byd-vcard:hover,#byd-vmenu .byd-vcard.active,#byd-vmenu .byd-vcard.byd-hi{background:#eef3fb;}
#byd-vmenu .vthumb{flex:0 0 46px;width:46px;height:36px;background:#fafafa center/contain no-repeat;border:1px solid #eee;border-radius:3px;}
#byd-vmenu .vlbl{font:12px/1.25 Manrope,sans-serif;color:#333;}
/* ===== fin byd-epc-enhance-v1 ===== */
