/* =========================================================
   Le Borvo — menu au défilement (fond #181a1b)
   Classes posées par le script borvo-menu-scroll.js :
   - html.bv-scrolled : la page a commencé à défiler
   - html.bv-sticky   : (≤ 980 px) l'en-tête est sorti de l'écran,
                        la barre compacte s'affiche
   ========================================================= */

.template-header{
  --bv-menu-fond:#181a1b;
  --bv-ease:cubic-bezier(.2,.7,.2,1);
}
/* Le dégradé sombre placé derrière le menu (300 px de haut) ne doit
   jamais intercepter les clics sur le contenu situé dessous */
.template-header::before{
  pointer-events:none!important;
  transition:opacity .45s ease!important;
}

/* ---------- Ordinateur (≥ 981 px) : le menu est déjà fixé en haut ---------- */
@media (min-width:981px){
  .template-header{
    transition:background-color .45s ease,box-shadow .45s ease!important;
  }
  .template-header-content{
    transition:margin .45s var(--bv-ease)!important;
  }
  .template-header .header-left img{
    transition:height .45s var(--bv-ease),width .45s var(--bv-ease)!important;
  }
  .template-header .websee-megamenu-container,
  .template-header .websee-megamenu{
    transition:margin .45s var(--bv-ease)!important;
  }

  html.bv-scrolled .template-header{
    background-color:var(--bv-menu-fond)!important;
    box-shadow:0 10px 30px rgba(0,0,0,.35)!important;
  }
  /* Le dégradé ne sert plus une fois le fond plein : il disparaît */
  html.bv-scrolled .template-header::before{opacity:0!important}
  /* En-tête resserré : logo réduit, marges réduites */
  html.bv-scrolled .template-header-content{
    margin-top:8px!important;
    margin-bottom:8px!important;
  }
  html.bv-scrolled .template-header .header-left img{
    height:88px!important;
    width:auto!important;
  }
  html.bv-scrolled .template-header .websee-megamenu-container{
    margin-top:0!important;
  }
  html.bv-scrolled .template-header .websee-megamenu{
    margin-top:4px!important;
  }
}

/* ---------- Tablette et mobile (≤ 980 px) : barre compacte ---------- */
@media (max-width:980px){
  .bv-header-espace{display:block}

  html.bv-sticky .template-header{
    position:fixed!important;
    top:0;
    left:0;
    right:0;
    width:100%!important;
    z-index:1000;
    background-color:var(--bv-menu-fond)!important;
    box-shadow:0 8px 24px rgba(0,0,0,.35)!important;
    animation:bvBarreEntree .35s var(--bv-ease) both;
  }
  html.bv-sticky .template-header::before{opacity:0!important}
  html.bv-sticky .template-header-content{
    display:flex!important;
    flex-direction:row!important;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    width:auto!important;
    min-height:64px;
    margin:0!important;
    padding:6px 16px;
    box-sizing:border-box;
  }
  /* Le « clearfix » du thème prendrait une place inutile dans la barre */
  html.bv-sticky .template-header-content::before,
  html.bv-sticky .template-header-content::after{display:none!important}
  html.bv-sticky .template-header .header-left{
    width:auto!important;
    flex:0 1 auto;
    min-width:0;
  }
  html.bv-sticky .template-header .header-left img{
    height:44px!important;
    width:auto!important;
    max-width:100%;
    display:block;
  }
  html.bv-sticky .template-header .header-right{display:none!important}
  html.bv-sticky .template-header .header-center{
    width:auto!important;
    flex:0 0 auto!important;
    margin-left:auto!important;
  }
  html.bv-sticky .template-header .websee-megamenu-container{
    margin:0!important;
    border-top:0!important;
  }
  html.bv-sticky .template-header .websee-megamenu{margin:0!important}
  html.bv-sticky .template-header .websee-megamenu-mobile{
    display:inline-flex!important;
    align-items:center;
    min-height:44px;
    padding:0 4px!important;
  }
  /* Menu ouvert depuis la barre : pleine largeur sous la barre, défilable */
  html.bv-sticky .template-header .websee-megamenu-principal{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    max-height:calc(100vh - 64px);
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    background-color:var(--bv-menu-fond);
    padding:8px 16px 24px;
    box-sizing:border-box;
    box-shadow:0 16px 30px rgba(0,0,0,.35);
  }
}

@keyframes bvBarreEntree{
  from{transform:translateY(-100%)}
  to{transform:translateY(0)}
}

/* ---------- Accessibilité : pas d'animation si l'utilisateur le demande ---------- */
@media (prefers-reduced-motion:reduce){
  .template-header,.template-header *{transition:none!important;animation:none!important}
}
