/* PRATINIUM v218 — Stabilisation définitive du header mobile
   Corrige :
   - hamburger et panier qui chevauchaient Acheter / Approuver / Investir ;
   - panneau mobile Devise / Contact masqué par le hero ou les contenus.
   Cette feuille est chargée après v217 et neutralise ses offsets absolus. */

@media (min-width:768px){
  #header .pf-mobile-top-actions,
  #header .pf-mobile-menu-panel-v217{display:none!important;}
}

@media (max-width:767.98px){
  #header,
  #header .header-top,
  #header .pf-header-top-global,
  #header .pf-header-top-global > .container,
  #header .header-top > .container,
  #header .pf-header-row-global{
    overflow:visible!important;
  }

  /* Ligne principale mobile : logo au-dessus, CTAs + recherche en-dessous. */
  #header .header-top.pf-header-top-global > .container,
  #header .header-top > .container,
  #header .pf-header-top-global > .container{
    width:100vw!important;
    max-width:100vw!important;
    margin:0!important;
    padding:0 12px!important;
    box-sizing:border-box!important;
  }

  #header .pf-header-row-global,
  #header .header-top .container .row.pf-header-row-global{
    position:relative!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:14px 0 12px!important;
    gap:10px!important;
    box-sizing:border-box!important;
    transform:none!important;
    left:auto!important;
    right:auto!important;
  }

  #header #_desktop_logo,
  #header .pf-header-logo-global{
    order:1!important;
    position:relative!important;
    z-index:2!important;
    width:100%!important;
    max-width:100%!important;
    min-height:58px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0 auto!important;
    padding:0!important;
    transform:none!important;
    pointer-events:auto!important;
  }

  /* Hamburger + panier : ancrés sur la ligne logo, sans chevauchement des CTAs. */
  #header .pf-mobile-top-actions{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    position:absolute!important;
    top:22px!important;
    left:14px!important;
    right:14px!important;
    bottom:auto!important;
    transform:none!important;
    z-index:20!important;
    width:auto!important;
    height:44px!important;
    pointer-events:none!important;
  }

  #header .pf-mobile-menu-bars,
  #header .pf-mobile-cart-slot{
    pointer-events:auto!important;
    flex:0 0 auto!important;
  }

  #header .pf-mobile-menu-bars{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    margin:0!important;
    border-radius:17px!important;
    border:1px solid rgba(15,103,168,.22)!important;
    background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(235,248,255,.92))!important;
    box-shadow:0 10px 22px rgba(15,42,70,.10), inset 0 1px 0 rgba(255,255,255,.98)!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex-direction:column!important;
    gap:5px!important;
  }

  #header .pf-mobile-menu-bars span{
    width:18px!important;
    height:2px!important;
    border-radius:999px!important;
    background:#0f67a8!important;
  }

  #header .pf-mobile-cart-slot{
    width:auto!important;
    min-width:52px!important;
    height:44px!important;
    min-height:44px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
  }

  #header .pf-mobile-cart-slot .blockcart,
  #header .pf-mobile-cart-slot #_desktop_cart,
  #header .pf-mobile-cart-slot .cart-preview,
  #header .pf-mobile-cart-slot a{
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
    min-width:52px!important;
    padding:0 10px!important;
    margin:0!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    border-radius:999px!important;
    border:1px solid rgba(242,169,0,.24)!important;
    background:linear-gradient(180deg,rgba(255,248,232,.96),rgba(255,255,255,.94))!important;
    box-shadow:0 10px 22px rgba(242,169,0,.08), inset 0 1px 0 rgba(255,255,255,.96)!important;
    color:#2e3543!important;
    font-size:13px!important;
    font-weight:800!important;
    line-height:1!important;
    white-space:nowrap!important;
    text-decoration:none!important;
  }

  #header .pf-mobile-cart-slot .material-icons,
  #header .pf-mobile-cart-slot i{
    color:#d89400!important;
    font-size:19px!important;
    line-height:1!important;
    margin:0!important;
  }

  /* Sur mobile étroit, on évite que le libellé panier prenne trop de place. */
  @media (max-width:420px){
    #header .pf-mobile-cart-slot .cart-products-count,
    #header .pf-mobile-cart-slot .cart-products-label,
    #header .pf-mobile-cart-slot .cart-label,
    #header .pf-mobile-cart-slot .hidden-sm-down,
    #header .pf-mobile-cart-slot .hidden-xs-down,
    #header .pf-mobile-cart-slot span:not(.material-icons):not(.cart-products-count){
      font-size:0!important;
      line-height:0!important;
    }
    #header .pf-mobile-cart-slot .cart-products-count{
      font-size:13px!important;
      line-height:1!important;
    }
  }

  /* CTAs + recherche : bloc séparé, jamais sous hamburger / panier. */
  #header .pf-header-centerline{
    order:2!important;
    position:relative!important;
    z-index:3!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    width:min(332px, calc(100vw - 36px))!important;
    max-width:min(332px, calc(100vw - 36px))!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:0!important;
    gap:9px!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    box-sizing:border-box!important;
  }

  #header .pf-header-centerline .pf-header-ctas,
  #header .pf-header-ctas{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:0!important;
    box-sizing:border-box!important;
  }

  #header .pf-header-centerline .pf-btn{
    min-width:0!important;
    width:100%!important;
    height:42px!important;
    min-height:42px!important;
    padding:0 4px!important;
    font-size:13px!important;
    line-height:1!important;
  }

  #header .pf-header-centerline #search_widget,
  #header .pf-header-centerline #_desktop_search,
  #header .pf-header-centerline .search-widget,
  #header .pf-header-centerline #search_widget form,
  #header .pf-header-centerline #_desktop_search form,
  #header .pf-header-centerline .search-widget form{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0 auto!important;
    box-sizing:border-box!important;
  }

  /* Panneau mobile : dans le flux, sous la recherche, donc jamais caché par le hero. */
  #header .pf-mobile-menu-panel-v217{
    order:3!important;
    position:relative!important;
    display:none!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    z-index:1000!important;
    width:min(332px, calc(100vw - 36px))!important;
    max-width:min(332px, calc(100vw - 36px))!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:10px!important;
    border-radius:18px!important;
    border:1px solid rgba(205,218,232,.70)!important;
    background:linear-gradient(135deg,rgba(255,255,255,.99),rgba(235,248,255,.96) 55%,rgba(255,248,232,.94))!important;
    box-shadow:0 16px 34px rgba(8,22,47,.12), inset 0 1px 0 rgba(255,255,255,.96)!important;
    box-sizing:border-box!important;
    clear:both!important;
  }

  #header .pf-mobile-menu-panel-v217.is-open{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:center!important;
    gap:8px!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }

  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item,
  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item a,
  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item .currency-selector,
  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item #_desktop_currency_selector,
  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item button,
  #header .pf-mobile-menu-panel-v217 .pf-mobile-panel-item .dropdown-toggle{
    width:100%!important;
    min-height:40px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:0!important;
    padding:0 12px!important;
    border-radius:999px!important;
    border:1px solid rgba(15,103,168,.14)!important;
    background:rgba(255,255,255,.90)!important;
    color:#243044!important;
    font-size:14px!important;
    font-weight:800!important;
    line-height:1.1!important;
    text-decoration:none!important;
    white-space:nowrap!important;
    box-sizing:border-box!important;
  }

  /* Les menus déroulants de devise restent masqués tant qu'ils ne sont pas réellement ouverts. */
  #header .pf-mobile-menu-panel-v217 .currency-selector .dropdown-menu:not(.show),
  #header .pf-mobile-menu-panel-v217 #_desktop_currency_selector .dropdown-menu:not(.show),
  #header .pf-mobile-menu-panel-v217 .currency-selector ul:not(.show),
  #header .pf-mobile-menu-panel-v217 #_desktop_currency_selector ul:not(.show){
    display:none!important;
    visibility:hidden!important;
    height:0!important;
    max-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }

  #header .pf-mobile-menu-panel-v217 .currency-selector .dropdown-menu.show,
  #header .pf-mobile-menu-panel-v217 #_desktop_currency_selector .dropdown-menu.show,
  #header .pf-mobile-menu-panel-v217 .currency-selector ul.show,
  #header .pf-mobile-menu-panel-v217 #_desktop_currency_selector ul.show{
    display:block!important;
    position:static!important;
    width:100%!important;
    min-width:0!important;
    margin:8px 0 0!important;
    padding:6px!important;
    border-radius:14px!important;
    background:#fff!important;
    box-shadow:0 12px 24px rgba(15,42,70,.10)!important;
    visibility:visible!important;
    height:auto!important;
    max-height:none!important;
  }
}
