/*
 * ecpcomparateur - styles (21/10/2026).
 * Tout est prefixe .ecpcomp- : aucune regle du theme ni d'ecpdevis n'est
 * redefinie, sauf deux ajustements signales plus bas (hauteur des cartes
 * 4 colonnes, bandeau ecpdevis au-dessus de la barre).
 */

:root {
    --ecpcomp-violet: #3d076d;
    --ecpcomp-violet-clair: #f3ecfa;
    --ecpcomp-orange: #f08300;
    --ecpcomp-diff: #fff4d6;
    --ecpcomp-bord: #e3e3e3;
}

/* ─── Bouton « Comparer » (listes et fiche) ───────────────────────── */

.ecpcomp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--ecpcomp-violet);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}
.ecpcomp-toggle:hover,
.ecpcomp-toggle:focus {
    color: var(--ecpcomp-violet);
    text-decoration: underline;
    background: var(--ecpcomp-violet-clair);
}
.ecpcomp-toggle:focus-visible { outline: 2px solid var(--ecpcomp-violet); outline-offset: 1px; }
.ecpcomp-case {
    position: relative;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--ecpcomp-violet);
    border-radius: 3px;
    background: #fff;
}
.ecpcomp-toggle--actif .ecpcomp-case { background: var(--ecpcomp-violet); }
.ecpcomp-toggle--actif .ecpcomp-case::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 0.5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ecpcomp-toggle--actif { font-weight: 700; }
.ecpcomp-toggle--attente { opacity: .55; cursor: progress; }
.ecpcomp-emoji { font-size: 1em; line-height: 1; }

/* Listes : petit lien centre sous « Ajouter au panier » / « Demander un
   devis » dans les vues en colonnes, a droite dans la vue liste (la ou
   ecpdevis aligne ces deux boutons). */
.ecpcomp-wrap--liste {
    display: block;
    width: 100%;
    margin: 2px 0 6px;
    text-align: center;
    clear: both;
}
.product_list.list .ecpcomp-wrap--liste {
    text-align: right;
    margin: 4px 0 0;
}
/* Colonne laterale « Top nouveautes » et autres listes compactes : rien. */
.sidebar-latest .ecpcomp-wrap--liste { display: none; }

/* 4 colonnes (grid_two) : le CSS du theme fige la carte a 36rem. Une ligne
   de plus deborderait : hauteur minimale a la place (meme correctif
   qu'ecpdevis, utile ici aussi quand ecpdevis n'est pas charge). */
#products #js-product-list .grid_two .product-miniature .thumbnail-container {
    height: auto;
    min-height: 36rem;
}

/* Fiche produit : sur sa propre ligne, sous « Demander un devis ». */
.ecpcomp-wrap--fiche { display: block; flex: 0 0 100%; width: 100%; margin: 8px 0 4px; clear: both; }
.product-quantity .ecpcomp-wrap--fiche { margin: 6px 0 0; }
.ecpcomp-wrap--fiche .ecpcomp-toggle { font-size: 14px; padding: 4px 8px; }

/* ─── Barre fixe ───────────────────────────────────────────────────── */

body.ecpcomp-avec-barre { padding-bottom: var(--ecpcomp-h, 80px); }
/* Le bandeau « ajoute au devis » d'ecpdevis remonte au-dessus de la barre. */
body.ecpcomp-avec-barre .ecpdevis-toast { bottom: calc(var(--ecpcomp-h, 80px) + 12px); }

.ecpcomp-barre {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: #fff;
    border-top: 3px solid var(--ecpcomp-violet);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .15);
    font-size: 14px;
}
.ecpcomp-barre-in {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 16px;
}
.ecpcomp-barre-tete {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ecpcomp-violet);
    font-weight: 700;
    cursor: pointer;
}
.ecpcomp-barre-tete:hover { background: var(--ecpcomp-violet-clair); }
.ecpcomp-barre-compte {
    padding: 0 7px;
    border-radius: 10px;
    background: var(--ecpcomp-violet);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
}
.ecpcomp-barre-chevron {
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border: solid var(--ecpcomp-violet);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-2px, -2px);
}
.ecpcomp-barre--repliee .ecpcomp-barre-chevron { transform: rotate(-135deg) translate(-2px, -2px); }
.ecpcomp-barre-cat {
    flex: 0 1 auto;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
    font-size: 12px;
}
.ecpcomp-barre-liste {
    display: flex;
    flex: 1 1 auto;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ecpcomp-barre-item,
.ecpcomp-barre-libre {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 260px;
    height: 56px;
    padding: 4px 22px 4px 4px;
    border: 1px solid var(--ecpcomp-bord);
    border-radius: 6px;
    background: #fff;
}
.ecpcomp-barre-libre {
    justify-content: center;
    padding: 4px;
    border-style: dashed;
    color: #aaa;
    font-size: 12px;
    text-align: center;
}
.ecpcomp-barre-img { flex: 0 0 48px; }
.ecpcomp-barre-img img { display: block; width: 48px; height: 48px; object-fit: contain; }
.ecpcomp-barre-nom {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.6em;
    color: #222;
    font-size: 12px;
    line-height: 1.3;
}
.ecpcomp-barre-retirer {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #888;
    font-size: 18px;
    line-height: 18px;
    cursor: pointer;
}
.ecpcomp-barre-retirer:hover,
.ecpcomp-barre-retirer:focus { background: #eee; color: #c00; }
.ecpcomp-barre-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}
.ecpcomp-barre-go { white-space: nowrap; }
.ecpcomp-barre-go--inactif { opacity: .55; cursor: not-allowed; }
.ecpcomp-barre-vider {
    padding: 4px 6px;
    border: 0;
    background: transparent;
    color: #666;
    text-decoration: underline;
    cursor: pointer;
}
.ecpcomp-barre-vider:hover { color: #c00; }
.ecpcomp-barre--repliee .ecpcomp-barre-liste,
.ecpcomp-barre--repliee .ecpcomp-barre-cat { display: none; }
.ecpcomp-barre--repliee .ecpcomp-barre-in { justify-content: space-between; padding-top: 4px; padding-bottom: 4px; }

@media (max-width: 767px) {
    .ecpcomp-barre-in { flex-wrap: wrap; gap: 6px 8px; padding: 6px 10px; }
    .ecpcomp-barre-cat { display: none; }
    .ecpcomp-barre-liste { order: 3; flex: 1 1 100%; gap: 6px; }
    .ecpcomp-barre-item,
    .ecpcomp-barre-libre { height: 48px; padding-right: 4px; justify-content: center; }
    .ecpcomp-barre-nom { display: none; }
    .ecpcomp-barre-img { flex-basis: 40px; }
    .ecpcomp-barre-img img { width: 40px; height: 40px; }
    .ecpcomp-barre-libre { font-size: 0; }
    .ecpcomp-barre-libre::before { content: '+'; font-size: 18px; }
    .ecpcomp-barre-retirer { top: -6px; right: -6px; background: #fff; border: 1px solid #ccc; font-size: 15px; line-height: 17px; }
    .ecpcomp-barre-actions { margin-left: auto; }
    .ecpcomp-barre-go { padding: 5px 12px; font-size: 13px; }
}

/* ─── Message passager et fenetre de choix ─────────────────────────── */

.ecpcomp-message {
    position: fixed;
    left: 50%;
    bottom: calc(var(--ecpcomp-h, 0px) + 14px);
    z-index: 1060;
    max-width: min(560px, calc(100vw - 24px));
    padding: 10px 16px;
    border-left: 4px solid var(--ecpcomp-violet);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .2);
    color: #222;
    font-size: 14px;
    opacity: 0;
    transform: translate(-50%, 10px);
    transition: opacity .2s, transform .2s;
}
.ecpcomp-message--visible { opacity: 1; transform: translate(-50%, 0); }
.ecpcomp-message--erreur { border-left-color: #d0021b; }

.ecpcomp-dialogue {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .45);
}
.ecpcomp-dialogue-boite {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.ecpcomp-dialogue-titre { margin: 0 24px 10px 0; color: var(--ecpcomp-violet); font-size: 18px; }
.ecpcomp-dialogue-texte { margin: 0 0 18px; line-height: 1.5; }
.ecpcomp-dialogue-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.ecpcomp-dialogue .ecpcomp-dialogue-secondaire,
.ecpcomp-dialogue .ecpcomp-dialogue-secondaire:hover,
.ecpcomp-dialogue .ecpcomp-dialogue-secondaire:focus {
    background: #fff !important;
    border: 1px solid var(--ecpcomp-violet) !important;
    color: var(--ecpcomp-violet) !important;
}
/* Le thème met une capitale à chaque mot des .btn : pas dans une phrase. */
.ecpcomp-dialogue .btn,
.ecpcomp-partage .btn { text-transform: none; }
.ecpcomp-dialogue-fermer {
    position: absolute;
    top: 6px;
    right: 10px;
    border: 0;
    background: none;
    color: #999;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.ecpcomp-dialogue-fermer:hover { color: #333; }

/* ─── Page /comparer ───────────────────────────────────────────────── */

.ecpcomp-page { margin-bottom: 30px; }
.ecpcomp-vide { padding: 30px 0; text-align: center; }
.ecpcomp-vide-titre { font-size: 18px; font-weight: 700; }

.ecpcomp-outils {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin: 0 0 12px;
}
.ecpcomp-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}
.ecpcomp-option input { width: 18px; height: 18px; margin: 0; }
.ecpcomp-option-nb { color: #777; font-weight: 400; }
.ecpcomp-partage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ecpcomp-partage label { margin: 0; font-weight: 600; }
.ecpcomp-partage input { width: 340px; max-width: 100%; font-size: 13px; }
.ecpcomp-partage .btn { display: inline-flex; align-items: center; gap: 4px; }
.ecpcomp-partage .material-icons { font-size: 18px; }
.ecpcomp-info { margin: 0 0 12px; }

.ecpcomp-legende { margin: 0 0 10px; color: #666; font-size: 13px; }
.ecpcomp-legende-diff {
    display: inline-block;
    margin-right: 10px;
    padding: 0 6px;
    border-radius: 3px;
    background: var(--ecpcomp-diff);
    color: #333;
}

.ecpcomp-defile {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--ecpcomp-bord);
    border-radius: 6px;
}
.ecpcomp-defile:focus-visible { outline: 2px solid var(--ecpcomp-violet); }
.ecpcomp-table {
    width: 100%;
    min-width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    background: #fff;
    font-size: 14px;
}
.ecpcomp-table th,
.ecpcomp-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    text-align: left;
    overflow-wrap: anywhere;
}
/* Premiere colonne collante : elle reste visible pendant le defilement. */
.ecpcomp-table tr > :first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    z-index: 2;
    width: 220px;
    background: #faf8fc;
    border-right: 1px solid var(--ecpcomp-bord);
}
.ecpcomp-table--2 { min-width: 640px; }
.ecpcomp-table--3 { min-width: 840px; }
.ecpcomp-table--4 { min-width: 1040px; }
.ecpcomp-table--1 .ecpcomp-produit { width: 320px; }

.ecpcomp-coin { vertical-align: bottom !important; color: #666; font-weight: 400; font-size: 13px; }
.ecpcomp-produit {
    position: relative;
    padding: 14px 12px 12px !important;
    text-align: center !important;
    font-weight: 400;
    border-bottom: 2px solid var(--ecpcomp-violet) !important;
}
.ecpcomp-retirer {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #888;
    font-size: 22px;
    line-height: 24px;
    text-align: center;
    text-decoration: none;
}
.ecpcomp-retirer:hover,
.ecpcomp-retirer:focus { background: #eee; color: #c00; text-decoration: none; }
.ecpcomp-produit-img { display: block; margin: 0 auto 8px; }
.ecpcomp-produit-img img { display: block; width: 140px; height: 140px; max-width: 100%; margin: 0 auto; object-fit: contain; }
.ecpcomp-produit-nom {
    display: block;
    min-height: 2.8em;
    margin-bottom: 6px;
    color: var(--ecpcomp-violet);
    font-weight: 700;
    line-height: 1.4;
}
.ecpcomp-refs {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0 6px;
    margin: 0 0 8px;
    font-size: 12px;
    text-align: left;
}
.ecpcomp-refs dt { color: #777; font-weight: 400; white-space: nowrap; }
.ecpcomp-refs dt::after { content: '\00a0:'; }
.ecpcomp-refs dd { margin: 0; color: #222; font-weight: 600; overflow-wrap: anywhere; }
.ecpcomp-prix { min-height: 1.6em; margin-bottom: 4px; }
.ecpcomp-prix-montant { color: var(--ecpcomp-orange); font-size: 1.4em; font-weight: 800; }
.ecpcomp-prix-ht { margin-left: 3px; color: var(--ecpcomp-orange); font-size: 12px; font-weight: 700; }
.ecpcomp-prix-reserve { display: inline-block; color: #555; font-size: 13px; line-height: 1.4; }
.ecpcomp-prix-reserve a { color: var(--ecpcomp-violet); font-weight: 700; text-decoration: underline; }
.ecpcomp-dispo { margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.ecpcomp-dispo--ok { color: #2e9e4f; }
.ecpcomp-dispo--attente { color: var(--ecpcomp-orange); }
.ecpcomp-dispo--non { color: #c62828; }
.ecpcomp-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ecpcomp-actions form { margin: 0; }
.ecpcomp-actions .add-to-cart { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ecpcomp-actions .add-to-cart .material-icons { font-size: 18px; }
.ecpcomp-actions .ecpdevis-wrap--comparer .ecpdevis-add { zoom: .8; width: auto; }
.ecpcomp-voir { font-size: 13px; text-decoration: underline; }

.ecpcomp-groupe th {
    padding: 10px 12px !important;
    background: var(--ecpcomp-violet) !important;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.ecpcomp-groupe th > span { position: -webkit-sticky; position: sticky; left: 12px; }
.ecpcomp-nom { color: #444; font-weight: 600; font-size: 13px; }
.ecpcomp-val--diff { background: var(--ecpcomp-diff); }
.ecpcomp-table tr > .ecpcomp-val--diff:first-child { background: var(--ecpcomp-diff); }
.ecpcomp-val--vide { color: #aaa; }
.ecpcomp-ligne:hover td { box-shadow: inset 0 0 0 9999px rgba(61, 7, 109, .04); }
.ecpcomp-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border: 1px solid #2e9e4f;
    border-radius: 9px;
    color: #2e9e4f;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: 1px;
    white-space: nowrap;
}
.ecpcomp-legende .ecpcomp-badge { margin: 0 4px 0 0; }
.ecpcomp-table--diff .ecpcomp-ligne--egale { display: none; }
.ecpcomp-aucune { color: #777; text-align: center !important; }
.ecpcomp-retour { margin-top: 16px; }

@media (max-width: 767px) {
    .ecpcomp-outils { flex-direction: column; align-items: stretch; }
    .ecpcomp-partage input { width: 100%; flex: 1 1 100%; }
    .ecpcomp-table { font-size: 13px; }
    .ecpcomp-table th,
    .ecpcomp-table td { padding: 6px 8px; }
    .ecpcomp-table tr > :first-child { width: 110px; }
    .ecpcomp-table--2 { min-width: 110px; width: calc(110px + 2 * 170px); }
    .ecpcomp-table--3 { min-width: 110px; width: calc(110px + 3 * 170px); }
    .ecpcomp-table--4 { min-width: 110px; width: calc(110px + 4 * 170px); }
    .ecpcomp-produit-img img { width: 96px; height: 96px; }
    .ecpcomp-produit-nom { font-size: 13px; }
    .ecpcomp-refs { display: block; text-align: center; }
    .ecpcomp-refs dt { margin-top: 2px; }
    .ecpcomp-coin-texte { font-size: 12px; }
    .ecpcomp-groupe th > span { left: 8px; }
}
