/* ==========================================================================
   En-tête maison Trafic — préfixe .th-
   Maquette : Figma « Trafic » 1395:7349 (desktop 1440) et 1397:14182 (mobile 390).
   Paliers : ≥1280 maquette ; 1024-1279 desktop resserré ; <1024 en-tête mobile.
   ========================================================================== */

.th {
    --th-blue: #2B4678;
    --th-yellow: #F7CA39;
    --th-dark: #242526;
    --th-light: #F8F8F8;
    --th-grey: #515151;
    --th-card: #F1F1F1;
    /* Marge latérale du cadre Figma (41 px à 1440). Au-delà de 1440, le contenu reste
       centré dans 1440 px comme la page ; seuls les fonds vont jusqu'aux bords. */
    --th-gutter: max(41px, calc(50% - 679px));
    position: sticky; /* menu collant à toutes les largeurs (Thomas, 12/10/2026) */
    top: 0;
    z-index: 1000;
    margin-bottom: 20px; /* léger espace sous l'en-tête, demandé par Thomas le 12/10/2026 */
    font-family: "Roboto", Arial, sans-serif;
    color: var(--th-blue);
    background: #fff;
}
.th *, .th *::before, .th *::after { box-sizing: border-box; }
.th a { text-decoration: none; color: inherit; }
/* pas de « font: inherit » ici : il écraserait la taille et la graisse posées par chaque composant */
.th button { font-family: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 0; text-transform: none; letter-spacing: normal; }
.th button:hover, .th button:focus { background: none; color: inherit; }
.th ul { list-style: none; margin: 0; padding: 0; }
.th svg { display: block; flex: none; }
.th img { display: block; max-width: none; }
.th a:focus-visible, .th button:focus-visible { outline: 2px solid var(--th-yellow); outline-offset: 2px; }
.th [hidden] { display: none !important; }

/* --- Barre du haut (36px) ----------------------------------------------- */
.th-top {
    display: flex;
    align-items: center;
    height: 36px;
    background: var(--th-blue);
    color: var(--th-light);
    padding-left: var(--th-gutter);
}
.th-top__msg {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.th-top__marquee { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.th-top__cat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 35px 0 24px;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    text-decoration: underline !important;
    text-underline-offset: 2px;
    color: var(--th-light) !important;
    white-space: nowrap;
}
.th-top__cat svg { width: 14px; height: 14px; color: var(--th-yellow); }
.th-top__cat:hover { color: var(--th-yellow) !important; }
.th-top__contact {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: stretch;
    padding: 0 calc(var(--th-gutter) + 22px) 0 45px;
    background: var(--th-yellow);
    border-top-left-radius: 20px;
    font-size: 15px;
    font-weight: 700;
    line-height: 21px;
    color: var(--th-blue);
    white-space: nowrap;
}
.th-top__contact a:hover { text-decoration: underline; }
.th-top__sep { width: 1px; height: 17px; background: var(--th-blue); }

/* --- Ligne principale (64px) -------------------------------------------- */
.th-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 64px;
    padding: 0 var(--th-gutter);
    background: #fff;
}
.th-main__left { display: flex; align-items: center; gap: 24px; min-width: 0; }
.th-main__right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.th-links { display: flex; align-items: center; gap: 25px; white-space: nowrap; }
.th-links a { font-size: 14px; font-weight: 600; line-height: 18px; color: var(--th-blue); }
.th-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

.th-search {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex: 0 1 303px;
    min-width: 40px;
    height: 40px;
    padding: 0 4px 0 18px !important;
    border: 1px solid rgba(43, 70, 120, .8) !important;
    border-radius: 30px !important;
    background: #fff !important;
    text-align: left;
}
.th-search__ph { font-size: 13px; font-weight: 500; line-height: 17px; color: var(--th-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-search__ico { width: 30px; height: 30px; margin-left: 8px; }
.th-search:hover, .th-search:focus-within { border-color: var(--th-blue) !important; }
.th-search__go { display: flex !important; flex: none; }
.th-search__go .th-search__ico { margin-left: 8px; }

/* Champ de l'extension trafic-search, déplacé dans l'en-tête par header-trafic.js */
.th-search .tps-search-wrap { position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; background: none; border: 0; }
.th-search .tps-search-input,
.th-search .tps-search-input:focus {
    flex: 1 1 auto;
    width: 100% !important;
    min-width: 0;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 22px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font: 500 13px/17px "Roboto", Arial, sans-serif !important;
    color: var(--th-blue) !important;
}
.th-search .tps-search-input::placeholder { color: var(--th-grey); opacity: 1; }
.th-search .tps-search-clear {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 !important;
    transform: none !important; /* l'extension centre déjà par translateY(-50%) : les deux s'additionnaient */
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(43, 70, 120, .1) !important;
    color: var(--th-blue) !important;
    font-size: 15px;
    line-height: 1;
}
.th-search.has-input .th-search__ph { display: none; }

.th-logo { display: block; margin: 0 24px; }
.th-logo img { width: 137px; height: auto; }

.th-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 7px 0 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    color: #FAFAFA !important;
    white-space: nowrap;
    transition: filter .15s ease, transform .15s ease;
}
.th-btn svg { width: 30px; height: 30px; }
.th-btn--blue { background: var(--th-blue); }
.th-btn--dark { background: var(--th-dark); }
.th-btn--blue:hover, .th-btn--dark:hover { filter: brightness(1.18); }
.th-main__right .th-btn--dark { margin-right: 28px; }

.th-ico { position: relative; display: block; width: 30px; height: 30px; transition: transform .15s ease; }
.th-ico svg { width: 30px; height: 30px; }
.th-ico:hover { transform: scale(1.08); }
.th-ico--m { display: none !important; }
.th-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--th-yellow);
    color: var(--th-blue);
    font-size: 11px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}
.th-cart-count[data-count="0"] { display: none; }

.th-mbtn { display: none !important; }

/* --- Barre des catégories (55px) ---------------------------------------- */
.th-cats {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 55px;
    background: var(--th-light);
}
.th .th-cats__list {
    display: flex;
    align-items: stretch;
    flex: 0 1 auto; /* la liste peut rétrécir : ses libellés passent alors à la ligne */
    min-width: 0;
    padding-left: calc(var(--th-gutter) - var(--cat-pad));
    padding-right: 40px;
    background: rgba(247, 202, 57, .7);
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.th-cats {
    /* Tailles proportionnelles à la largeur (11 px / 22 px / 6 px à 1024 ; 13 px / 34 px / 14 px à 1440),
       au lieu de paliers fixes : un libellé ne doit jamais passer sous le « + » (retour Thomas
       du 12/10/2026 sur ordinateur portable, rendu Windows plus large que nos mesures). */
    --cat-fs: clamp(11px, calc(0.48vw + 6.1px), 13px);
    --cat-picto: clamp(22px, calc(2.885vw - 7.5px), 36px);
    --cat-pad: clamp(6px, calc(2vw - 14.5px), 24px);
}
.th-cat {
    position: relative;
    flex: 0 1 auto; /* rétrécit si besoin : le libellé passe sur deux lignes, le « + » suit le dernier mot */
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 var(--cat-pad);
}
.th-cat + .th-cat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 20px;
    margin-top: -10px;
    background: var(--th-blue);
}
.th-cat.is-open, .th-cat.is-current { background: var(--th-yellow); }
.th-cat.is-open::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--th-blue);
}
.th-cat.is-open::before, .th-cat.is-open + .th-cat::before { opacity: 0; }
.th-cat__pic { display: flex; flex: none; }
.th-cat__txt {
    display: block;
    min-width: 0;
    font-size: var(--cat-fs);
    font-weight: 700;
    line-height: 1.25;
    color: var(--th-blue);
}
.th-cat__link { display: inline; color: var(--th-blue); }
.th-cat__link:hover .th-cat__lbl { text-decoration: underline; text-underline-offset: 3px; }
.th-nowrap { white-space: nowrap; }
.th-cat__plus { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: -1px; cursor: pointer; }
.th-cat__plus svg { width: 12px; height: 12px; }
/* Bouton réel (clavier, lecteurs d'écran) : invisible, le focus se voit sur la gamme entière */
.th-cats__list .th-cat__toggle { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; overflow: hidden; clip-path: inset(50%); border: 0 !important; }
.th-cat:has(.th-cat__toggle:focus-visible) { outline: 2px solid var(--th-blue); outline-offset: -4px; }
.th-cat__picto { width: var(--cat-picto); height: var(--cat-picto); /* agrandis à la demande de Thomas le 12/10/2026 (26 px en maquette) */ object-fit: contain; flex: none; }
.th-minus { display: none !important; }
.is-open .th-cat__plus .th-plus { display: none !important; }
.is-open .th-cat__plus .th-minus { display: block !important; }

/* Sans bouton secteur métier (Lumiaris) : la bande jaune va jusqu'au bord, sans découpe en biais */
.th-cats:not(:has(.th-cats__secteur)) .th-cats__list { flex: 1 1 auto; clip-path: none; padding-right: var(--th-gutter); }

.th-cats__secteur {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 0 auto; /* ne rétrécit jamais : c'est la liste des gammes qui cède la place */
    padding: 0 calc(var(--th-gutter) - 14px) 0 12px;
}
.th-secteur.th-cat__toggle {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 40px;
    padding: 0 14px !important;
    border: 1px solid var(--th-yellow) !important;
    border-radius: 12px !important;
    background: rgba(247, 202, 57, .05) !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    color: var(--th-blue);
    white-space: nowrap;
    transition: background-color .15s ease;
}
.th-secteur.th-cat__toggle:hover, .is-open > .th-secteur.th-cat__toggle { background: rgba(247, 202, 57, .25) !important; }
.th-secteur.th-cat__toggle .th-secteur__casque { width: 22px; height: 15px; color: var(--th-yellow); }
.th-secteur.th-cat__toggle .th-secteur__chev { width: 6px; height: 12px; margin-left: 4px; color: var(--th-blue); transition: transform .15s ease; }
.is-open > .th-secteur .th-secteur__chev { transform: rotate(90deg); }

/* --- Méga-menu ---------------------------------------------------------- */
.th-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: calc(100vh - 100%);
    height: calc(100dvh - 100%);
}
.th-mega__veil { position: absolute; inset: 0; background: rgba(0, 0, 0, .8); }
.th-panel {
    position: relative;
    width: calc(100% - 2 * var(--th-gutter)); /* pleine largeur du menu (Thomas, 12/10/2026) */
    max-height: calc(100% - 40px);
    margin: 0 auto;
    padding: 40px 72px;
    overflow-y: auto;
    background: var(--th-light);
    border-radius: 0 0 42px 42px;
    animation: th-drop .18s ease-out;
}
@keyframes th-drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.th-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 46px 24px;
}
.th-card { display: flex; align-items: center; gap: 14px; }
.th-card__img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 78px;
    height: 65px;
    padding: 4px;
    background: var(--th-card);
    border: 1px solid rgba(81, 81, 81, .2);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease, background-color .15s ease;
}
.th-card__img img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.th-card__title { font-size: 16px; font-weight: 700; line-height: 22px; color: var(--th-blue); }
/* Survol : pas de variante dans la maquette, choix sobre (bordure bleue, image légèrement agrandie). */
.th-card:hover .th-card__img { border-color: var(--th-blue); background: #fff; }
.th-card:hover .th-card__img img { transform: scale(1.06); }
.th-card:hover .th-card__title { text-decoration: underline; text-underline-offset: 3px; }

/* --- Tiroir mobile (caché sur desktop) ---------------------------------- */
.th-drawer { display: none !important; }

/* Sticky : html et body portent overflow-x: hidden ailleurs sur le site, ce qui fait
   de body un conteneur de défilement et neutralise position: sticky (mesuré le
   12/10/2026 : en-tête à -800 px après 800 px de défilement). « clip » coupe le
   débordement de la même façon sans créer de conteneur de défilement. */
@supports (overflow: clip) {
    html:has(> body.trafic-entete-v2),
    body.trafic-entete-v2 { overflow-x: clip !important; overflow-y: visible !important; }
    html.th-lock:has(> body.trafic-entete-v2),
    html.th-lock body.trafic-entete-v2 { overflow: hidden !important; }
}
.admin-bar .th { top: 32px; }
@media (max-width: 782px) { .admin-bar .th { top: 46px; } }
@media (max-width: 600px) { .admin-bar .th { top: 0; } } /* barre d'admin non fixe sous 600 px */

/* ==========================================================================
   Desktop resserré : 1024-1279
   ========================================================================== */
@media (max-width: 1279px) {
    .th { --th-gutter: 24px; }
    .th-top__contact { padding-right: var(--th-gutter); padding-left: 30px; }
    .th-top__cat { margin-right: 24px; }
    .th-main__left { gap: 16px; }
    .th-links { gap: 16px; }
    .th-links a { font-size: 13px; }
    /* Le champ reste un vrai champ de saisie : il se resserre au lieu de devenir une icône. */
    .th-search { flex: 1 1 220px; min-width: 150px; padding-left: 14px !important; }
    .th-logo { margin: 0 16px; }
    .th-main__right .th-btn--dark { margin-right: 12px; }
    .th .th-cats__list { padding-right: 26px; }
    .th-cats__secteur { padding: 0 var(--th-gutter) 0 10px; }
    .th-cat { gap: 4px; }
    .th-cat__plus { margin-left: 4px; }
    .th-panel { padding: 36px 40px; }
    .th-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .th-grid { gap: 32px 20px; }
}
@media (max-width: 1150px) {
    .th-main__right .th-btn--blue { padding: 0 7px; gap: 0; }
    .th-main__right .th-btn--blue span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1199px) {
    .th-secteur.th-cat__toggle .th-secteur__casque { display: none; }
}
@media (max-width: 1100px) {
    .th .th-cats__list { padding-right: 22px; }
    .th-secteur.th-cat__toggle { padding: 0 10px !important; gap: 6px; font-size: 13px; }
}
@media (max-width: 1060px) {
    .th .th-cats__list { padding-right: 18px; }
    .th-cats__secteur { padding-left: 6px; }
}

/* ==========================================================================
   Mobile et tablette : < 1024
   ========================================================================== */
@media (max-width: 1023px) {
    .th { --th-gutter: 27px; }
    .th-top { height: 26px; padding: 0 var(--th-gutter); }
    .th-top__msg { text-align: center; }
    .th-top__cat, .th-top__contact { display: none !important; }
    .th-top:not(:has(.th-top__marquee)) { display: none; }

    .th-main { grid-template-columns: 1fr auto 1fr; height: 61px; }
    .th-main__left { gap: 10px; }
    .th-links, .th-search { display: none !important; }
    .th-mbtn { display: block !important; width: 40px; height: 40px; }
    .th-mbtn svg { width: 40px; height: 40px; }
    .th-burger__close { display: none !important; }
    .th.is-drawer .th-burger__open { display: none !important; }
    .th.is-drawer .th-burger__close { display: block !important; }
    .th-logo { margin: 0; }
    .th-logo img { width: 86px; }
    .th-main__right .th-btn, .th-ico--user { display: none !important; }
    .th-ico--cart { width: 40px; height: 40px; }
    .th-ico--d { display: none !important; }
    .th-ico--m { display: block !important; width: 40px !important; height: 40px !important; }
    .th-cart-count { top: -4px; right: -4px; }

    .th-cats, .th-mega { display: none !important; }

    .th-drawer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: var(--th-drawer-top, 87px);
        display: block !important;
        overflow: hidden;
        /* Fond clair demandé par Thomas le 12/10/2026 (variable Figma Commun-aux-deux-sites-Blanc) */
        background: var(--Commun-aux-deux-sites-Blanc, #F8F8F8);
        border-top: 1px solid rgba(43, 70, 120, .14);
        color: var(--th-blue);
    }
    .th-drawer[hidden] { display: none !important; }
    .th-drawer__main, .th-sub {
        position: absolute;
        inset: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .th-drawer__main { display: flex; flex-direction: column; padding-bottom: 24px; }
    .th .th-drawer__main > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }

    .th-dlist { padding-top: 0; }
    .th-dlist li { border-bottom: 1px solid rgba(43, 70, 120, .14); }
    .th-dlist__row {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 60px;
        padding: 10px var(--th-gutter) !important;
        font-size: 14px;
        font-weight: 700;
        line-height: 20px;
        text-align: left;
        color: var(--th-blue) !important;
    }
    .th-dlist__row span { flex: 1 1 auto; }
    .th-dlist__row .th-cat__picto { width: 30px; height: 30px; }
    .th-dlist__arrow { width: 14px; height: 6px; color: var(--th-blue); }

    .th-drawer__body { padding: 40px var(--th-gutter) 24px; }
    .th-dsecteur {
        display: flex !important;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 54px;
        padding: 12px 18px 12px 12px !important;
        border: 1px solid var(--th-yellow) !important;
        border-radius: 14px !important;
        background: rgba(247, 202, 57, .08) !important;
        font-size: 14px;
        font-weight: 700;
        line-height: 18px;
        text-align: left;
        color: var(--th-blue) !important;
    }
    .th-dsecteur > svg:first-child { width: 22px; height: 15px; color: var(--th-yellow); }
    .th-dsecteur span { flex: 1 1 auto; }
    .th-dlinks { display: flex; flex-direction: column; gap: 14px; margin: 28px 0 0; }
    .th-dlinks a { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; line-height: 18px; color: var(--th-blue) !important; }
    .th-dlinks svg { width: 14px; height: 14px; color: var(--th-yellow); }
    .th-dcompte { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font-size: 14px; font-weight: 700; line-height: 18px; color: var(--th-blue) !important; }
    .th-dcompte svg { width: 30px; height: 30px; }

    .th-drawer__foot { margin-top: auto !important; padding: 32px var(--th-gutter) 0; border-top: 1px solid rgba(43, 70, 120, .14); }
    .th-btn--wide { display: flex; justify-content: center; width: 100%; position: relative; }
    .th-drawer__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
    .th-dtel { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; line-height: 22px; color: var(--th-blue) !important; }
    .th-dtel svg { width: 14px; height: 14px; color: var(--th-yellow); }

    /* Niveau 2 : panneau clair (repris de la maquette 743:9121) */
    .th-sub { padding: 0 var(--th-gutter) 32px; background: var(--th-light); color: var(--th-blue); animation: th-slide .2s ease-out; }
    .th .th-sub > * { max-width: 640px; margin-left: auto; margin-right: auto; }
    @keyframes th-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
    .th-sub__back {
        display: flex !important;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 24px 0 8px !important;
        font-size: 16px;
        font-weight: 700;
        line-height: 22px;
        text-align: left;
        color: var(--th-blue) !important;
    }
    .th-sub__back-ico { width: 14px; height: 6px; transform: rotate(180deg); }
    .th-sub__all { display: inline-block; margin: 0 0 8px 24px; font-size: 14px; font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; color: var(--th-blue) !important; }
    .th-sub__list li { border-bottom: 1px solid rgba(43, 70, 120, .14); }
    .th-sub__list .th-card { padding: 10px 0; }
    .th-sub__list .th-card__img { width: 58px; height: 58px; }
    .th-sub__list .th-card__title { font-size: 15px; line-height: 20px; }

    html.th-lock, html.th-lock body { overflow: hidden !important; }
}

@media (max-width: 380px) {
    .th { --th-gutter: 16px; }
    .th-drawer__row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    .th-panel, .th-sub { animation: none; }
    .th-card__img img, .th-ico, .th-btn { transition: none; }
}

/* ==========================================================================
   Recherche (extension trafic-search) en liste déroulante sous le champ.
   Seulement avec le nouvel en-tête (body.trafic-entete-v2) : l'extension n'est
   pas modifiée, l'ancien en-tête garde son tiroir à droite.
   Retirés à la demande de Thomas (12/10/2026) : filtre catégorie, tri,
   bascule grille/liste. Conservés : suggestions, recherches récentes,
   consultés récemment, résultats, pagination, aperçu.
   ========================================================================== */
.trafic-entete-v2 .tps-filters-bar,
.trafic-entete-v2 .tps-view-toggle,
.trafic-entete-v2 .tps-shortcut-hint { display: none !important; }

.trafic-entete-v2 .tps-overlay {
    z-index: 999 !important;              /* sous l'en-tête (1000) : le champ reste utilisable */
    background: rgba(0, 0, 0, .45) !important;
    backdrop-filter: none !important;
}
.trafic-entete-v2 .tps-modal {
    top: var(--tps-top, 120px) !important;
    left: var(--tps-left, 0px) !important;
    right: auto !important;
    width: var(--tps-width, 640px) !important;
    max-width: none !important;
    height: auto !important;
    max-height: calc(100vh - var(--tps-top, 120px) - 24px) !important;
    max-height: calc(100dvh - var(--tps-top, 120px) - 24px) !important;
    z-index: 1001 !important;
    transform: none !important;
    transition: none !important;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 18px 40px rgba(43, 70, 120, .25) !important;
    overflow: hidden;
}
.trafic-entete-v2 .tps-modal:not(.open) { display: none !important; }
.trafic-entete-v2 .tps-modal .tps-results { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.trafic-entete-v2 .tps-modal:not(.th-has-content) .tps-results { min-height: 0; }

@media (min-width: 1024px) {
    /* Le champ vit dans l'en-tête : l'en-tête du tiroir (champ + croix) n'a plus lieu d'être. */
    .trafic-entete-v2 .tps-modal-header { display: none !important; }
}
@media (max-width: 1023px) {
    .trafic-entete-v2 .tps-modal {
        left: 0 !important;
        width: 100% !important;
        border-radius: 0;
        max-height: calc(100dvh - var(--tps-top, 61px)) !important;
        height: calc(100dvh - var(--tps-top, 61px)) !important;
    }
}

/* Cartes de résultats : apparence des cartes produit des pages catégorie
   (theme assets/css/product-grid.css, .tpg-card), en restant en liste.
   Demande de Thomas du 12/10/2026. */
.trafic-entete-v2 #tpsModal .tps-list { gap: 12px; }
.trafic-entete-v2 #tpsModal .tps-card {
    gap: 16px;
    padding: 10px 14px 10px 10px;
    border-radius: 28px;
    outline: 0 !important;
    border: 3px solid transparent;
    box-shadow: 0 0 0 1.6px #DCDCDC;
    background: #fff;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.trafic-entete-v2 #tpsModal .tps-card:hover { border-color: #F7CA39; box-shadow: none; }
.trafic-entete-v2 #tpsModal .tps-card-img {
    width: 104px;
    height: 80px;
    border-radius: 20px;
    background: #F1F1F1;
    overflow: visible;          /* la pastille d'options n'est plus rognée */
}
.trafic-entete-v2 #tpsModal .tps-card-img img {
    width: auto;
    height: auto;
    max-width: 82%;
    max-height: 82%;
    object-fit: contain;
    mix-blend-mode: multiply;
}
.trafic-entete-v2 #tpsModal .tps-card-badge { top: -6px; right: -6px; z-index: 2; box-shadow: 0 0 0 2px #fff; }
.trafic-entete-v2 #tpsModal .tps-card-content { gap: 3px; }
.trafic-entete-v2 #tpsModal .tps-card-title { font-family: 'Fira Sans', sans-serif; font-size: 16px; font-weight: 700; line-height: 21px; color: #2B4678; white-space: normal; overflow: hidden; text-overflow: clip; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trafic-entete-v2 #tpsModal .tps-card:hover .tps-card-title { color: #2B4678; }
.trafic-entete-v2 #tpsModal .tps-card-ref { font-family: 'Roboto', sans-serif; font-size: 14px; font-weight: 700; line-height: 19px; color: #515151; opacity: .6; }
.trafic-entete-v2 #tpsModal .tps-card-right { flex-direction: row; align-items: center; gap: 12px; }
.trafic-entete-v2 #tpsModal .tps-card-price,
.trafic-entete-v2 #tpsModal .tps-card-price-devis {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 11px;
    border-radius: 30px;
    background: #F7CA39;
    font-family: 'Fira Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 24px;
    color: #2B4678;
    white-space: nowrap;
}
.trafic-entete-v2 #tpsModal .tps-card-price-devis { font-size: 15px; }
.trafic-entete-v2 #tpsModal .tps-card-price .woocommerce-Price-amount { font: inherit; color: inherit; }
.trafic-entete-v2 #tpsModal .tps-card-cart {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2B4678;
    color: #fff;
    flex: none;
}
.trafic-entete-v2 #tpsModal .tps-card:hover .tps-card-cart { background: #2B4678; opacity: .85; }
.trafic-entete-v2 #tpsModal .tps-card-cart svg path,
.trafic-entete-v2 #tpsModal .tps-card:hover .tps-card-cart svg path { fill: #fff; }
@media (max-width: 600px) {
    .trafic-entete-v2 #tpsModal .tps-card { flex-wrap: wrap; border-radius: 22px; }
    .trafic-entete-v2 #tpsModal .tps-card-img { width: 80px; height: 66px; border-radius: 16px; }
    .trafic-entete-v2 #tpsModal .tps-card-title { font-size: 16px; line-height: 21px; }
    .trafic-entete-v2 #tpsModal .tps-card-right { width: 100%; justify-content: space-between; padding-left: 96px; }
    .trafic-entete-v2 #tpsModal .tps-card-price { font-size: 17px; }
}

/* Site sans vente en ligne (Lumiaris) : aucun bouton panier nulle part. Les cartes restent
   cliquables vers la fiche produit. */
.trafic-sans-boutique .tps-card-cart,
.trafic-sans-boutique .tpg-cart-btn,
.trafic-sans-boutique .cpm-cart-button,
.trafic-sans-boutique .tfp-cart-btn { display: none !important; }
