/* Overlay de fond pour le menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Positionnement initial du menu principal */
  #_desktop_top_menu {
    position: relative;
    z-index: 10;
  }
  
  /* Style de base pour les sous-menus */
  .submenu-container {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    background-color: #fff;
    width: auto;
    transition: opacity 0.1s ease;
  }
  
  /* Animation d'ouverture pour les sous-menus de premier niveau (de haut en bas) */
  .submenu-container.depth-0.open {
    opacity: 1;
    visibility: visible;
  }

  .top-menu .category.has-children:last-child .submenu-container.depth-0.open {
    left: auto;
    right: 0;
  }
  
  /* Style pour les sous-menus de deuxième niveau */
  .submenu-container.depth-1 {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    transform: translateX(-20px);
    opacity: 0;
    visibility: hidden;
    border: 1px solid #DAE0E5;
    transition: transform 0.4s ease;
  }
  
  /* Animation d'ouverture pour les sous-menus de deuxième niveau (de gauche à droite) */
  .submenu-container.depth-1.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }
  
  /* Style pour les éléments avec enfants */
  .top-menu .has-children {
    position: relative;
  }
  
  .top-menu[data-depth="1"] .has-children > a::after,
  .top-menu[data-depth="2"] .has-children > a::after,
  .top-menu[data-depth="3"] .has-children > a::after {
      content: '\E315';
      font-family: 'Material Icons';
      font-size: 16px;
      margin-left: 5px;
      vertical-align: middle;
      position: relative;;
      bottom: 2.5px;
      display: block;
      width: 10px;
      height: 18px;
  }

  .category.has-children a {
    display: flex;
    justify-content: space-between;
  }
  
  /* Améliorations visuelles pour les éléments du menu */
  .top-menu[data-depth="0"] > li > a {
    font-weight: 600;
    padding: 15px 20px;
    display: block;
  }
  
  .top-menu a {
    color: #232323;
    text-decoration: none;
    display: block;
    padding: 8px 15px;
    transition: background-color 0.2s ease;
  }
  
  .top-menu a:hover {
    background-color: #f1f4f9;
  }
  
  /* Ajustement pour les icônes de flèche mobile (cacher en desktop) */
  @media (min-width: 768px) {
    .navbar-toggler.collapse-icons {
      display: none;
    }
  }
  
  /* Ajustements de positionnement pour les sous-menus profonds */
  .submenu-container.depth-1 .has-children > .submenu-container {
    top: 0;
    left: 100%;
  }
  
  /* Style pour le sous-menu actif */
  .top-menu .current > a {
    font-weight: bold;
    color: #2fb5d2;
  }

  /* Zone sécurisée invisible pour améliorer l'expérience utilisateur */
.submenu-safe-zone {
    position: absolute;
    height: 10px;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 9;
    /* Invisible pour l'utilisateur */
    opacity: 0;
    pointer-events: auto; /* Doit détecter les événements de souris */
}

#header  a:hover {
    color: #A7190F;
}

/* Affichage du troisième niveau au survol du deuxième niveau */
#_desktop_top_menu .top-menu[data-depth="1"] > li:hover > .submenu-container.depth-1 {
  display: block;
}

.top-menu[data-depth="1"],
.top-menu[data-depth="2"] {
    margin: 0;
    padding: 10px;
}


.top-menu .sub-menu ul[data-depth="1"] > li {
    float: none;
    margin: 0;
}

.top-menu .sub-menu {
    box-shadow: none;
}

/* Deuxième niveau - sous-menu normal */
#_desktop_top_menu .top-menu .submenu-container.depth-0 {
    width: fit-content;
    min-width: 0;
    margin-left: 0;
    min-width: 100%;
    border: 1px solid #DAE0E5;
    padding: 0;
}

.top-menu a.dropdown-submenu {
	font-weight: 500;
	color: rgba(13, 19, 35, 0.85);
	font-size: 1.2rem;
	letter-spacing: 0.04px;
}

.top-menu a:not([data-depth="0"]) {
    padding: 4px 12px;
	font-weight: 500;
	color: rgba(13, 19, 35, 0.85);
	font-size: 1.2rem;
	letter-spacing: 0.04px;
    text-transform: uppercase;
}

.category.has-children > a.dropdown-item {
    padding: 4px 12px 4px;
    position: relative;
}

@media (max-width: 1199px) {

    .top-menu a:not([data-depth="0"]) {
        font-size: 1.1rem;
    }
}

@media (max-width: 991px) {

    .top-menu[data-depth="1"] {
        padding: 0;
    }

    .category.has-children > a.dropdown-item {
        padding: 8px 20px;
    }

    .top-menu .sub-menu {
        width: 100%;
        min-width: 100%;
        margin-left: 0;
    }

    .top-menu[data-depth="1"] .has-children > a::after,
    .top-menu[data-depth="2"] .has-children > a::after,
    .top-menu[data-depth="3"] .has-children > a::after {
        display: none;
    }

    .top-menu .dropdown-item {
        border: none;
    }

    .mobile-menu-content .top-menu .category.has-children li:last-child {
        border-bottom: none;
    }

    .top-menu[data-depth="2"] {
        padding: 0;
    }

    .mobile-menu-content .submenu-container .submenu-container .top-menu a {
        padding-left: 34px;
        font-size: 1rem;
    }

    .mobile-menu-content .top-menu .category.has-children .submenu-container.depth-1 li:first-child {
        border-top: 1px solid #0D1323;
    }

    .mobile-menu__account-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: white;
        border-bottom: 1px solid white;
        padding: 10px 20px;
        font-size: 1rem;
        text-transform: uppercase;
        font-weight: 500;
        background-color: #0c0d1f;
    }

    .mobile-menu__account-link {
        display: flex;
        gap: 0 5px;
        align-items: center;
    }

    .mobile-menu__account-link img {
        width: 18px;
    }

    .mobile-menu__logout-link {
        display: flex;
        gap: 0 5px;
        align-items: center;
    }

    .mobile-menu__logout-link i.material-icons {
        width: 18px;
        font-size: 2rem;
        position: relative;
        top: 0.5px;
    }

    .mobile-menu-content > .top-menu > .category.has-children:last-child {
        border-bottom: 1px solid #fff;
    }

}