/* ==========================================================================
   InZeBox 0.19.0 – header : barre du haut (header-top, sections 1 à 4)
                    et barre principale (header-bottom, sections 5 à 8)
   Chargé par templates/_partials/head.tpl, AVANT le CSS boutique.

   Structure : templates/_partials/header.tpl (classe .ibx-header-top)
   Réassurance : modules/blockreassurance/views/templates/hook/blockreassurance.tpl
                 (blockreassurance greffé sur displayNav1)

   Couleurs : reprises des variables boutique (--dark, --primary) définies
   dans toutpourtoi.css / proconfort.css. Pour un réglage spécifique à une
   boutique, redéfinir les variables --ibx-topbar-* dans son CSS.
   Contrastes vérifiés (icônes = éléments non textuels, seuil 3:1) :
     ToutPourToi : #f59e0b sur #1f2937 ≈ 6,8:1 ; texte blanc ≈ 14,7:1
     Proconfort  : #3E9C97 sur #1B3A4B ≈ 3,7:1 ; texte blanc ≈ 12:1
     Badge panier (texte, seuil 4,5:1) : fond de barre sur accent ≈ 6,8:1 pour TPT ;
     pour Proconfort (3,7:1), proconfort.css passe le badge sur fond blanc (≈ 12:1).
   ========================================================================== */

:root {
  --ibx-topbar-bg: var(--dark, #1f2937);
  --ibx-topbar-fg: #fff;
  --ibx-topbar-accent: var(--primary, #f59e0b);   /* icônes et badge panier (jamais du texte) */
  --ibx-topbar-font-size: .8125rem;               /* 13 px */
  --ibx-topbar-icon-size: 1.125rem;               /* 18 px (fiche produit : 32 px) */
  --ibx-topbar-gap: 1.5rem;                       /* entre deux engagements */
  --ibx-topbar-badge-bg: var(--ibx-topbar-accent); /* badge du panier */
  --ibx-topbar-badge-fg: var(--ibx-topbar-bg);
}

/* 1. Barre ---------------------------------------------------------------- */
.header-top.ibx-header-top {
  /* Variables lues par Hummingbird pour les liens du header-top */
  --header-top-color: var(--ibx-topbar-fg);
  --header-top-color-hover: var(--ibx-topbar-fg);   /* l'accent Proconfort (3,7:1) est trop faible pour du texte */

  padding: .375rem 0;
  font-size: var(--ibx-topbar-font-size);
  line-height: 1.3;
  color: var(--ibx-topbar-fg);
  background-color: var(--ibx-topbar-bg);
  border-bottom: 0;
}

.ibx-header-top .header-top__left {
  min-width: 0;
}

/* 2. Réassurance (colonne gauche) ---------------------------------------- */
.ibx-topbar-reassurance {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--ibx-topbar-gap);
  align-items: center;
  min-width: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ibx-topbar-reassurance__item {
  min-width: 0;
}

.ibx-topbar-reassurance__link {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.ibx-topbar-reassurance__title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ibx-header-top a.ibx-topbar-reassurance__link:hover,
.ibx-header-top a.ibx-topbar-reassurance__link:focus {
  color: inherit;
}

a.ibx-topbar-reassurance__link:hover .ibx-topbar-reassurance__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Icône : l'image du module sert de masque, la couleur vient du CSS.
   SVG des packs et SVG/PNG transparents personnalisés : OK.
   PNG à fond opaque : s'affiche comme un carré plein (utiliser des icônes détourées). */
.ibx-topbar-reassurance__icon {
  flex-shrink: 0;
  width: var(--ibx-topbar-icon-size);
  height: var(--ibx-topbar-icon-size);
  background-color: var(--ibx-topbar-accent);
  -webkit-mask: var(--ibx-topbar-icon) center / contain no-repeat;
          mask: var(--ibx-topbar-icon) center / contain no-repeat;
}

/* 3. Colonne droite : langue, compte, panier sur fond foncé -------------- */
/* Compte connecté = <button> (pas un lien) : couleur non héritée d'Hummingbird */
.ibx-header-top .header-block__action-btn {
  color: var(--ibx-topbar-fg);
}

/* Survol : soulignement plutôt que changement de couleur (contraste garanti) */
.ibx-header-top .header-block__action-btn:hover,
.ibx-header-top .header-block__action-btn:focus {
  color: var(--ibx-topbar-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Badge panier : gris clair + texte hérité (blanc) = illisible sur fond foncé */
.ibx-header-top .header-block__badge {
  color: var(--ibx-topbar-badge-fg);
  background: var(--ibx-topbar-badge-bg);
}

/* Sélecteur de langue natif (provisoire, en attendant les boutons FR | DE) */
.ibx-header-top .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  color: var(--ibx-topbar-fg);
  background-color: transparent;
}

.ibx-header-top .form-select option {
  color: #212529;           /* liste déroulante : fond clair du système */
  background-color: #fff;
}

/* Focus clavier visible sur fond foncé */
.ibx-header-top a:focus-visible,
.ibx-header-top button:focus-visible,
.ibx-header-top .form-select:focus-visible {
  outline: 2px solid var(--ibx-topbar-fg);
  outline-offset: 2px;
  box-shadow: none;
}

/* Mode contraste élevé (Windows) : fonds neutralisés, l'icône doit rester visible */
@media (forced-colors: active) {
  .ibx-topbar-reassurance__icon {
    background-color: CanvasText;
  }
}

/* 4. Responsive ----------------------------------------------------------- */
/* Tablette : 2 engagements */
@media (max-width: 991.98px) {
  .ibx-topbar-reassurance__item:nth-child(n + 3) {
    display: none;
  }
}

/* Mobile : 1 engagement centré (le 1er dans l'ordre du module) */
@media (max-width: 767.98px) {
  .header-top.ibx-header-top {
    padding: .5rem 0;
  }

  .ibx-topbar-reassurance {
    justify-content: center;
  }

  .ibx-topbar-reassurance__item:nth-child(n + 2) {
    display: none;
  }
}


/* ==========================================================================
   BARRE PRINCIPALE (header-bottom) – 0.19.0
   Modules attendus sur displayTop : ps_mainmenu, ps_searchbar,
   ps_customersignin, ps_shoppingcart (ordre indifférent : l'ordre visuel
   est fixé ici en CSS).

   Disposition :
     < 768 px     : ☰  logo ..........  🔍  👤  🛒      (Hummingbird d'origine)
     768–1199 px  : ☰  logo  [  recherche  ]  👤 Compte  🛒 Panier
     ≥ 1200 px    : logo  [  recherche  ]  👤 Compte  🛒 Panier
                    menu (ligne pleine largeur)
   ========================================================================== */

:root {
  --ibx-header-accent: var(--primary, #f59e0b);
  --ibx-header-search-border: var(--ibx-header-icon-color); /* contour = teinte des icônes (3:1 min.) */
  --ibx-header-search-radius: 1.5rem;           /* pilule ; Proconfort : plus sobre */
  --ibx-header-search-max-width: 40rem;
  --ibx-header-badge-bg: var(--ibx-header-accent);
  --ibx-header-badge-fg: var(--dark, #1f2937);   /* TPT : 6,8:1 */
  --ibx-header-icon-size: 36px;                   /* hauteur des icônes compte / envies / panier (0.25.0 : 26 + 10 px ; dessin ≈ 27 px) */
  --ibx-header-icon-color: var(--primary, #f59e0b); /* teinte des icônes (élément non textuel : 3:1) */
  --ibx-icon-ring-color: var(--bs-body-bg, #fff); /* anneau autour des pastilles = fond du header */
  --ibx-header-label-size: .75rem;                /* 12 px, libellés sous les icônes */
  --ibx-header-actions-gap: .25rem;              /* écart identique entre compte, envies, panier */
  --ibx-header-action-width: 6rem;                /* largeur commune : icônes équidistantes */
  --ibx-header-label-gap: 4px;                    /* entre l'icône et son libellé */
  --ibx-logo-max-height: calc(3rem + 30px);       /* Hummingbird : 3rem ; 0.22.0 +10 px, 0.24.0 +20 px = 78 px */
  --ibx-logo-max-width: calc(8rem + 30px);        /* Hummingbird : 8rem (9rem dès 768 px) */
}

@media (min-width: 768px) {
  :root {
    --ibx-logo-max-width: calc(9rem + 30px);
  }
}

/* 5. Compte et panier : hors de la grille Bootstrap -------------------------
   Hummingbird les prévoit dans la barre du haut. Dans la barre principale,
   leurs conteneurs sont des enfants directs de .row et prennent donc 100 %
   de largeur (règle « .row > * » de Bootstrap) : d'où l'empilement. */
@media (max-width: 767.98px) {
  /* Mobile : le JS d'Hummingbird vide ces conteneurs et déplace leur contenu
     dans #_mobile_ps_customersignin / #_mobile_ps_shoppingcart. Vides mais
     à 100 % de largeur, ils forceraient un retour à la ligne. */
  .header-bottom #_desktop_ps_customersignin,
  .header-bottom #_desktop_ps_shoppingcart {
    display: none;
  }
}

@media (min-width: 768px) {
  .header-bottom #_desktop_ps_customersignin,
  .header-bottom #_desktop_ps_shoppingcart {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    width: auto;
  }

  .header-bottom #_desktop_ps_customersignin {
    order: 3;
    padding-right: 0;                             /* gouttière Bootstrap remplacée par l'écart commun */
  }
  .header-bottom #_desktop_ps_shoppingcart {
    order: 4;
    padding-left: 0;
    margin-left: var(--ibx-header-actions-gap);
  }

  /* 6. Recherche : occupe l'espace libre, centrée -------------------------
     Le module impose déjà « order-2 ms-auto » (utilitaires en !important). */
  .header-bottom #_desktop_ps_searchbar {
    flex: 1 1 0%;
    max-width: var(--ibx-header-search-max-width);
    margin-right: auto;
  }

  .header-bottom #_desktop_ps_searchbar .ps-searchbar {
    width: 100%;
    min-width: 0;
  }
}

.header-bottom .ps-searchbar__input {
  min-height: 3rem;
  border: 2px solid var(--ibx-header-search-border);
  border-radius: var(--ibx-header-search-radius);
}

.header-bottom .ps-searchbar__input:focus {
  border-color: var(--ibx-header-search-border);
  box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--ibx-header-accent) 40%, transparent);
}

/* 7. Menu : ligne dédiée pleine largeur à partir de 1200 px ---------------
   Sous 1200 px, Hummingbird affiche un bouton ☰ (order: -1, avant le logo). */
@media (min-width: 1200px) {
  .header-bottom .ps-mainmenu--desktop {
    order: 5;
    flex: 0 0 100%;
    width: 100%;
    margin-top: .25rem;
    border-top: 1px solid var(--bs-border-color);
  }
}

/* 8. Icônes du header : compte, listes d'envies, panier (0.20.0 / 0.21.0) -----
   SVG en ligne dans les templates ps_customersignin et ps_shoppingcart.
   Toutes les icônes partagent la même hauteur de viewBox (883.5) : même
   taille de tracé à l'écran. La pastille (listes d'envies, panier) est dans
   le SVG ; un anneau de la couleur du fond la détache du tracé. */
.header-bottom .ibx-icon {
  flex-shrink: 0;
  width: auto;
  height: var(--ibx-header-icon-size);
  overflow: visible;
  color: var(--ibx-header-icon-color);
}

/* Hummingbird colore les icônes en --bs-primary (bleu) quand le panier n'est pas vide */
.header-bottom .header-block--active .ibx-icon {
  color: var(--ibx-header-icon-color);
}

.ibx-icon__shape {
  fill: currentColor;
}

/* L'attribut hidden n'est pas natif en SVG : on le garantit ici */
.ibx-icon [hidden] {
  display: none;
}

.ibx-icon__badge {
  fill: var(--ibx-header-badge-bg);
  stroke: var(--ibx-icon-ring-color);
  stroke-width: 40;
}

.ibx-icon__count {
  font-family: inherit;
  font-weight: 700;
  fill: var(--ibx-header-badge-fg);
}

.ibx-icon__count--1 { font-size: 320px; }  /* unités du viewBox ; à 36 px d'icône : ~13 px */
.ibx-icon__count--2 { font-size: 260px; }  /* ~10,6 px */
.ibx-icon__count--3 { font-size: 185px; }  /* « 99+ » : ~7,5 px, cas rare */

@media (forced-colors: active) {
  .header-bottom .ibx-icon { color: CanvasText; }
  .ibx-icon__badge { fill: Canvas; stroke: CanvasText; }
  .ibx-icon__count { fill: CanvasText; }
}

/* 9. Libellés sous les icônes (0.21.0) -------------------------------------- */
.ibx-header-actions {
  display: flex;
  align-items: flex-start;
  gap: var(--ibx-header-actions-gap);
}

.header-bottom :is(#_desktop_ps_customersignin, #_desktop_ps_shoppingcart, #_mobile_ps_customersignin, #_mobile_ps_shoppingcart) .header-block__action-btn {
  flex-direction: column;
  gap: var(--ibx-header-label-gap);
  align-items: center;
  justify-content: flex-start;
  padding: .25rem .125rem;
  text-align: center;
  color: var(--bs-body-color);
  text-decoration: none;
}

.header-bottom .ibx-header-label {
  display: block;
  font-size: var(--ibx-header-label-size);
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  white-space: normal;                            /* « Mes listes d'envies » : 2 lignes */
  overflow-wrap: anywhere;
}

.header-bottom a.header-block__action-btn:hover .ibx-header-label,
.header-bottom button.header-block__action-btn:hover .ibx-header-label {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Desktop : largeur commune (icônes équidistantes, libellés centrés) et
   hauteur commune de libellé sur 2 lignes (icônes alignées même si un
   libellé passe à la ligne, ex. « Mes listes d'envies »). */
@media (min-width: 768px) {
  .header-bottom :is(#_desktop_ps_customersignin, #_desktop_ps_shoppingcart) .header-block__action-btn {
    width: var(--ibx-header-action-width);
  }

  .header-bottom .ibx-header-label {
    min-height: calc(2 * 1.15em);
  }

  /* Hummingbird met « pe-md-0 » (!important) sur le bouton du panier :
     padding asymétrique = libellé décalé. Rétabli symétrique. */
  .header-bottom .blockcart .header-block__action-btn {
    padding-right: .125rem !important;
  }
}

/* Chevron Bootstrap du menu « Votre compte » : inutile sous une icône */
.header-bottom .ps-customersignin .dropdown-toggle::after {
  display: none;
}

/* Mobile : icônes seules ; libellés conservés pour les lecteurs d'écran */
@media (max-width: 767.98px) {
  .header-bottom .ibx-header-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}


/* 10. Recherche aux couleurs de la boutique (0.22.0) ----------------------- */
.header-bottom .ps-searchbar__magnifier,
.header-bottom .ps-searchbar__clear {
  color: var(--ibx-header-icon-color);
}

.header-bottom .ps-searchbar__input:hover {
  border-color: var(--ibx-header-search-border);
}

/* Icônes Material restantes du header : loupe mobile et bouton ☰ */
.header-bottom .ps-searchbar--mobile .header-block__icon,
.header-bottom .ps-mainmenu__mobile-toggle .menu-toggle {
  color: var(--ibx-header-icon-color);
}

/* 11. Logo agrandi de 10 px (0.22.0) ----------------------------------------
   Agrandit le plafond d'Hummingbird ; sans effet si l'image du logo est
   elle-même plus petite que ce plafond. */
.header-bottom .navbar-brand {
  max-height: max(calc(50px + 30px), 10vh);
}

.header-bottom .navbar-brand .logo {
  max-width: var(--ibx-logo-max-width);
  max-height: var(--ibx-logo-max-height);
}


/* 12. Menu justifié sur toute la largeur (0.23.0) ---------------------------
   Ligne du menu (≥ 1200 px) : premier élément à gauche, dernier à droite,
   espaces égaux entre les éléments. Avec très peu d'éléments, préférer
   « space-evenly » (marges égales aussi aux extrémités) via la variable. */
:root {
  --ibx-menu-justify: space-between;
}

@media (min-width: 1200px) {
  .header-bottom .ps-mainmenu--desktop .ps-mainmenu__desktop {
    flex: 1 1 auto;
    width: 100%;
  }

  .header-bottom .ps-mainmenu__tree {
    justify-content: var(--ibx-menu-justify);
    width: 100%;
    padding-left: 0;
  }
}


/* ==========================================================================
   13. FIL D'ARIANE (0.25.0) – templates/_partials/breadcrumb.tpl
   Bande légèrement teintée couleur boutique, chevrons « › », icône maison,
   niveau courant en gras. Mobile : « ‹ Catégorie parente » seul.
   Variante sobre (sans bande) : --ibx-breadcrumb-bg: transparent;
                                 --ibx-breadcrumb-border: transparent;
   ========================================================================== */
:root {
  --ibx-breadcrumb-bg: color-mix(in srgb, var(--primary, #f59e0b) 7%, #fff);
  --ibx-breadcrumb-border: color-mix(in srgb, var(--primary, #f59e0b) 20%, #fff);
  --ibx-breadcrumb-accent: var(--ibx-header-icon-color);   /* chevrons, icône maison (3:1) */
  --ibx-breadcrumb-link: #4b5563;                          /* texte des liens : 7,6:1 sur blanc */
  --ibx-breadcrumb-current: var(--dark, #1f2937);
  --ibx-breadcrumb-font-size: .8125rem;                    /* 13 px */
  --ibx-breadcrumb-current-max: 45ch;                      /* au-delà : « … » (desktop) */
}

.breadcrumb__wrapper.ibx-breadcrumb {
  margin-bottom: 1.5rem;
  background-color: var(--ibx-breadcrumb-bg);
  border-bottom: 1px solid var(--ibx-breadcrumb-border);
}

/* Hummingbird masque un fil réduit à « Accueil » via un sélecteur qui ne
   correspond jamais (data-depth est sur <nav>, pas sur <ol>) */
.breadcrumb__wrapper.ibx-breadcrumb[data-depth="1"] {
  display: none;
}

.ibx-breadcrumb .breadcrumb {
  --bs-breadcrumb-divider: "›";
  --bs-breadcrumb-divider-color: var(--ibx-breadcrumb-accent);
  --bs-breadcrumb-item-padding-x: .5rem;

  align-items: center;
  gap: 0;
  padding-block: .625rem;
  margin: 0;
  font-size: var(--ibx-breadcrumb-font-size);
  line-height: 1.3;
}

.ibx-breadcrumb .breadcrumb-item {
  display: inline-flex;
  align-items: center;
}

.ibx-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  padding-inline: .625rem;                         /* Hummingbird : collé à gauche */
  font-size: 1.15em;
  font-weight: 600;
  line-height: 1;
}

.ibx-breadcrumb .breadcrumb-link {
  display: inline-flex;
  gap: .375rem;
  align-items: center;
  color: var(--ibx-breadcrumb-link);
  text-decoration: none;
}

.ibx-breadcrumb .breadcrumb-link:hover,
.ibx-breadcrumb .breadcrumb-link:focus-visible {
  color: var(--ibx-breadcrumb-current);
  text-decoration: underline;
  text-decoration-color: var(--ibx-breadcrumb-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ibx-breadcrumb__home-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--ibx-breadcrumb-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ibx-breadcrumb__current {
  font-weight: 600;
  color: var(--ibx-breadcrumb-current);
}

@media (min-width: 768px) {
  .breadcrumb__wrapper.ibx-breadcrumb {
    margin-bottom: 2rem;
  }

  .ibx-breadcrumb__current > span {
    display: inline-block;
    max-width: var(--ibx-breadcrumb-current-max);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
  }
}

/* Mobile : un seul lien « ‹ Parent » (ex. sur une fiche produit : ‹ Plastifiées) */
@media (max-width: 767.98px) {
  .ibx-breadcrumb .breadcrumb-item:not(.ibx-breadcrumb__parent) {
    display: none;
  }

  .ibx-breadcrumb .breadcrumb-item.ibx-breadcrumb__parent::before {
    display: none;                                   /* pas de séparateur */
  }

  .ibx-breadcrumb__parent .breadcrumb-link {
    min-height: 44px;                                /* cible tactile */
    font-weight: 600;
    color: var(--ibx-breadcrumb-current);
  }

  .ibx-breadcrumb__parent .breadcrumb-link::before {
    content: "‹";
    font-size: 1.4em;
    line-height: 1;
    color: var(--ibx-breadcrumb-accent);
  }

  .ibx-breadcrumb__parent .ibx-breadcrumb__home-icon {
    display: none;                                   /* « ‹ Accueil » suffit */
  }

  .ibx-breadcrumb .breadcrumb {
    padding-block: 0;
  }
}


/* ==========================================================================
   14. MENU PRINCIPAL – version ordinateur uniquement (0.32.0)
   Tout est limité à .ps-mainmenu--desktop et ≥ 1200 px (seule largeur où le
   menu desktop d'Hummingbird est visible) : le menu mobile (offcanvas,
   .ps-mainmenu--mobile) n'est pas modifié.
   - éléments en couleur boutique (assombrie : texte ≥ 4,5:1) ;
   - survol / focus / sous-menu ouvert : liseré identique aux onglets produit
     (--ibx-tab-active-width, --ibx-tab-active-color) ;
   - élément sélectionné (page courante) : fond teinté couleur boutique ;
   - sous-menu : sous-catégories ALIGNÉES HORIZONTALEMENT (barre d'onglets),
     leurs enfants affichés dessous sur toute la largeur.
   ========================================================================== */
:root {
  --ibx-menu-color: color-mix(in srgb, var(--primary, #0b69f6) 60%, #000);  /* TPT 5,4:1, Proconfort 7,4:1 */
  --ibx-menu-line-color: var(--ibx-tab-active-color, var(--primary, #0b69f6));
  --ibx-menu-line-width: var(--ibx-tab-active-width, 3px);
  --ibx-menu-selected-bg: color-mix(in srgb, var(--primary, #0b69f6) 12%, #fff);
  --ibx-menu-hover-bg: color-mix(in srgb, var(--primary, #0b69f6) 6%, #fff);
  --ibx-menu-font-weight: 600;
  --ibx-menu-link-padding-y: .5rem;      /* 0.34.0 : Hummingbird 1.25rem */
  --ibx-menu-pill-margin: .25rem;        /* espace entre le rectangle et le liseré */
  --ibx-menu-pill-radius: .5rem;         /* angles du rectangle de sélection */
}

@media (min-width: 1200px) {
  /* 14a. Premier niveau (0.34.0 : hauteur −25 %, sélection en rectangle arrondi,
     plus de halo bleu au clic) ------------------------------------------------
     Hauteur d'origine Hummingbird : lien 24 px + 2 × 20 px = 64 px.
     Nouvelle hauteur : rectangle 40 px (lien 24 + 2 × 8) + 2 × 4 px de marge = 48 px. */
  .ps-mainmenu--desktop .ps-mainmenu__tree {
    gap: 0;
  }

  .ps-mainmenu--desktop .ps-mainmenu__tree > li {
    align-self: stretch;
    padding-inline: .25rem;
    transition: box-shadow .15s ease-in-out;
  }

  /* Le rectangle de sélection est porté par l'enveloppe lien + flèche */
  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-item-wrapper {
    margin-block: var(--ibx-menu-pill-margin);
    padding-inline: .5rem;
    border-radius: var(--ibx-menu-pill-radius);
    transition: background-color .15s ease-in-out;
  }

  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-link,
  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-dropdown-toggle {
    padding-block: var(--ibx-menu-link-padding-y);
    font-weight: var(--ibx-menu-font-weight);
    color: var(--ibx-menu-color);
  }

  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-link:hover,
  .ps-mainmenu--desktop .ps-mainmenu__tree > li .ps-mainmenu__tree-dropdown-toggle:hover {
    color: var(--ibx-menu-color);
  }

  /* Survol, focus clavier, sous-menu ouvert : liseré « onglet » sous l'élément */
  .ps-mainmenu--desktop .ps-mainmenu__tree > li:hover,
  .ps-mainmenu--desktop .ps-mainmenu__tree > li:focus-within,
  .ps-mainmenu--desktop .ps-mainmenu__tree > li:has([aria-expanded="true"]) {
    box-shadow: inset 0 calc(-1 * var(--ibx-menu-line-width)) 0 var(--ibx-menu-line-color);
  }

  /* Sélection (page courante, ou parent) : rectangle aux angles arrondis */
  .ps-mainmenu--desktop .ps-mainmenu__tree > li.current .ps-mainmenu__tree-item-wrapper {
    background-color: var(--ibx-menu-selected-bg);
  }

  .ps-mainmenu--desktop .ps-mainmenu__tree > li.current .ps-mainmenu__tree-link {
    color: var(--ibx-menu-color);
  }

  /* Clic souris : plus de halo bleu (outline Hummingbird sur :focus) */
  .ps-mainmenu--desktop .ps-mainmenu__tree > li :is(.ps-mainmenu__tree-link, .ps-mainmenu__tree-dropdown-toggle):focus {
    color: var(--ibx-menu-color);
    outline: 0;
    box-shadow: none;
  }

  /* Clavier uniquement : anneau couleur boutique */
  .ps-mainmenu--desktop .ps-mainmenu__tree > li :is(.ps-mainmenu__tree-link, .ps-mainmenu__tree-dropdown-toggle):focus-visible {
    outline: 2px solid var(--ibx-menu-line-color);
    outline-offset: 2px;
    border-radius: var(--ibx-menu-pill-radius);
  }

  /* 14b. Sous-menu : sous-catégories en ligne, enfants en dessous ---------- */
  .ps-mainmenu--desktop .submenu__row {
    flex-direction: column;
  }

  .ps-mainmenu--desktop .submenu__left,
  .ps-mainmenu--desktop .submenu__right {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .ps-mainmenu--desktop .submenu__left {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 .25rem;
    padding-block: .75rem 0;
    border-right: 0;
    /* ligne grise continue, comme sous les onglets produit */
    box-shadow: inset 0 calc(-1 * var(--ibx-tab-line-width, 1px)) 0 var(--ibx-tab-line-color, #d9d9d9);
  }

  .ps-mainmenu--desktop .submenu__left-item {
    gap: .25rem;
    padding: .625rem .875rem;
    font-weight: var(--ibx-menu-font-weight);
    color: var(--ibx-menu-color);
    border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
    transition: box-shadow .15s ease-in-out, background-color .15s ease-in-out;
  }

  .ps-mainmenu--desktop .submenu__left-item:hover,
  .ps-mainmenu--desktop .submenu__left-item:focus {
    color: var(--ibx-menu-color);
    background-color: var(--ibx-menu-hover-bg);
    outline: 0;
    box-shadow: inset 0 calc(-1 * var(--ibx-menu-line-width)) 0 var(--ibx-menu-line-color);
  }

  .ps-mainmenu--desktop .submenu__left-item:focus-visible {
    outline: 2px solid var(--ibx-menu-line-color);
    outline-offset: 2px;
  }

  /* Sous-catégorie sélectionnée (onglet actif) : fond teinté + liseré */
  .ps-mainmenu--desktop .submenu__left-item.active,
  .ps-mainmenu--desktop .submenu__left-item.active:is(:active, :focus) {
    color: var(--ibx-menu-color);
    background-color: var(--ibx-menu-selected-bg);
    box-shadow: inset 0 calc(-1 * var(--ibx-menu-line-width)) 0 var(--ibx-menu-line-color);
  }

  /* Flèche « a des enfants » : vers le bas (contenu affiché dessous) */
  .ps-mainmenu--desktop .submenu__left-item[data-ps-has-child="true"]::after {
    margin: 0;
    transform: rotate(90deg);
  }

  .ps-mainmenu--desktop .submenu__right {
    padding-block: 1.25rem 1.5rem;
  }

  /* Liens du panneau : couleur boutique, soulignés au survol */
  .ps-mainmenu--desktop .submenu__right-items .menu-item {
    color: var(--ibx-menu-color);
    text-decoration: none;
  }

  .ps-mainmenu--desktop .submenu__right-items .menu-item:hover,
  .ps-mainmenu--desktop .submenu__right-items .menu-item:focus-visible {
    color: var(--ibx-menu-color);
    text-decoration: underline;
    text-decoration-color: var(--ibx-menu-line-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
  }
}

@media (min-width: 1200px) and (prefers-reduced-motion: reduce) {
  .ps-mainmenu--desktop .ps-mainmenu__tree > li,
  .ps-mainmenu--desktop .submenu__left-item {
    transition: none;
  }
}

