/* Animation pour la navbar */

/* Animation d'apparition lors du chargement de la page */
@keyframes navbarFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar {
    animation: navbarFadeIn 0.5s ease forwards;
}

/* Animation des éléments de menu */
@keyframes menuItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-nav .nav-item {
    opacity: 0;
    animation: menuItemFadeIn 0.3s ease forwards;
}

/* Animation décalée pour chaque élément du menu */
.navbar-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
.navbar-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
.navbar-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
.navbar-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
.navbar-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }
.navbar-nav .nav-item:nth-child(6) { animation-delay: 0.6s; }

/* Animation au survol des liens */
.navbar-nav .nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

/* Animation pour le lien actif */
.navbar-nav .nav-link.active::after {
    width: 80%;
}

/* Animation du logo */
@keyframes logoSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.navbar-brand img {
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    animation: logoSpin 1s ease;
}

/* Animation des boutons */
.navbar .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.navbar .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
    transition: all 0.4s ease;
}

.navbar .btn:hover::before {
    left: 0;
}

/* Animation du badge du panier */
@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

#cart-badge:not(.d-none) {
    animation: pulseBadge 1.5s infinite;
}

/* Animation du bouton toggler sur mobile */
.navbar-toggler {
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    transform: rotate(5deg);
}

/* Navbar semi-transparente */
.navbar-transparent {
  background-color: rgba(42, 82, 152, 0.85) !important; /* Couleur #2a5298 avec 85% d'opacité */
  backdrop-filter: blur(5px); /* Effet de flou derrière la navbar */
  -webkit-backdrop-filter: blur(5px); /* Pour Safari */
  transition: background-color 0.3s ease;
}

/* Effet au survol/scroll si désiré */
.navbar-transparent.scrolled {
  background-color: rgba(42, 82, 152, 0.95) !important; /* Plus opaque au défilement */
}