/* Variables globales */
:root {
  --orange-cfdt: #E7591C;
  --bleu-cfdt: #00455E;
  --gris-texte: #555554;
  --gris-clair: #DFE7EC;
  --blanc: #FFFFFF;
}

header {
  width: 100%;
  background-color: var(--blanc);
  font-family: 'Montserrat', sans-serif;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
}

.topbar {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 40px;
  box-sizing: border-box;
}

.logo-link {
  display: inline-block;
  line-height: 0;
}

.logo {
  height: 50px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.logo-link:hover .logo,
.logo-link:focus .logo {
  opacity: 0.8;
}

.menu {
  display: flex;
}

.menu ul {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.menu li {
  margin: 0;
  padding: 0;
}

.menu a {
  text-decoration: none;
  color: var(--gris-texte);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  position: relative;
  display: block;
}

.menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--orange-cfdt);
  transition: width 0.3s ease;
}

.menu a:hover,
.menu a:focus {
  color: var(--orange-cfdt);
}

.menu a:hover::after,
.menu a:focus::after {
  width: 100%;
}

/* Bouton burger - caché par défaut */
#burger {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--orange-cfdt);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  position: fixed;
  top: 15px;
  right: 20px;
  z-index: 9999;
  transition: transform 0.2s ease;
}

#burger:hover {
  transform: scale(1.05);
}

#burger:focus {
  outline: 3px solid var(--bleu-cfdt);
  outline-offset: 2px;
}

#burger span {
  height: 3px;
  width: 24px;
  background: var(--blanc);
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
  pointer-events: none;
}

/* Animation du burger en X */
#burger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#burger.open span:nth-child(2) {
  opacity: 0;
}

#burger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Overlay sombre derrière le menu */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* VERSION MOBILE */
@media (max-width: 768px) {
  /* Afficher le burger sur mobile */
  #burger {
    display: flex !important;
  }

  .topbar {
    padding: 15px 20px;
  }

  .logo {
    height: 40px;
  }

  /* Menu latéral mobile */
  .menu {
    position: fixed;
    right: -100%;
    top: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: var(--blanc);
    box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
    z-index: 999;
    padding: 80px 0 30px 0;
    overflow-y: auto;
  }

  .menu.open {
    right: 0;
  }

  .menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .menu li {
    width: 100%;
  }

  .menu a {
    padding: 18px 30px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--gris-clair);
    color: var(--gris-texte);
    cursor: pointer;
  }

  .menu a::after {
    display: none;
  }

  .menu a:hover,
  .menu a:focus,
  .menu a:active {
    background-color: var(--gris-clair);
    color: var(--orange-cfdt);
  }
}