.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  padding: 10px 100px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  z-index: 100;
}
.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  pointer-events: none;
}
.header:hover::before {
  left: 100%;
  transition: 2s;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.logo:hover {
  color: #FFBF00;
}
.navbar a {
  color: #fff;
  font-size: 18px;
  text-decoration: none;
  margin-left: 35px;
  min-width: 80px;
  text-align: center;
  display: inline-block;
  transition: color 0.3s;
}
.navbar a:hover {
  color: #FFBF00;
}
.navbar a.active {
  color: #FFBF00;
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
  display: inline-block;
  margin-left: 35px;
}

.nav-dropdown-toggle {
  color: #fff;
  font-size: 18px;
  text-decoration: none;
  min-width: 80px;
  text-align: center;
  display: inline-block;
  transition: color 0.3s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
}

.nav-dropdown-toggle:hover {
  color: #FFBF00;
}

.nav-dropdown-toggle.active {
  color: #FFBF00;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 120px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 8px 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  margin-left: 0;
  min-width: unset;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.nav-dropdown-menu a:hover {
  background: rgba(255, 191, 0, 0.2);
  color: #FFBF00;
}

.nav-dropdown-menu a.active {
  color: #FFBF00;
}

/* Pure-CSS hamburger icon (no external font/CDN). Toggles to an X
   when navbar.js adds the .bx-x class on open. */
#menu-icon {
  display: none;
  position: relative;
  width: 32px;
  height: 24px;
  cursor: pointer;
}
#menu-icon span,
#menu-icon span::before,
#menu-icon span::after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, top 0.3s ease, background 0.3s ease;
}
#menu-icon span {
  top: 50%;
  transform: translateY(-50%);
}
#menu-icon span::before,
#menu-icon span::after {
  content: '';
}
#menu-icon span::before {
  top: -9px;
}
#menu-icon span::after {
  top: 9px;
}
/* Open state: middle bar hidden, outer bars cross into an X */
#menu-icon.bx-x span {
  background: transparent;
}
#menu-icon.bx-x span::before {
  top: 0;
  transform: rotate(45deg);
}
#menu-icon.bx-x span::after {
  top: 0;
  transform: rotate(-45deg);
}
/* BREAKPOINTS */
@media (max-width: 992px) {
  .header {
    padding: 1.25rem 4%;
  }
}
@media (max-width: 768px) {
  #menu-icon {
    display: block;
  }
  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 0.5rem 4%;
    display: none;
  }
  .navbar.active {
    display: block;
  }
  .navbar a {
    display: block;
    margin: 1.5rem 0;
    min-width: unset;
    text-align: left;
  }
  .nav-dropdown {
    display: block;
    margin: 1.5rem 0;
    margin-left: 0;
  }
  .nav-dropdown-toggle {
    text-align: left;
    min-width: unset;
  }
  .nav-dropdown-menu {
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    padding-left: 1rem;
    margin-top: 0.5rem;
  }
  .nav-dropdown-menu a {
    padding: 8px 0;
    margin: 0.5rem 0;
  }
  .nav-bg {
    position: absolute;
    top: 79px;
    left: 0;
    width: 100%;
    height: 295px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 99;
    display: none;
  }
  .nav-bg.active {
    display: block;
  }
}

/* Compensation pour la navbar fixed */
body {
  padding-top: 70px;
}

/* Reserve header space before async loading */
#navbar-placeholder {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 100;
  pointer-events: none;
}

/* Re-enable events on injected header */
.header {
  pointer-events: auto;
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 8px;
  margin-left: 20px;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 6px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.lang-btn.active {
  border-color: #FFBF00;
  background: rgba(255, 255, 255, 0.2);
}

.flag-img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

/* Mobile adjustments for language selector */
@media (max-width: 768px) {
  .language-selector {
    position: absolute;
    top: 50%;
    right: 50px;
    transform: translateY(-50%);
    margin-left: 0;
  }
}

/* Anti-FOUC: Hide translatable elements until i18n is ready */
[data-i18n] {
  visibility: hidden;
}

html.i18n-ready [data-i18n] {
  visibility: visible;
}