/* ===============================
   Styles améliorés pour la navigation secondaire mobile
   Adaptés pour correspondre au style du mega menu mobile
   =============================== */

/* Style de base pour la ligne d'en-tête du menu mobile */
.navigation-secondaire.mobile-only .menu-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #2c3e50, #4a6491); /* Même dégradé que le mega menu */
  padding: 10px 15px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  color: white;
  margin-top: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1101; /* Au-dessus de la navigation principale */
}

/* Bouton "M" (menu) */
.navigation-secondaire.mobile-only .bouton-menu {
  background-color: rgba(59, 89, 152, 0.2) !important; /* Fond semi-transparent gris-bleu */
  color: #ffffff !important;
  border: none !important;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Boutons icônes (Accueil et Favoris) */
.navigation-secondaire.mobile-only .icones-navigation-mobile button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Bouton du panier mobile */
.navigation-secondaire.mobile-only .panier-container-mobile .icone-panier-mobile {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Bouton de fermeture du menu mobile */
.navigation-secondaire.mobile-only .close-menu {
  background-color: rgba(59, 89, 152, 0.2) !important; /* Fond semi-transparent gris-bleu */
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-size: 1.2rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Hover et focus commun à tous les boutons de cette section sauf M et fermeture */
.navigation-secondaire.mobile-only .menu-header-line button:not(.bouton-menu):not(.close-menu):hover,
.navigation-secondaire.mobile-only .menu-header-line button:not(.bouton-menu):not(.close-menu):focus {
  transform: scale(1.05);
  outline: none;
  background: rgba(255, 255, 255, 0.2);
}

/* Hover spécifique pour le bouton M et le bouton de fermeture */
.navigation-secondaire.mobile-only .bouton-menu:hover,
.navigation-secondaire.mobile-only .bouton-menu:focus,
.navigation-secondaire.mobile-only .close-menu:hover,
.navigation-secondaire.mobile-only .close-menu:focus {
  color: #ffffff !important;
  background-color: rgba(59, 89, 152, 0.3) !important; /* Légèrement plus opaque au survol */
  border: none !important;
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Annuler le scale spécifiquement pour le bouton M au survol/focus */
.navigation-secondaire.mobile-only .bouton-menu:hover,
.navigation-secondaire.mobile-only .bouton-menu:focus {
  transform: none; /* Empêche le changement de taille */
}


/* Style du badge dans le bouton panier */
.navigation-secondaire.mobile-only .badge,
#badge-panier-mobile {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c; /* Rouge pour le badge */
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

/* Masquer le badge s'il est vide */
#badge-panier-mobile:empty {
  display: none;
}

/* Animation pop pour le badge lors de l'ajout d'un article */
@keyframes pop {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.badge-pop {
  animation: pop 0.3s ease-in-out;
}

/* Masquer le bouton toggle widget quand le menu mobile est ouvert */
body.menu-mobile-ouvert .bouton-toggle-widget {
  display: none !important;
}

/* Animations supplémentaires */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 0.3s ease;
}

/* Style pour l'effet tactile */
.touch-active {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(0.95) !important;
}

/* Annuler le scale pour le bouton M lors de l'effet tactile */
.navigation-secondaire.mobile-only .bouton-menu.touch-active {
    transform: none !important; /* Empêche le changement de taille */
}

/* Annuler le scale pour le bouton M lors de l'animation pulse */
.navigation-secondaire.mobile-only .bouton-menu.pulse {
    animation: none; /* Désactive l'animation pulse */
    /* Ou si vous voulez garder l'animation mais sans scale : */
    /* animation-name: pulse-no-scale; */
    /* animation-duration: 0.3s; */
    /* animation-timing-function: ease; */
}


/* Animations pour le mega menu */
.menu-opening {
  animation: slideIn 0.3s ease;
}

.menu-closing {
  animation: slideOut 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(-10%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-10%); opacity: 0; }
}

/* Styles pour les tablettes */
@media (min-width: 481px) and (max-width: 1023.98px) {
  .navigation-secondaire.mobile-only .menu-header-line {
    padding: 12px 18px;
  }

  .navigation-secondaire.mobile-only .bouton-menu,
  .navigation-secondaire.mobile-only .icones-navigation-mobile button,
  .navigation-secondaire.mobile-only .panier-container-mobile .icone-panier-mobile,
  .navigation-secondaire.mobile-only .close-menu {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
  }
}

/* Styles pour les petits écrans */
@media (max-width: 480px) {
  .navigation-secondaire.mobile-only .menu-header-line {
    padding: 8px 12px;
  }

  .navigation-secondaire.mobile-only .icones-navigation-mobile {
    gap: 10px;
  }

  .navigation-secondaire.mobile-only .bouton-menu,
  .navigation-secondaire.mobile-only .icones-navigation-mobile button,
  .navigation-secondaire.mobile-only .panier-container-mobile .icone-panier-mobile,
  .navigation-secondaire.mobile-only .close-menu {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .navigation-secondaire.mobile-only .badge,
  #badge-panier-mobile {
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
  }
}
