
/* ============================================================
 * EA L2 Listing Vertical v1.0.0
 * Scope: body.tax-vehicule
 * ============================================================ */

/* ---- A. Override L2C show-all (DEFAULT) ---------------------- */
/* Par défaut (avant interaction utilisateur) : on neutralise l'effet de masquage L2C.
   Toutes les cards visibles, même celles que L2C aurait marquées .ea-l2c-hide-card. */
body.tax-vehicule article.ea6-m-pcard,
body.tax-vehicule article.ea6-m-pcard.ea-l2c-hide-card {
    display: block !important;
}

/* ---- A-bis. v1.0.7 — quand user clique un sélecteur L2C : honorer le hide ----
   La classe .ea-l2c-filter-active est ajoutée par notre JS sur .ea6-m-pcard-grid
   au premier click utilisateur dans le configurateur. À partir de là, les cards
   marquées .ea-l2c-hide-card par le L2C redeviennent display:none → l'utilisateur
   ne voit QUE les attelages compatibles avec sa sélection. */
body.tax-vehicule .ea6-m-pcard-grid.ea-l2c-filter-active article.ea6-m-pcard.ea-l2c-hide-card {
    display: none !important;
}

/* ---- B. 1 carte par ligne, pleine largeur --------------------- */
body.tax-vehicule .ea6-m-pcard-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.tax-vehicule article.ea6-m-pcard {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px 0 !important;
    box-sizing: border-box;
    background: #FFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 22px 26px;
    transition: box-shadow .15s ease, border-color .15s ease;
    position: relative;
    overflow: hidden; /* v1.0.2 : kill stray badge bleed (ea6-m-pcard-stock 201px débordait en layout 2-col) */
}

body.tax-vehicule article.ea6-m-pcard:hover {
    border-color: #0D1144;
    box-shadow: 0 6px 20px rgba(13, 17, 68, 0.08);
}

/* ===========================================================
 * v1.0.3 — global media zone reset (applies in BOTH layouts)
 * - kill template V8.2 inner padding (20px) qui faisait paraître les photos petites
 * - bg blanc au lieu de gris pour matcher les fonds Steinhof natifs
 * - aspect-ratio fixe 4:3 pour standardiser et éliminer le whitespace vertical
 * =========================================================== */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media {
    padding: 0 !important;
    background: #FFFFFF !important;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    border: 1px solid #EDEFF7;
}

/* Inside-card layout : photo+body restent verticaux <768px, side-by-side ≥900px */
@media (min-width: 900px) {
    body.tax-vehicule article.ea6-m-pcard {
        display: grid !important;
        grid-template-columns: 320px 1fr;
        gap: 28px;
        align-items: start;
    }
    body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media {
        grid-column: 1;
        width: 320px;
        height: 240px;            /* v1.1.5 — 4:3 packshot standard, plus présent sur grand écran */
        align-self: start;
    }
    body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-body {
        grid-column: 2;
        min-width: 0;             /* prevent grid blow-out from long descriptions */
    }
}

/* v1.1.5 — Très grand écran (MacBook 16" Retina, écrans externes >1400px) :
   zone media encore plus large pour ne pas paraître écrasée à côté du texte. */
@media (min-width: 1400px) {
    body.tax-vehicule article.ea6-m-pcard {
        grid-template-columns: 360px 1fr;
        gap: 32px;
    }
    body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media {
        width: 360px;
        height: 270px;            /* 4:3 maintenu */
    }
}

/* Single-col layout (mobile + narrow desktop) */
@media (max-width: 899px) {
    body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media {
        width: 100%;
        max-width: 380px;
        margin-left: auto;
        margin-right: auto;
        aspect-ratio: 4 / 3;
        max-height: 320px;
    }
}

/* v1.0.4 — wrapper du carrousel : fill 100% pour donner l'espace aux slides */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media .ea6-m-pcard-photo,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media .ea-l2c-carousel,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media .ea-l2c-slides,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media figure.ea6-m-pcard-photo {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* v1.0.4 — IMG du carrousel uniquement (pas les SVG des badges) */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media img.ea-l2c-slide,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media img.ea-l2c-slide-photo,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media img.ea-l2c-slide-tech,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media .ea-l2c-slides > img,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-media figure.ea6-m-pcard-photo > img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;        /* preserve aspect ratio, no crop */
    display: block !important;
    padding: 8px;
    box-sizing: border-box;
}

/* v1.0.4 — RESET explicite : SVG des badges restent à leur taille naturelle.
 * Sans ça, le sélecteur générique du template parent (ou un autre mu-plugin) pourrait
 * encore les stretcher. Et défense contre toute future régression chez nous. */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-stock svg,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-brand svg,
body.tax-vehicule article.ea6-m-pcard .ea-l2c-stock-dot,
body.tax-vehicule article.ea6-m-pcard .ea6-brand-svg {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: initial !important;
    padding: 0 !important;
    flex-shrink: 0;
}
/* Re-apply the original explicit dims for the checkmark SVG inside .ea6-m-pcard-stock */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-stock > svg {
    width: 14px !important;
    height: 14px !important;
}
/* Brand logo Steinhof keeps its native viewBox sizing */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-brand .ea6-brand-svg,
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-brand > svg {
    width: 70px !important;
    height: auto !important;
}

/* v1.0.2 — fix badge "En stock" qui débordait en layout 2-col (201px wide dans 240px média avec padding interne) */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-stock {
    max-width: calc(100% - 24px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    z-index: 5 !important;                      /* v1.0.6 : monte au-dessus du brand */
}

/* v1.0.6 — repositionner le brand "STEINHOF" en bas-droite pour éviter overlap avec stock badge */
body.tax-vehicule article.ea6-m-pcard .ea6-m-pcard-brand {
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    left: auto !important;
    right: 8px !important;
    z-index: 4 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

/* ---- C. Highlight match (active L2C filter) ------------------- */
body.tax-vehicule article.ea6-m-pcard.ea-match-l2c {
    border-color: #1B5E20 !important;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.18), 0 6px 20px rgba(46, 125, 50, 0.10) !important;
}

/* ---- D. Compat pill (managed by JS) --------------------------- */
.ea-compat-pill {
    display: none;
    align-items: center;
    gap: 6px;
    background: #E8F5E9;
    color: #1B5E20;
    border: 1px solid #C8E6C9;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 10px;
    line-height: 1.4;
    width: fit-content;
}
.ea-compat-pill::before {
    content: "✓";
    color: #2E7D32;
    font-weight: 900;
}
.ea-compat-pill[data-state="match"] { display: inline-flex; }

/* ---- E. "Show-all banner" : informer l'utilisateur ----------- */
.ea-show-all-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #F5F6FA;
    border: 1px solid #D7DAE5;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 0 0 18px 0;
    font-size: 14px;
    color: #0D1144;
}
.ea-show-all-banner-text { flex: 1; }
.ea-show-all-banner strong { font-weight: 700; }
.ea-show-all-banner small { color: #6B7280; display: block; margin-top: 2px; font-size: 12px; }
.ea-show-all-banner-counter {
    background: transparent;             /* v1.0.2 : outline pill, plus flat color → ne ressemble plus à un CTA cliquable */
    color: #0D1144;
    border: 1.5px solid #0D1144;
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

/* ---- v1.1.0 — Avis Google dans le bandeau show-all ---------- */
.ea-show-all-banner-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #FFFBEB;
    border: 1px solid #FCD34D;
    border-radius: 6px;
    color: #78350F;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    margin-right: 8px;
}
.ea-show-all-banner-rating::before {
    content: "★";
    color: #F59E0B;
    font-size: 14px;
    line-height: 1;
}
.ea-show-all-banner-rating small {
    font-weight: 500;
    color: #92400E;
    font-size: 11px;
    margin-left: 2px;
}

/* ---- v1.1.0 — Pastille découpe pare-chocs par type --------- */
.ea-card-decoupe {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px 0;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.005em;
    border: 1px solid;
}
.ea-card-decoupe[data-decoupe="none"] {
    background: #ECFDF5;
    color: #065F46;
    border-color: #6EE7B7;
}
.ea-card-decoupe[data-decoupe="hidden"] {
    background: #EFF6FF;
    color: #1E40AF;
    border-color: #93C5FD;
}
.ea-card-decoupe[data-decoupe="optional"] {
    background: #FFF7ED;
    color: #9A3412;
    border-color: #FB923C;
}
.ea-card-decoupe[data-decoupe="check"] {
    background: #F9FAFB;
    color: #374151;
    border-color: #D1D5DB;
}
.ea-card-decoupe::before {
    font-weight: 900;
    font-size: 13px;
    line-height: 1;
}
.ea-card-decoupe[data-decoupe="none"]::before { content: "✓"; }
.ea-card-decoupe[data-decoupe="hidden"]::before { content: "✓"; }
.ea-card-decoupe[data-decoupe="optional"]::before { content: "ⓘ"; }
.ea-card-decoupe[data-decoupe="check"]::before { content: "ⓘ"; }

/* ---- v1.1.1 — Trust badge "Distributeur français · 11 centres" -- */
.ea-card-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px 0;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    color: #0D1144;
    background: #F0F4FF;
    border: 1px solid #C7D2FE;
}
.ea-card-trust-badge::before {
    content: "🇫🇷";
    font-size: 13px;
    line-height: 1;
}
.ea-card-trust-badge strong {
    font-weight: 700;
    color: #0D1144;
}
.ea-card-trust-badge a {
    color: #0D1144;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- v1.1.1 — Bloc "Pourquoi Euro-Attelage" en bas du listing */
.ea-why-ea-block {
    margin: 32px 0 24px 0;
    padding: 28px 32px;
    background: linear-gradient(180deg, #F8FAFF 0%, #EEF2FF 100%);
    border: 1px solid #D7DAE5;
    border-radius: 14px;
}
.ea-why-ea-block h3 {
    margin: 0 0 18px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0D1144;
    text-align: center;
}
.ea-why-ea-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 767px) {
    .ea-why-ea-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .ea-why-ea-block {
        padding: 20px 18px;
    }
}
.ea-why-ea-card {
    text-align: center;
    padding: 12px 8px;
    background: #FFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
}
.ea-why-ea-card-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 8px;
}
.ea-why-ea-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0D1144;
    margin-bottom: 2px;
    line-height: 1.3;
}
.ea-why-ea-card-sub {
    font-size: 11px;
    color: #6B7280;
    line-height: 1.4;
}

/* ---- v1.1.1 — Bandeau rating enrichi (texte secondaire) ----- */
.ea-show-all-banner-rating-meta {
    display: block;
    font-size: 10px;
    color: #92400E;
    font-weight: 500;
    margin-top: 1px;
    letter-spacing: 0;
}
@media (max-width: 767px) {
    .ea-show-all-banner-rating { font-size: 11px; padding: 3px 8px; }
}

/* ---- v1.1.0 — Lien "Faire poser" sous CTA principal --------- */
.ea-card-pose-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    color: #0D1144;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .15s ease;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 4px 0;
}
.ea-card-pose-link:hover {
    border-bottom-color: #0D1144;
    color: #0D1144;
}
.ea-card-pose-link::before {
    content: "↳";
    color: #6A7299;
    font-weight: 700;
    margin-right: 2px;
}

/* ---- v1.0.5. Subtitle distinctif anti near-duplicate -------- */
.ea-card-subtitle {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 4px 0 12px 0;
    padding: 6px 12px;
    background: #F5F6FA;
    border-left: 3px solid #0D1144;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.45;
    color: #2A2F4A;
    font-weight: 500;
    letter-spacing: 0.005em;
}
.ea-card-subtitle::before {
    content: "↳";
    color: #6A7299;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1.4;
}
.ea-card-subtitle strong {
    color: #0D1144;
    font-weight: 700;
}

/* ---- F. Fix A-131 : bandeau pro variant ---------------------- */
.ea-pro-variant-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(180deg, #FFF7ED 0%, #FFEDD5 100%);
    border: 1px solid #FB923C;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #7C2D12;
}
.ea-pro-variant-banner::before {
    content: "🔧";
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}
.ea-pro-variant-banner strong { color: #9A3412; display: block; margin-bottom: 2px; }

/* ---- G. Fix A-131 : placeholder image ------------------------ */
.ea-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4/3;
    min-height: 180px;
    background: linear-gradient(135deg, #F5F6FA 0%, #E5E7EB 100%);
    border: 1px dashed #9CA3AF;
    border-radius: 10px;
    color: #6B7280;
    font-size: 12px;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}
.ea-img-placeholder::before {
    content: "📦";
    font-size: 32px;
    margin-bottom: 8px;
    line-height: 1;
}

/* ---- H. Mobile tuning ---------------------------------------- */
@media (max-width: 767px) {
    body.tax-vehicule article.ea6-m-pcard {
        padding: 16px 18px;
        margin-bottom: 16px;
    }
    .ea-show-all-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
}
