header {
  background: #fff;
  border-bottom: 1px solid #ccc;
  position: relative;
  z-index: 1000;
}

.header__container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 60px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.left-group {
  display: flex;
  align-items: center;
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #222;
  font-weight: bold;
  font-size: 1.2rem;
}

.logo__image {
  height: 50px;
  margin-right: 8px;
  vertical-align: middle;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin-left: 1rem;
}

nav.main-nav a {
  text-decoration: none;
  color: #222;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-weight: 500;
}

nav.main-nav a:hover {
  background-color: #eee;
}

.right-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

#user-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avatar image */
#user-btn img.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ccc;
  display: block;
  object-fit: cover;
}

/* Initiales affichées quand l'image est absente */
#user-btn .user-initials {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: white;
  background-color: var(--contrast);
  border-radius: 50%;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Masquer l'image si elle ne charge pas */
#user-btn img.user-avatar:not([src]):not([src=""]) {
  display: none;
}



#user-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  min-width: 160px;
  padding: 0.5rem 0;
  list-style: none;
  display: none;
  z-index: 1100;
}

#user-menu[hidden] {
  display: none;
}

#user-menu:not([hidden]) {
  display: block;
}

#user-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  color: #222;
  text-decoration: none;
}

#user-menu li a:hover {
  background-color: #f0f0f0;
}

.btn-login,
.btn-register,
.btn-sponsoring {
  margin-left: 12px;
  padding: 2px 12px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 4px;
  background-color: #ffffff;
  color: #333;
  border: 1px solid #ccc;
  transition: all 0.2s ease-in-out;
}

.btn-sponsoring {
  margin-right: 16px;
  background-color: #c7a303;
  color: white;
}

.btn-login:hover,
.btn-register:hover,
.btn-sponsoring:hover {
  background-color: #f5f5f5;
  color:#000;
}

.auth-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.auth-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

@media screen and (min-width: 769px) {
  .auth-link-hidden {
    display: none;
  }
}

/* Cacher un lien sur petit écran */
@media screen and (max-width: 768px) {
  .mobile-hidden {
    display: none;
  }
}

#burger {
  height: 40px;
  line-height: 40px;
  font-size: 24px;
  /* optionnel, pour éviter que le bouton soit trop large */
  padding: 0 10px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  display: none;
}

/* Drawer mobile */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100vh;
  background: white;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1200;
  padding: 1rem;
}

/* drawer ouvert */
.drawer.open {
  transform: translateX(0);
}

#close-drawer {
  font-weight: bold;
  color: #222;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  font-size: 2rem;
  line-height: 1;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 1150;
  display: none;
}

.overlay.visible {
  display: block;
}

/* Responsive */
.desktop-only {
  display: inline;
}

.mobile-only {
  display: none;
}

@media (max-width: 599px) {
  nav.main-nav {
    display: none;
  }

  #burger {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline-block;
  }
}

/* ======= Sous-menu dans drawer (mobile) ======= */

.drawer .mobile-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer .mobile-menu>li {
  margin-bottom: 1rem;
}

.drawer .has-submenu>.submenu-toggle {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0;
  color: #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer .has-submenu>.submenu-toggle:hover {
  color: #007bff;
}

.drawer .submenu {
  list-style: none;
  padding-left: 1rem;
  margin-top: 0.5rem;
  border-left: 3px solid #007bff;
}

.drawer .submenu li {
  margin-bottom: 0.5rem;
}

.drawer .submenu li a {
  display: block;
  padding: 0.3rem 0.5rem;
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.drawer .submenu li a:hover {
  background-color: #e6f0ff;
}

.footer-links li {
  list-style: none;
  margin-bottom: 0.5rem;
}