/* =========================
   Header global
   ========================= */
.header_wrapper {
  background-color: #2e2e2e;
  color: #f0f0f0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}


.header_nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  flex-wrap: wrap;
  background-color: #2e2e2e;
}

/* Logo */
.header_logo img {
  height: 36px;
}

/* Bouton hamburger (mobile) */
.header_toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6em;
  color: #f0f0f0;
  cursor: pointer;
  margin-left: auto;
}

/* Menu principal */
.header_menu {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.header_menu li {
  position: relative;
}

.header_menu a {
  text-decoration: none;
  color: #f0f0f0;
  font-weight: 500;
  padding: 8px 12px;
  display: inline-block;
  transition: color 0.3s ease;
}

.header_menu a:hover {
  color: #ffffff;
}

/* Sous-menu */
.header_submenu ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #3a3a3a;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  min-width: 160px;
  border-radius: 4px;
}

.header_submenu:hover ul,
.header_submenu.active ul {
  display: block;
}

.header_submenu ul li a {
  display: block;
  padding: 8px 16px;
  color: #f0f0f0;
}

.header_submenu ul li a:hover {
  background-color: #505050;
}

/* Avatar (desktop) */
.header_avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ccc;
}

/* =========================
   Admin rouge 👑
   ========================= */
.header_admin > a {
  font-weight: bold;
  color: #ff4d4d;
}

.header_admin > a:hover {
  color: #ff9999;
}

.header_admin ul {
  border-top: 2px solid #ff4d4d;
  background-color: #3a3a3a;
}

.header_admin ul li a {
  color: #ff4d4d;
}

.header_admin ul li a:hover {
  background-color: #663333;
}

/* =========================
   Panier
   ========================= */
.header_cart {
  position: relative;
}

.cart_icon {
  font-size: 24px;
  color: #fff;
}

.cart_badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: red;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  border-radius: 50%;
  padding: 3px 6px;
}

.header_user {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* =========================
   Responsive mobile
   ========================= */
@media (max-width: 768px) {

  .header_nav {
    padding: 8px 14px;
  }

  .header_logo img {
    height: 32px;
  }

  .header_toggle {
    display: block;
  }

  .header_menu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 8px;
    background-color: #2e2e2e;
    border-top: 1px solid #444;
  }

  .header_menu.active {
    display: flex;
  }

  .header_menu li {
    width: 100%;
  }

  .header_menu a {
    display: block;
    padding: 10px;
    border-bottom: 1px solid #444;
  }

  .header_submenu ul {
    position: static;
    box-shadow: none;
    border-top: none;
  }

  .header_submenu ul li a {
    padding: 10px 16px;
  }

  /* ======= Ajustements MOBILE ======= */

  .header_cart .cart_icon {
    font-size: 18px; /* encore plus petit */
  }

  .cart_badge {
    font-size: 9px;
    padding: 2px 4px;
    top: -3px;
    right: -7px;
  }

  .header_user {
    gap: 8px;
    align-items: center;
  }

  .header_user .header_avatar img {
    width: 28px;
    height: 28px;
    border: 1px solid #aaa;
  }
}
