/* Reset et box-sizing global */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-image: linear-gradient(273deg, #577ded, #1e1c70);
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

/* === HEADER & NAVIGATION === */
header {
  background-color: transparent;
  position: relative;
  z-index: 1000;
}

.header-top {
  max-width: 1050px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  position: relative;
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo {
  max-width: 160px;
  height: auto;
}

.logo:hover {
  transform: scale(1.05);
}

/* Contact texte */
.contact-text {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  flex: 1;
  margin: 0 20px;
}

.contact-phone {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-phone:hover {
  color: #ff291e;
  text-decoration: underline;
}

/* Boutons */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  background-color: #2b29a1;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  position: relative;
  text-decoration: none;
}

.btn-icon:hover {
  background-color: #4040db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-icon:active {
  background-color: #6200ea;
  transform: translateY(0);
}

.btn-icon i {
  font-size: 16px;
}

/* Bouton panier spécifique */
.btn-icon.cart-btn {
  position: relative;
}

/* Bulle compteur */
.cart-count-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #ff3b3b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  line-height: 14px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger Icon Animation */
.hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  transform: rotate(0deg);
  transition: 0.3s ease-in-out;
}

.hamburger-icon span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.3s ease-in-out;
}

.hamburger-icon span:nth-child(1) {
  top: 0px;
}

.hamburger-icon span:nth-child(2) {
  top: 7px;
}

.hamburger-icon span:nth-child(3) {
  top: 14px;
}

/* Animation pour transformer en X */
.hamburger-btn.active .hamburger-icon span:nth-child(1) {
  top: 7px;
  transform: rotate(135deg);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
  top: 7px;
  transform: rotate(-135deg);
}

/* Navigation principale */
nav#mainNav {
  max-width: 1040px;
  margin: 0 auto 30px;
  background-color: transparent;
}

nav#mainNav ul {
  list-style: none;
  display: flex;
  gap: 0px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link:hover {
  color: #ff291e;
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-link i {
  font-size: 16px;
  transition: transform 0.3s ease;
}

.nav-link:hover i {
  transform: scale(1.2);
}

/* === DROPDOWN STYLES === */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  justify-content: space-between;
  width: 100%;
}

.dropdown-arrow {
  font-size: 12px !important;
  margin-left: auto;
  transition: transform 0.3s ease;
}

.dropdown-arrow.rotated {
  transform: rotate(180deg);
}
.dropdown-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  background-color: transparent;
  backdrop-filter: blur(10px);
  border-radius: 8px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform: translateY(-10px);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* ← Fait que les enfants occupent toute la largeur */
  width: 100%;
}

.dropdown-menu:not(.show) .dropdown-link {
  margin-bottom: 0;
  padding: 0;
  border: none;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.dropdown-menu.show .dropdown-link {
  height: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  margin-bottom: 0.5em;
  padding: 0.5em 1em;
  border: none;
}

.dropdown-menu:not(.show) {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.dropdown-menu.show {
  height: auto !important;     /* hauteur automatique selon le contenu */
  max-height: none !important; /* enlever limite max */
  overflow: visible !important; /* pas de scroll, tout s'affiche */
  transform: translateY(0);
  opacity: 1;
}

.dropdown-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateX(0); /* ← Supprime le décalage droite */
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;

  width: 100%;              /* ← Occupe toute la largeur */
  box-sizing: border-box;   /* ← Respecte padding/border dans largeur */
  text-align: left;         /* ← Aligne le texte à gauche */
}

.dropdown-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.dropdown-link i {
  font-size: 14px;
  color: white;
  transition: all 0.3s ease;
}

/* Header du menu mobile */
.mobile-menu-header {
  display: none;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-logo {
  max-width: 120px;
  height: auto;
}

.mobile-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.mobile-close-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Overlay pour mobile */
.mobile-overlay {
  display: none;
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  .header-top {
    padding: 12px 15px;
  }
  
  .contact-text {
    font-size: 13px;
    margin: 0 15px;
  }
  
  nav#mainNav ul {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .header-top {
    /* Maintenir sur une seule ligne */
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
  }

  .logo {
    max-width: 100px; /* Réduire la taille du logo */
  }

  .contact-text {
    /* Masquer le texte de contact sur mobile très petit */
    display: none;
  }

  .btn-icon {
    font-size: 12px;
    padding: 8px 12px;
    gap: 6px;
  }

  .btn-icon i {
    font-size: 14px;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Menu mobile */
  nav#mainNav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 400px;
    height: 100vh;
    background: linear-gradient(180deg, #2b29a1 0%, #1e1c70 100%);
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin: 0;
    padding: 0;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    overflow-y: auto;
  }

  nav#mainNav.show {
    right: 0;
    width: 400px;
  }

  .mobile-menu-header {
    display: flex;
  }

  nav#mainNav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 20px 20px;
  }

  .nav-link {
    padding: 16px 20px;
    font-size: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.5s ease forwards;
  }

  /* Styles spécifiques pour le dropdown toggle en mobile */
  .dropdown-toggle {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(0);
  }

  /* Dropdown menu en mobile */
  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0;
    border-radius: 0 0 12px 12px;
    border-top: none;
  }

  .dropdown-menu.show {
    max-height: 300px;
  }

  .dropdown-link {
    margin: 2px 4px;
    font-size: 15px;
    padding: 10px 16px;
  }

  .nav-link:nth-child(1) { animation-delay: 0.1s; }
  .nav-link:nth-child(2) { animation-delay: 0.2s; }
  .nav-dropdown:nth-child(3) .nav-link { animation-delay: 0.3s; }
  .nav-link:nth-child(4) { animation-delay: 0.4s; }
  .nav-link:nth-child(5) { animation-delay: 0.5s; }
  .nav-link:nth-child(6) { animation-delay: 0.6s; }
  .nav-link:nth-child(7) { animation-delay: 0.7s; }

  @keyframes slideInRight {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
  }

  .nav-link i {
    font-size: 18px;
  }

  /* Fermer le menu en cliquant sur l'overlay */
  .mobile-overlay {
    display: block;
  }
}

@media (max-width: 480px) {
  .header-top {
    padding: 10px 12px;
  }

  .logo {
    max-width: 120px; /* Encore plus petit sur très petit écran */
  }

  .header-right {
    gap: 8px;
  }

  .btn-icon {
    padding: 6px 8px;
    font-size: 11px;
  }

  .btn-icon i {
    font-size: 20px;
  }

  /* Masquer le texte des boutons sur très petit écran */
  .btn-icon span:not(.cart-count-badge) {
    display: none;
  }

  nav#mainNav {
    width: 300px;
  }

  .nav-link {
    font-size: 15px;
    padding: 14px 18px;
  }

  .dropdown-link {
    font-size: 14px;
    padding: 8px 14px;
  }

  .cart-count-badge {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    top: -6px;
    right: -6px;
  }

  .mobile-menu-header {
    padding: 15px;
  }

  .mobile-menu-logo {
    max-width: 100px;
  }
}

@media (min-width: 769px) {
  .nav-dropdown .dropdown-menu {
    display: none !important;
  }

  .dropdown-arrow {
    display: none !important;
  }
}

/* Ajout d'une media query pour très petit écran */
@media (max-width: 360px) {
  .btn-icon {
    padding: 5px 6px;
  }
  
  .hamburger-btn {
    width: 36px;
    height: 36px;
  }
  
  .logo {
    max-width: 120px;
  }
}

/* Amélioration des transitions */
* {
  -webkit-tap-highlight-color: transparent;
}

button, a {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}