/* =====================================================================
   ABEP — en-tête (templates/_partials/header.tpl) — version validée par Rémi le 17/09/2026
   Barre haute noire · barre principale ivoire · bouton « Demande de devis » noir arrondi · accents or du logo (#BB853B)
   Habille le menu PrestaShop (module ps_mainmenu, liens gérés dans le BO) et la recherche (ps_searchbar).
   Couleurs codées en dur (charte : noir #090909, ivoire #F4EFE5, or #BB853B) : cette feuille ne dépend pas des variables
   de custom.css, dont le site (fond noir) a inversé le sens.
   ===================================================================== */

/* ---------- barre haute ---------- */
.abep-topbar {
  background: #090909;
  color: rgba(244, 239, 229, .72);
  font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif);
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 400;
}
.abep-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 38px; }
.abep-topbar__left { display: inline-flex; align-items: center; gap: .7rem; white-space: nowrap; text-overflow: ellipsis; }
.abep-topbar__dot { width: 6px; height: 6px; border-radius: 999px; background: #BB853B; box-shadow: 0 0 0 3px rgba(187, 133, 59, .22); flex: none; }
.abep-topbar__sep { opacity: .4; }
.abep-topbar__right { display: flex; align-items: center; gap: 1.6rem; }
.abep-topbar a { color: rgba(244, 239, 229, .78); text-decoration: none; transition: color .4s var(--abep-ease, ease); }
.abep-topbar a:hover { color: #BB853B; }
.abep-topbar__tel { display: inline-flex; align-items: center; gap: .5rem; letter-spacing: .12em; white-space: nowrap; }
.abep-topbar__tel svg { width: 13px; height: 13px; fill: none; stroke: #BB853B; stroke-width: 1.6; stroke-linejoin: round; }
/* modules Connexion / Panier (ps_customersignin, ps_shoppingcart) */
.abep-topbar__modules { display: flex; align-items: center; gap: 1.2rem; }
.abep-topbar__modules > div { display: flex; }
.abep-topbar .header-block { display: flex; align-items: center; }
.abep-topbar .header-block__action-btn { display: inline-flex; align-items: center; gap: .35rem; color: rgba(244,239,229,.78); padding: 0; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; }
.abep-topbar .header-block__action-btn:hover, .abep-topbar .header-block__action-btn:hover .header-block__title { color: #BB853B; }
.abep-topbar .header-block__icon { font-size: 17px; color: #BB853B; }
.abep-topbar .header-block__title { color: inherit; font-size: inherit; letter-spacing: inherit; }
.abep-topbar .header-block__badge {
  background: #BB853B; color: #090909; font-size: .6rem; font-weight: 600;
  min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 999px; text-align: center; letter-spacing: 0;
}
.abep-topbar .ps-shoppingcart .header-block { cursor: pointer; }

/* ---------- barre principale ---------- */
/* Aucun backdrop-filter / transform / filter sur header#header ni .abep-mainbar : le panneau mobile #mobileMenu (offcanvas, position:fixed)
   est rendu par ps_mainmenu dans .abep-mainbar__hook, un tel effet sur un ancêtre en ferait le bloc conteneur (panneau piégé, invisible). */
header#header { position: sticky; top: 0; z-index: 1030; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: transparent !important; border-bottom: 0 !important; box-shadow: none !important; }
.abep-mainbar { padding: 0; background: #F4EFE5; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border-bottom: 1px solid rgba(9, 9, 9, .1); color: #090909; }
.abep-mainbar__inner { position: relative; display: flex; align-items: center; gap: 1.25rem; min-height: 78px; }
.abep-mainbar__logo { display: flex; align-items: center; flex: none; }
.abep-mainbar__logo .logo { max-height: 52px; width: auto; display: block; transition: transform .6s var(--abep-ease, ease); }
.abep-mainbar__logo a:hover .logo { transform: scale(1.04); }

/* conteneur du hook displayTop : menu + recherche */
.abep-mainbar__hook { flex: 1; display: flex; align-items: center; gap: .75rem; min-width: 0; }
.abep-mainbar__hook .ps-mainmenu--desktop { flex: 1; width: auto; padding: 0; display: flex; align-items: center; justify-content: center; min-width: 0; }
.abep-mainbar__hook .ps-mainmenu__desktop { position: static; }

/* ---------- menu bureau (ps_mainmenu) ---------- */
.ps-mainmenu__tree { display: flex; align-items: center; justify-content: center; gap: .2rem; margin: 0; padding: 0; list-style: none; }
.ps-mainmenu__tree-item { position: static; }
.ps-mainmenu__tree-item-wrapper { display: flex; align-items: center; }
.ps-mainmenu__tree-link {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .62rem;
  font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 400;
  color: #2B2A27; text-decoration: none; white-space: nowrap; transition: color .45s var(--abep-ease, ease);
}
.ps-mainmenu__tree-link::after {
  content: ''; position: absolute; left: .62rem; right: .62rem; bottom: .25rem; height: 1px;
  background: #BB853B; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--abep-ease, ease);
}
.ps-mainmenu__tree-link:hover, .ps-mainmenu__tree-item.current .ps-mainmenu__tree-link { color: #090909; }
.ps-mainmenu__tree-link:hover::after, .ps-mainmenu__tree-item.current .ps-mainmenu__tree-link::after { transform: scaleX(1); }
.ps-mainmenu__tree-dropdown-toggle { color: #BB853B; }
/* liens personnalisés (ex. « Nos réalisations ») : séparés par un filet, icône galerie, un peu plus gras */
.ps-mainmenu__tree-item.type-link { margin-left: .3rem; padding-left: .5rem; border-left: 1px solid rgba(9, 9, 9, .1); }
.ps-mainmenu__tree-item.type-link .ps-mainmenu__tree-link { font-weight: 500; }
.ps-mainmenu__tree-item.type-link .ps-mainmenu__tree-link::before {
  content: ''; width: 15px; height: 15px; flex: none; background: #BB853B;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 16 5-5 4 4 3-3 6 6'/%3E%3Ccircle cx='16' cy='9' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 16 5-5 4 4 3-3 6 6'/%3E%3Ccircle cx='16' cy='9' r='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* sous-menus Hummingbird (si une catégorie a des enfants) */
.ps-mainmenu__desktop .submenu { background: #F4EFE5; color: #090909; border-top: 1px solid rgba(9, 9, 9, .1); box-shadow: 0 30px 60px -30px rgba(9, 9, 9, .3); }
.ps-mainmenu__desktop .submenu a { color: #2B2A27; }
.ps-mainmenu__desktop .submenu a:hover { color: #090909; }

/* ---------- recherche (ps_searchbar) : repliée en loupe, dépliée au focus ---------- */
.abep-mainbar__hook #_desktop_ps_searchbar { display: none; padding: 0; margin: 0; width: auto; flex: none; }
.abep-mainbar__hook .ps-searchbar { position: relative; min-width: 0; width: auto; max-width: none; }
.abep-mainbar__hook .ps-searchbar__form {
  position: relative; display: flex; align-items: center; width: 40px; height: 40px; margin: 0; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px; background: transparent;
  transition: width .5s var(--abep-ease, ease), border-color .4s, background .4s;
}
.abep-mainbar__hook .ps-searchbar__form:focus-within { width: 240px; border-color: #BB853B; background: #fff; cursor: text; }
.abep-mainbar__hook .ps-searchbar__magnifier { position: static; font-size: 19px; color: #BB853B; margin: 0 .2rem 0 .62rem; cursor: pointer; }
.abep-mainbar__hook .ps-searchbar__input, .abep-mainbar__hook .ps-searchbar__input:focus {
  border: 0; background: transparent; box-shadow: none; font-size: .78rem; height: auto; width: 0; padding: 0; opacity: 0;
  font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); color: #2B2A27; transition: opacity .3s;
}
.abep-mainbar__hook .ps-searchbar__form:focus-within .ps-searchbar__input { width: auto; flex: 1; padding: .5rem 1.6rem .5rem .3rem; opacity: 1; }
.abep-mainbar__hook .ps-searchbar__input::placeholder { color: rgba(43, 42, 39, .45); letter-spacing: .04em; }
.abep-mainbar__hook .ps-searchbar__clear { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: .2rem; color: #2B2A27; }
.abep-mainbar__hook .ps-searchbar__clear .material-icons { font-size: 16px; }
.abep-mainbar__hook .ps-searchbar__dropdown { right: 0; left: auto; min-width: 380px; background: #F4EFE5; color: #090909; }
.abep-mainbar__hook .ps-searchbar__dropdown a { color: #090909; }

/* ---------- bouton devis ---------- */
.abep-devis-btn {
  display: inline-flex; align-items: center; gap: .6rem; flex: none;
  padding: .72rem 1.35rem .72rem 1.5rem; border-radius: 999px;
  background: #090909; color: #F4EFE5;
  font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 500;
  text-decoration: none; white-space: nowrap; transition: background .5s var(--abep-ease, ease), color .5s, transform .5s var(--abep-ease, ease), box-shadow .5s;
}
.abep-devis-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--abep-ease, ease); }
.abep-devis-btn:hover { background: #BB853B; color: #090909; transform: translateY(-1px); box-shadow: 0 14px 30px -14px rgba(187, 133, 59, .7); }
.abep-devis-btn:hover svg { transform: translateX(3px); }
.abep-devis-btn__short { display: none; }

/* ---------- compte / panier mobiles ---------- */
.abep-mainbar__mobile-icons { display: flex; align-items: center; gap: .1rem; }
.abep-mainbar__mobile-icons .header-block__action-btn { color: #090909; padding: .4rem; display: inline-flex; align-items: center; position: relative; }
.abep-mainbar__mobile-icons .header-block__icon { font-size: 24px; }
.abep-mainbar__mobile-icons .header-block__title { display: none; }
.abep-mainbar__mobile-icons .header-block__badge {
  position: absolute; top: 0; right: 0; background: #BB853B; color: #090909;
  font-size: .6rem; font-weight: 600; min-width: 16px; height: 16px; line-height: 16px; border-radius: 999px; text-align: center; padding: 0 4px;
}

/* ---------- points de rupture ---------- */
/* ≥ 992 px : menu bureau visible (Hummingbird ne l'affiche qu'à partir de 1200 px), burger masqué */
/* Hummingbird masque le menu bureau avec .d-none.d-xl-block (layer « utilities », !important) : pour un !important, les couches
   déclarées EN PREMIER l'emportent et le CSS hors couche perd → on écrit dans la première couche du thème (vendors). Vérifié sur dev le 17/09. */
@layer vendors {
  @media (min-width: 992px) {
    .ps-mainmenu__desktop { display: block !important; }
    .ps-mainmenu__mobile-toggle { display: none !important; }
  }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  .ps-mainmenu__tree { flex-wrap: wrap; row-gap: 0; }
  .ps-mainmenu__tree-link { padding: .35rem .45rem; font-size: .62rem; letter-spacing: .07em; }
  .abep-devis-btn { padding: .65rem 1.1rem; font-size: .64rem; }
}
/* ≥ 1200 px : loupe de recherche */
@media (min-width: 1200px) {
  .abep-mainbar__hook #_desktop_ps_searchbar { display: block; }
}
/* < 992 px : burger à gauche, logo centré, compte + panier + bouton Devis à droite */
@media (max-width: 991.98px) {
  .abep-mainbar__inner { min-height: 64px; gap: .4rem; }
  .abep-mainbar__hook { flex: none; order: -1; }
  .abep-mainbar__hook .ps-mainmenu--desktop { flex: none; }
  .abep-mainbar__hook #_desktop_ps_searchbar { display: none !important; }
  .abep-mainbar__logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .abep-mainbar__logo .logo { max-height: 44px; }
  .abep-mainbar__mobile-icons { margin-left: auto; }
  .abep-devis-btn { order: 2; padding: .5rem .85rem .5rem 1rem; font-size: .62rem; letter-spacing: .12em; gap: .4rem; }
  .abep-devis-btn__long { display: none; }
  .abep-devis-btn__short { display: inline; }
  .abep-devis-btn svg { width: 12px; height: 12px; }
  /* burger du module */
  .ps-mainmenu__mobile-toggle .menu-toggle { padding: .4rem .4rem .4rem 0; color: #090909; line-height: 1; }
  .ps-mainmenu__mobile-toggle .material-icons { font-size: 28px; }
}
@media (max-width: 400px) {
  .abep-devis-btn { padding: .5rem .7rem; }
  .abep-devis-btn svg { display: none; }
}

/* ---------- panneau mobile du module (offcanvas #mobileMenu) ----------
   custom.css cible « #header .menu a[data-depth="0"] » (spécificité id) → les règles sur les liens sont préfixées par #header pour l'emporter.
   header.tpl déplace aussi #mobileMenu vers <body> (belt & braces contre tout futur backdrop-filter/transform sur le header). */
.ps-mainmenu--mobile { --bs-offcanvas-width: min(88vw, 400px); background: #F4EFE5 !important; color: #2B2A27; border-right: 1px solid rgba(9, 9, 9, .1); }
.ps-mainmenu--mobile .offcanvas-header { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(9, 9, 9, .1); min-height: 64px; color: #090909; }
.ps-mainmenu--mobile .offcanvas-header .btn-close { filter: none; opacity: .8; }
.ps-mainmenu--mobile .js-back-button { font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #BB853B; }
.ps-mainmenu--mobile .ps-mainmenu__mobile { padding: 1.2rem 1.5rem 0; }
.ps-mainmenu--mobile .menu__list { list-style: none; margin: 0; padding: 0; }
.ps-mainmenu--mobile .menu__list > li { border-bottom: 1px solid rgba(9, 9, 9, .08); display: flex; align-items: center; }
.ps-mainmenu--mobile .menu__title { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: #BB853B; padding: .4rem 0 .8rem; border-bottom: 0 !important; }
#header .ps-mainmenu--mobile .menu__list .menu__link, body > .ps-mainmenu--mobile .menu__list .menu__link, .ps-mainmenu--mobile .menu__list .menu__link {
  flex: 1; display: block; padding: .85rem 0; text-decoration: none; color: #090909;
  font-family: var(--abep-serif, 'Cormorant Garamond', Georgia, serif); font-size: 1.45rem; line-height: 1.1; letter-spacing: 0; text-transform: none; font-weight: 600;
  transition: color .4s, padding-left .4s var(--abep-ease, ease);
}
#header .ps-mainmenu--mobile .menu__list .menu__link:hover, #header .ps-mainmenu--mobile .menu__list li.current > .menu__link,
.ps-mainmenu--mobile .menu__list .menu__link:hover, .ps-mainmenu--mobile .menu__list li.current > .menu__link { color: #BB853B; padding-left: .4rem; }
.ps-mainmenu--mobile .menu__toggle-child { color: #BB853B; }
/* liens personnalisés (Nos réalisations…) en petites capitales */
#header .ps-mainmenu--mobile .menu__list li.type-link .menu__link, .ps-mainmenu--mobile .menu__list li.type-link .menu__link { font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; padding: .8rem 0; font-weight: 500; }
.ps-mainmenu--mobile .ps-mainmenu__additionnals { padding: 1.4rem 1.5rem 2rem; font-size: .8rem; color: rgba(43, 42, 39, .7); }
.ps-mainmenu--mobile .ps-mainmenu__additionnals a { color: #090909; text-decoration: none; font-family: var(--abep-sans, 'Montserrat', Arial, sans-serif); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.ps-mainmenu--mobile .ps-mainmenu__additionnals a:hover { color: #BB853B; }
