/* =========================
   MENU MOBILE FULL SCREEN (Divi) — FIX scroll + croix cliquable
   Scope: .byd-header
   Breakpoint hamburger: 1388px
   ========================= */

@media (max-width: 1388px){

  /* Cache desktop / affiche mobile */
  .byd-header .et_pb_menu .et_pb_menu__menu{ display:none !important; }
  .byd-header .et_pb_menu .et_mobile_nav_menu{ display:block !important; }

  /* On sécurise le stacking (important) */
  .byd-header .et_pb_menu{
    position: relative;
    z-index: 1000001;
  }
  .byd-header .et_mobile_nav_menu{
    position: relative;
    z-index: 1000002; /* AU-DESSUS de l’overlay */
  }

  /* Bouton hamburger */
  .byd-header .mobile_menu_bar{
    width: 44px;
    height: 44px;
    position: relative;
    border-radius: 12px;
    background: rgba(0,0,0,.35);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    cursor: pointer;
    z-index: 1000003; /* encore au-dessus */
  }

  /* 3 traits */
  .byd-header .mobile_menu_bar{
    background-image: linear-gradient(#fff,#fff);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 2px;
    transition: background-size .18s ease;
  }

  .byd-header .mobile_menu_bar:before,
  .byd-header .mobile_menu_bar:after{
    content: "";
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: transform .22s ease, top .22s ease;
  }
  .byd-header .mobile_menu_bar:before{ top: 16px; }
  .byd-header .mobile_menu_bar:after{ top: 28px; }

  /* OUVERT = croix */
  .byd-header .mobile_nav.opened .mobile_menu_bar{
    background-size: 0 0;
  }
  .byd-header .mobile_nav.opened .mobile_menu_bar:before{
    top: 22px;
    transform: translateX(-50%) rotate(45deg);
  }
  .byd-header .mobile_nav.opened .mobile_menu_bar:after{
    top: 22px;
    transform: translateX(-50%) rotate(-45deg);
  }

  /* Overlay fullscreen */
  .byd-header .mobile_nav ul.et_mobile_menu,
  .byd-header .mobile_nav ul[id^="mobile_menu"]{
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;

    margin: 0 !important;
    padding: clamp(90px, 12vh, 120px) 24px 34px !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;

    list-style: none !important;
    border: 0 !important;

    background: rgba(0,0,0,.92) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);

    overflow: hidden !important;
    overscroll-behavior: none !important;

    /* fermé par défaut */
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translate3d(0,-10px,0) !important;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s !important;

    z-index: 1000000 !important; /* SOUS le bouton hamburger */
  }

  .byd-header .mobile_nav.opened ul.et_mobile_menu,
  .byd-header .mobile_nav.opened ul[id^="mobile_menu"]{
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translate3d(0,0,0) !important;
    transition: opacity .22s ease, transform .22s ease !important;
  }

  /* Items */
  .byd-header ul.et_mobile_menu li{
    width: 100%;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    list-style: none !important;
  }

  .byd-header ul.et_mobile_menu > li > a{
    display: inline-block !important;
    padding: 10px 10px !important;
    color: rgba(255,255,255,.92) !important;
    font-size: clamp(20px, 3.2vw, 30px) !important;
    line-height: 1.15 !important;
    text-align: center !important;
    background: transparent !important;
    text-decoration: none !important;
  }

  .byd-header ul.et_mobile_menu > li.current-menu-item > a,
  .byd-header ul.et_mobile_menu > li > a:hover{
    color: #e74c32 !important;
  }

  /* Sous-menus */
  .byd-header ul.et_mobile_menu .sub-menu{
    margin: 6px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .byd-header ul.et_mobile_menu .sub-menu li a{
    display: inline-block !important;
    padding: 6px 10px !important;
    font-size: clamp(15px, 2.4vw, 18px) !important;
    color: rgba(255,255,255,.72) !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
  }

  .byd-header ul.et_mobile_menu .sub-menu li a:hover{
    color: rgba(231,76,50,.95) !important;
  }

  /* Bouton Contact (classe sur le LI : btn-contact-menu) */
  .byd-header ul.et_mobile_menu li.btn-contact-menu > a{
    margin-top: 14px !important;
    padding: 14px 28px !important;
    border-radius: 999px !important;
    background: #e74c32 !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.35) !important;
  }
  .byd-header ul.et_mobile_menu li.btn-contact-menu > a:hover{
    background: #cf3f28 !important;
    color:#fff !important;
  }
}

/* Scroll lock (activé par le JS) */
html.byd-menu-open{
  overflow: hidden !important;
  height: 100% !important;
}
html.byd-menu-open body{
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none !important;
}

@media (prefers-reduced-motion: reduce){
  .byd-header .mobile_nav ul.et_mobile_menu{
    transition: none !important;
    transform: none !important;
  }
  .byd-header .mobile_menu_bar:before,
  .byd-header .mobile_menu_bar:after{
    transition: none !important;
  }
}