/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-image {
    height: 70px;
    width: auto;
    object-fit: contain;
    border-radius: 15px;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000000;
    font-family: 'Inter', sans-serif;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #000000;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Bouton profil */
.nav-profile {
    display: flex;
    align-items: center;
    position: relative;
    gap: 1rem;
}

.profile-btn {
    background: #333333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.profile-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-btn.authenticated {
    background: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.profile-btn.authenticated:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.profile-btn i {
    font-size: 1.1rem;
}

/* Bouton panier */
.cart-btn {
    background: #333333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.cart-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cart-btn i {
    font-size: 1.1rem;
}

/* S'assurer qu'aucun nom n'est visible à côté de l'icône (mais pas dans le menu déroulant) */
.nav-profile > .profile-name,
.nav-profile > .profile-email,
.nav-profile > .profile-role {
    display: none !important;
}

/* Menu déroulant du profil */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 1000;
    margin-top: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.profile-dropdown.active {
    display: block;
    animation: slideInDown 0.3s ease-out;
}

.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #f1f5f9;
}

.profile-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #e2e8f0;
    text-align: center;
}

.profile-name {
    display: block;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.profile-email {
    display: block;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.profile-role {
    display: block;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-menu {
    padding: 12px 0;
    background: #f8fafc;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.profile-link:last-child {
    border-bottom: none;
}

.profile-link:hover {
    background-color: #e2e8f0;
    color: #1f2937;
    transform: translateX(4px);
}

.profile-link i {
    width: 18px;
    color: #6b7280;
    font-size: 1rem;
}

/* Lien Admin - style spécial pour les administrateurs */
.admin-link {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6) !important;
    color: white !important;
    border-radius: 8px;
    margin: 8px 20px;
    padding: 12px 20px;
    width: calc(100% - 40px);
    box-sizing: border-box;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.admin-link:hover {
    background: linear-gradient(135deg, #6d28d9, #7c3aed) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.admin-link i {
    color: white !important;
    font-size: 1.1rem;
}

.profile-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 0;
}

.logout-btn {
    color: #dc2626 !important;
    border: 2px solid #dc2626 !important;
    border-radius: 8px;
    margin: 12px 20px;
    background: transparent;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 12px 20px;
    width: calc(100% - 40px);
    box-sizing: border-box;
}

.logout-btn:hover {
    background-color: #dc2626 !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.logout-btn i {
    color: #dc2626 !important;
}

.logout-btn:hover i {
    color: white !important;
}

/* Animation pour le menu déroulant */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design pour la navigation */
@media (max-width: 768px) {
    .nav-logo {
        gap: 1rem;
    }
    
    .logo-image {
        height: 50px;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0.5rem 0;
    }
    
    .nav-menu a {
        padding: 0.5rem 2rem;
        display: block;
    }
    
    /* Garder l'icône de profil visible sur mobile avec un meilleur alignement */
    .nav-profile {
        display: flex;
        order: 2;
        margin-right: 8px; /* Réduire l'espacement avec le hamburger */
        align-items: center; /* Aligner verticalement avec le hamburger */
    }
    
    .nav-toggle {
        display: flex;
        order: 3;
        align-items: center; /* Aligner verticalement avec le profil */
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Ajuster la taille des boutons sur mobile pour qu'ils soient proportionnels */
    .cart-btn,
    .profile-btn {
        width: 32px; /* Réduire légèrement pour mieux s'aligner */
        height: 32px;
        margin: 0; /* Supprimer les marges par défaut */
    }
    
    .cart-btn i,
    .profile-btn i {
        font-size: 0.9rem; /* Réduire la taille de l'icône */
    }
    
    /* Ajuster l'espacement entre les boutons sur mobile */
    .nav-profile {
        gap: 0.5rem;
    }
    
    /* Ajuster la position du menu déroulant sur mobile */
    .profile-dropdown {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
        margin-top: 0;
        border-left: none;
        border-right: none;
    }
    
    .profile-dropdown::before {
        display: none;
    }
}
