/* =====================================================================
   ABEP — en-tête (templates/_partials/header.tpl)
   Habille le menu PrestaShop (module ps_mainmenu, liens gérés dans le BO) et la recherche (ps_searchbar).
   Variables : custom.css (--abep-noir, --abep-ivoire, --abep-bronze, --abep-anthracite, --abep-hairline, --abep-ease, --abep-sans, --abep-serif)
   ===================================================================== */

/* ---------- barre haute ---------- */
.abep-topbar {
  background: var(--abep-noir, #181816);
  color: rgba(245, 242, 235, .72);
  font-family: var(--abep-sans, system-ui, 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; overflow: hidden; text-overflow: ellipsis; }
.abep-topbar__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--abep-bronze, #B49A6A); box-shadow: 0 0 0 3px rgba(180,154,106,.22); flex: none; }
.abep-topbar__sep { opacity: .4; }
.abep-topbar__right { display: flex; align-items: center; gap: 1.6rem; }
.abep-topbar a { color: rgba(245, 242, 235, .78); text-decoration: none; transition: color .4s var(--abep-ease, ease); }
.abep-topbar a:hover { color: var(--abep-bronze, #B49A6A); }
.abep-topbar__tel { display: inline-flex; align-items: center; gap: .5rem; letter-spacing: .12em; }
.abep-topbar__tel svg { width: 13px; height: 13px; fill: none; stroke: var(--abep-bronze, #B49A6A); 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(245,242,235,.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: var(--abep-bronze, #B49A6A); }
.abep-topbar .header-block__icon { font-size: 17px; color: var(--abep-bronze, #B49A6A); }
.abep-topbar .header-block__title { color: inherit; font-size: inherit; letter-spacing: inherit; }
.abep-topbar .header-block__badge {
  background: var(--abep-bronze, #B49A6A); color: var(--abep-noir, #181816); 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 ---------- */
/* custom.css pose backdrop-filter sur header#header : cela « capture » les éléments position:fixed (panneau mobile du menu) → on le déplace sur la barre */
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; }
.abep-mainbar { padding: 0; background: rgba(245, 242, 235, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--abep-hairline, rgba(24,24,22,.08)); }
.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, system-ui, sans-serif); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 400;
  color: var(--abep-anthracite, #292826); 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: var(--abep-bronze, #B49A6A); 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: var(--abep-bronze, #B49A6A); }
.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: var(--abep-bronze, #B49A6A); }
/* 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 var(--abep-hairline, rgba(24,24,22,.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: var(--abep-bronze, #B49A6A);
  -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: var(--abep-ivoire, #F5F2EB); border-top: 1px solid var(--abep-hairline, rgba(24,24,22,.1)); box-shadow: 0 30px 60px -30px rgba(24,24,22,.3); }

/* ---------- 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: var(--abep-bronze, #B49A6A); background: #fff; cursor: text; }
.abep-mainbar__hook .ps-searchbar__magnifier { position: static; font-size: 19px; color: var(--abep-bronze, #B49A6A); 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, system-ui, sans-serif); color: var(--abep-anthracite, #292826); 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(41,40,38,.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: var(--abep-anthracite, #292826); }
.abep-mainbar__hook .ps-searchbar__clear .material-icons { font-size: 16px; }
.abep-mainbar__hook .ps-searchbar__dropdown { right: 0; left: auto; min-width: 380px; }

/* ---------- 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: var(--abep-noir, #181816); color: var(--abep-ivoire, #F5F2EB);
  font-family: var(--abep-sans, system-ui, 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: var(--abep-bronze, #B49A6A); color: var(--abep-noir, #181816); transform: translateY(-1px); box-shadow: 0 14px 30px -14px rgba(180,154,106,.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: var(--abep-noir, #181816); 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: var(--abep-bronze, #B49A6A); color: var(--abep-noir, #181816);
  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é */
@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-link { padding: .5rem .5rem; font-size: .64rem; letter-spacing: .08em; }
  .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: var(--abep-noir, #181816); 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) ---------- */
.ps-mainmenu--mobile { --bs-offcanvas-width: min(88vw, 400px); background: var(--abep-ivoire, #F5F2EB) !important; color: var(--abep-anthracite, #292826); border-right: 1px solid var(--abep-hairline, rgba(24,24,22,.1)); }
.ps-mainmenu--mobile .offcanvas-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--abep-hairline, rgba(24,24,22,.1)); min-height: 64px; }
.ps-mainmenu--mobile .js-back-button { font-family: var(--abep-sans, system-ui, sans-serif); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--abep-bronze, #B49A6A); }
.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 var(--abep-hairline, rgba(24,24,22,.08)); display: flex; align-items: center; }
.ps-mainmenu--mobile .menu__title { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--abep-bronze, #B49A6A); padding: .4rem 0 .8rem; border-bottom: 0 !important; }
.ps-mainmenu--mobile .menu__link {
  flex: 1; display: block; padding: .85rem 0; text-decoration: none; color: var(--abep-noir, #181816);
  font-family: var(--abep-serif, Georgia, serif); font-size: 1.45rem; line-height: 1.1; transition: color .4s, padding-left .4s var(--abep-ease, ease);
}
.ps-mainmenu--mobile .menu__link:hover, .ps-mainmenu--mobile li.current > .menu__link { color: var(--abep-bronze, #B49A6A); padding-left: .4rem; }
.ps-mainmenu--mobile .menu__toggle-child { color: var(--abep-bronze, #B49A6A); }
/* liens personnalisés (Nos réalisations…) en petites capitales */
.ps-mainmenu--mobile li.type-link .menu__link { font-family: var(--abep-sans, system-ui, sans-serif); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; padding: .8rem 0; }
.ps-mainmenu--mobile .ps-mainmenu__additionnals { padding: 1.4rem 1.5rem 2rem; font-size: .8rem; color: rgba(41,40,38,.7); }
.ps-mainmenu--mobile .ps-mainmenu__additionnals a { color: var(--abep-noir, #181816); text-decoration: none; font-family: var(--abep-sans, system-ui, sans-serif); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; }
.ps-mainmenu--mobile .ps-mainmenu__additionnals a:hover { color: var(--abep-bronze, #B49A6A); }
