/* ==========================================================================
   HEADER - Menu de navigation
   ========================================================================== */

#site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1000;
}

/* Header fixe au scroll */
#site-header.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Logo */
#logo {
  flex-shrink: 0;
}

#logo a {
  display: block;
  line-height: 0;
}

#logo img {
  height: 60px;
  width: auto;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo réduit quand header fixe */
#site-header.fixed-header #logo img {
  height: 40px;
}

/* Navigation principale */
#main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

#main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 40px;
}

#main-nav li {
  position: relative;
}

#main-nav a {
  color: #999;
  text-decoration: none;
  font-size: 16px;
  font-weight: 400;
  transition: color 0.3s ease;
  padding: 10px 0;
  display: block;
}

#main-nav a:hover,
#main-nav .current-menu-item > a {
  color: #333;
}

/* Soulignement pour l'item actif */
#main-nav .current-menu-item > a,
#main-nav .current-page-ancestor > a {
  position: relative;
}

#main-nav .current-menu-item > a::before,
#main-nav .current-page-ancestor > a::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #333;
}

/* Sous-menus - CORRECTION pour le hover */
#main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  padding: 10px 0;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, margin-top 0.3s ease;
}

#main-nav .menu-item-has-children:hover > .sub-menu,
#main-nav .submenu-open > .sub-menu {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0;
}

#main-nav .sub-menu li {
  width: 100%;
}

#main-nav .sub-menu a {
  padding: 12px 20px;
  color: #666;
  white-space: nowrap;
}

#main-nav .sub-menu a:hover {
  background: #f5f5f5;
  color: #333;
}

/* Indicateur pour les items avec sous-menu */
#main-nav .menu-item-has-children {
  position: relative;
}

#main-nav .menu-item-has-children > a {
  padding-right: 30px;
}

/* Flèche comme bouton séparé */
#main-nav .menu-item-has-children .submenu-toggle {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 25px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
  z-index: 10;
}

#main-nav .menu-item-has-children .submenu-toggle:hover {
  color: #333;
}

#main-nav .menu-item-has-children .submenu-toggle::before {
  content: "▾";
}

/* #main-nav .menu-item-has-children>a::after {
    content: '▾';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
} */

/* Langue */
#lang {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#lang img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#lang img:hover {
  transform: scale(1.1);
}

/* Bouton burger (caché par défaut) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 1rem;
  padding: 10px;
  z-index: 1001;
  position: relative;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: #333;
  margin: 5px 0;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================================================
   RESPONSIVE - Mobile (< 767px)
   ========================================================================== */

@media (max-width: 1199px) {
  #site-header {
    padding: 15px 20px;
    flex-wrap: wrap;
  }

  /* Afficher le bouton burger */
  .menu-toggle {
    display: block;
    order: 2;
  }

  #logo {
    order: 1;
  }

  #logo img {
    height: 40px;
  }

  #lang {
    order: 3;
    margin-left: auto;
  }

  /* Navigation mobile - PLEIN ÉCRAN */
  #main-nav {
    order: 4;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding-top: 80px;
    z-index: 999;
  }

  #main-nav.active {
    transform: translateX(0);
  }

  #main-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  #main-nav li {
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  #main-nav a {
    padding: 20px 30px;
    color: #333;
    font-size: 18px;
  }

  #main-nav .menu-item-has-children .submenu-toggle {
    display: none;
  }

  #main-nav .current-menu-item:not(.menu-item-has-children) > a::after {
    display: none;
  }

  /* Sous-menus mobile */
  #main-nav .sub-menu {
    position: static;
    box-shadow: none;
    background: #f9f9f9;
    padding: 0;
    margin: 0;
    display: none;
    opacity: 1;
    pointer-events: auto;
  }

  #main-nav .menu-item-has-children.active > .sub-menu {
    display: block;
  }

  #main-nav .sub-menu a {
    padding-left: 50px;
    font-size: 16px;
  }

  #main-nav .menu-item-has-children > a {
    position: relative;
    padding-right: 50px;
  }

  #main-nav .menu-item-has-children > a::after {
    content: "+";
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 8px;
    transition: transform 0.3s ease;
    font-size: 24px;
    color: var(--white);
    background-color: var(--primary);
  }

  #main-nav .menu-item-has-children.active > a::after {
    content: "−";
  }

  /* Overlay sombre quand le menu est ouvert */
  /* body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
        z-index: 998;
    }

    body.menu-open::before {
        opacity: 1;
        pointer-events: auto;
    }

    body.menu-open {
        overflow: hidden;
    } */
}

/* Tablette */
@media (min-width: 768px) and (max-width: 1024px) {
  #main-nav ul {
    gap: 25px;
  }

  #site-header {
    padding: 20px 30px;
  }
}

@media (min-width: 1200px) {
  #lang .gtranslate_wrapper {
        display: none;
  }
}
