/* ===== HEADER PRINCIPAL ===== */
#header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 900;
  border-bottom: 1px solid #e3e5e7;
}

#header .container {
  max-width: 1320px;
  height: 62px;
  margin: auto;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Logo */
#header .logo img {
  height: 42px;
}

/* Burger menu (mobile) */
#header .burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
}
#header .burger div {
  width: 100%;
  height: 3px;
  background: #333;
  border-radius: 2px;
}

/* Menu desktop */
#header .menu-desktop {
  display: flex;
  align-items: center;
}
#header .menu-desktop > div {
  position: relative;
  margin-left: 20px;
}
#header .menu-desktop a {
  color: #5e5e5e;
  font-size: 14px;
  text-decoration: none;
  padding: 4px 5px;
  transition: color 0.18s;
}
#header .menu-desktop a:hover {
  color: #305c7c;
}

#header .menu-desktop .has-submenu {
  position: relative;
}
#header .menu-desktop .has-submenu .submenu {
  display: none;
  position: absolute;
  top: 115%;
  left: 0;
  min-width: 300px;
  background: #fff;
  border: 1px solid #e7eaf2;
  border-radius: 7px;
  box-shadow: 0 4px 16px 0 rgba(40,60,110,0.07);
  z-index: 900;
  padding: 6px 0;
  transition: box-shadow .18s;
}
#header .menu-desktop .has-submenu:hover .submenu,
#header .menu-desktop .has-submenu:focus-within .submenu {
  display: block;
}
#header .menu-desktop .submenu a {
  display: block;
  padding: 8px 22px 8px 18px;
  color: #2b3a50;
  background: none;
  border: none;
  text-align: left;
  border-radius: 4px;
  font-size: 1em;
  font-weight: 500;
  transition: background .13s, color .13s, padding .12s;
  position: relative;
  margin: 0;
  letter-spacing: 0.02em;
}
#header .menu-desktop .submenu a:hover,
#header .menu-desktop .submenu a:focus {
  background: #f2f6fc;
  color: #194274;
  padding-left: 25px;
}

/* ============================================================
   ✅ AJOUT : SOUS-SOUS-MENU (3e niveau) DESKTOP
   - ne change rien au comportement existant
   ============================================================ */
#header .menu-desktop .submenu .has-submenu{
  position: relative;
}

/* Sous-sous-menu : s’ouvre à droite */
#header .menu-desktop .submenu .has-submenu > .submenu{
  display:none;
  position:absolute;
  top:-6px;
  left:100%;
  min-width: 280px;
  background:#fff;
  border:1px solid #e7eaf2;
  border-radius:7px;
  box-shadow:0 4px 16px 0 rgba(40,60,110,0.07);
  z-index: 901;
  padding:6px 0;
}

/* Affichage au hover / focus */
#header .menu-desktop .submenu .has-submenu:hover > .submenu,
#header .menu-desktop .submenu .has-submenu:focus-within > .submenu{
  display:block;
}

/* Petite flèche indicatrice */
#header .menu-desktop .submenu .has-submenu > a{
  padding-right: 34px;
}
#header .menu-desktop .submenu .has-submenu > a::after{
  content:"›";
  position:absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color:#6b7a90;
  font-size:16px;
  opacity:.9;
}

/* Sidebar mobile */
.msidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #fff;
  padding: 20px;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 950;
}
.msidebar.active {
  transform: translateX(0);
}
.msidebar .has-submenu > a {
  display: block;
  padding: 10px 0;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #e3e5e7;
}
.msidebar .submenu {
  display: none;
  padding-left: 15px;
}
.msidebar .has-submenu.active .submenu {
  display: block;
}
.msidebar a {
  color: #333;
  text-decoration: none;
}
.msidebar a:hover {
  color: #305c7c;
}
.msidebar .submenu a {
  font-size: 14px;
  color: #466278;
  padding: 8px 10px;
  border-radius: 0;
  background: none;
  transition: background 0.18s;
}
.msidebar .submenu a:hover {
  background: #f3f6fa;
  color: #29455d;
}

/* ============================================================
   ✅ AJOUT : SOUS-SOUS-MENU (3e niveau) MOBILE
   - garde ta logique: .has-submenu.active .submenu { display:block; }
   ============================================================ */
.msidebar .submenu .submenu{
  display:none;
  padding-left: 15px;
}
.msidebar .submenu .has-submenu.active > .submenu{
  display:block;
}

/* ===== RÉACTIVATION DU BURGER ET CACHER LE MENU DESKTOP SUR MOBILE ===== */
@media (max-width: 992px) {
  #header .menu-desktop {
    display: none;
  }
  #header .burger {
    display: flex;
  }
}

/* ===== CACHER LA SIDEBAR EN DESKTOP ===== */
@media (min-width: 993px) {
  .msidebar {
    display: none;
  }
}