 :root {
            --primary-color: #3b7ddd;
            --primary-hover: #2a5caa;
            --secondary-color: #f8f9fa;
            --text-color: #444;
            --light-gray: #f1f7ff;
            --border-radius: 8px;
            --transition-speed: 0.3s;
        }
        
       
        
        /* Navigation Container */
        .top-navbar {
    position: sticky;
    top: 0;
    z-index: 1030; /* Plus élevé que la navbar des catégories */
    background: white;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Navigation Container - Ajusté pour la top navbar fixe */
.nav-container {
  
    top: 60px; /* Hauteur approximative de la top navbar */
    z-index: 1020; /* Plus bas que la top navbar */
    background: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

        
        .navbar-brand img {
            transition: transform 0.3s ease;
        }
        
        .navbar-brand:hover img {
            transform: scale(1.05);
        }
        
        .nav-icon-btn {
            position: relative;
            padding: 0.5rem;
            margin: 0 0.25rem;
            border-radius: 50%;
            transition: all var(--transition-speed) ease;
            color: var(--text-color);
        }
        
        .nav-icon-btn:hover {
            background-color: var(--light-gray);
            color: var(--primary-color);
        }
        
        .cart-badge {
            position: absolute;
            top: 0;
            right: 0;
            background-color: #dc3545;
            color: #fff;
            border-radius: 50%;
            width: 18px;
            height: 18px;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .user-avatar {
            transition: all var(--transition-speed) ease;
            border: 2px solid transparent;
        }
        
        .user-avatar:hover {
            border-color: var(--primary-color);
        }
        
        /* Main Navigation */
        .main-nav {
            padding: 0;
            
        }
        
        .nav-list {
            display: flex;
            list-style: none;
            padding: 0;
            margin: 0;
            position: relative;
           
        }
        
        .nav-item {
            position: relative;
            
            flex: 1;
        }
        
        .nav-link-main {
            display: flex;
           
            justify-content: center;
            padding: 6px 3px;
            color: var(--text-color);
            text-decoration: none;
            font-weight: 510;
            font-size: 14px;
            cursor: pointer;
            background: white;
            position: relative;
            transition: all var(--transition-speed) ease;
            border-bottom: 2px solid transparent;
          
        }
        
        .nav-link-main:hover, 
        .nav-link-main.active {
            background: var(--light-gray);
            color: var(--primary-color);
            border-bottom: 2px solid var(--primary-color);
        }
        
        /* Dropdown Menu - Desktop */
        .dropdown-mega {
            position: absolute;
            top: 100%;
            left: 0;
            background: white;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
            border-radius: 0 0 var(--border-radius) var(--border-radius);
            min-width: 200px;
            width: auto;
            max-width: 900px;
            display: none;
            padding: 8px 6px;
            font-size: 0.85rem;
        
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.3s ease, transform 0.3s ease;
        }
        
        .dropdown-mega.show {
           display:grid;
           grid-template-columns: repeat(2,1fr);
            opacity: 1;
            transform: translateY(0);
            z-index: 1050 !important;
        }
        
        .dropdown-section {
            flex: 1;
            padding: 0 8px;
            min-width: 180px;
            margin: 0;
        }
        
        .dropdown-title {
            font-weight: 600;
            margin-bottom: 4px;
            padding-bottom: 5px;
            color: var(--primary-hover);
            font-size: 12px;
            border-bottom: 1px solid rgba(0,0,0,0.1);
        }
        
        .dropdown-links {
            display: flex;
            flex-direction: column;
            
        }
        
        .dropdown-link {
            padding: 2px ;
            color: #555;
            text-decoration: none;
            font-size: 12px;
            transition: all 0.2s ease;
            border-radius: 4px;
            display: block;
        }
        
        .dropdown-link:hover {
            color: var(--primary-color);
            background: var(--light-gray);
            padding-left: 12px;
        }
        
        /* Search Bar */
        .search-container {
            position: relative;
            background: var(--secondary-color);
            padding: 8px 0;
             z-index: 9 !important; 
        }
        
        .search-form {
            max-width: 600px;
            margin: 0 auto;
            z-index: 10 !important; 
        }
        
        .search-input-group {
            z-index: 1010; 
            position: relative;
            display: flex;
        }
        
        .search-input {
            border-radius: 50px 0 0 50px;
            padding-left: 20px;
            border: 1px solid #ced4da;
            border-right: none;
            z-index: 1010; 
        }
        
        .search-btn {
            border-radius: 0 50px 50px 0;
            padding: 0 10px;
            z-index: 1010; 
        }
        
        .dropdown-links.vertical-links {
    display: flex;
    flex-direction: column;
}

.dropdown-links.vertical-links .dropdown-link {
    display: block;
    padding: 8px 16px;
    white-space: nowrap;
}
        /* Mobile adjustments for categories and subcategories */
        @media (max-width: 992px) {
            .nav-list {
                display: block;
                flex-direction: column;
            }
            
            .nav-item {
                display: block;
                width: 100%;
                flex: none;
                border-bottom: 1px solid #f0f0f0;
            }
            
            .nav-link-main {
                display: flex;
                justify-content: space-between;
                padding: 15px 20px;
                font-size: 1rem;
                text-align: left;
            }
            
            .nav-link-main i {
                transition: transform 0.3s ease;
            }
            
            .nav-link-main.active i {
                transform: rotate(180deg);
            }
            
            .dropdown-mega {
               
                width: 100%;
                max-width: 100%;
                display: block;
                padding: 0;
                box-shadow: none;
                border-radius: 0;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.4s ease;
                background-color: #f8f9fa;
            }
            
            .dropdown-mega.show {
                max-height: 2000px;
                overflow-y: auto;
                display: block;
            }
            
            .dropdown-section {
                flex: 1 0 100%;
                margin-bottom: 0;
                padding: 0;
            }
            
            .dropdown-title {
                font-size: 1rem;
                margin: 0;
                padding: 12px 20px 12px 30px;
                background-color: #e9ecef;
                color: var(--primary-hover);
                cursor: pointer;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1px solid #dee2e6;
            }
            
            .dropdown-title i {
                transition: transform 0.3s ease;
            }
            
            .dropdown-title.active i {
                transform: rotate(180deg);
            }
            
            .dropdown-links {
                display: block;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.3s ease;
                padding: 0;
                background-color: white;
            }
            
            .dropdown-title.active + .dropdown-links,
            .dropdown-links.show {
                max-height: 2000px;
                padding: 10px 0;
            }
            
            .dropdown-link {
                padding: 10px 20px 10px 40px;
                font-size: 0.95rem;
                border-bottom: 1px solid #f1f1f1;
                display: block;
                color: #555;
                text-decoration: none;
            }
            
            .dropdown-link:last-child {
                border-bottom: none;
            }
            
            .dropdown-link:hover {
                padding-left: 45px;
                background-color: #f1f7ff;
                color: var(--primary-color);
            }
            
            /* Nested subcategories */
            .level-1 .dropdown-title {
                padding-left: 40px;
                background-color: #f1f1f1;
            }
            
            .level-1 .dropdown-link {
                padding-left: 50px;
            }
            
            .level-2 .dropdown-title {
                padding-left: 50px;
                background-color: #f8f8f8;
            }
            
            .level-2 .dropdown-link {
                padding-left: 60px;
            }
            
            /* Mobile search adjustments */
            .search-container {
                padding: 15px 0;
            }
            
            .search-input-group {
                flex-direction: column;
            }
            
            .search-input {
                border-radius: 50px;
                border-right: 1px solid #ced4da;
                margin-bottom: 10px;
                text-align: center;
            }
            
            .search-btn {
                border-radius: 50px;
                width: 100%;
            }
        }
        
        /* Extra small devices */
        @media (max-width: 576px) {
            .dropdown-title {
                padding: 10px 15px 10px 25px;
                font-size: 0.95rem;
            }
            
            .level-1 .dropdown-title {
                padding-left: 35px;
            }
            
            .level-2 .dropdown-title {
                padding-left: 45px;
            }
            
            .dropdown-link {
                padding: 8px 15px 8px 35px;
                font-size: 0.9rem;
            }
            
            .level-1 .dropdown-link {
                padding-left: 45px;
            }
            
            .level-2 .dropdown-link {
                padding-left: 55px;
            }
            
            .dropdown-title.active + .dropdown-links,
            .dropdown-links.show {
                padding: 8px 0;
            }
            
            /* Top navbar adjustments for mobile */
            .top-navbar .navbar-nav {
                flex-direction: row;
                justify-content: space-around;
                width: 100%;
                margin-top: 10px;
            }
            
            .top-navbar .nav-item {
                flex: 0 0 auto;
            }
            
            .top-navbar .nav-link {
                padding: 0.5rem;
            }
        }
        
        /* Animation for mobile dropdown */
        @keyframes slideDown {
            from { 
                max-height: 0;
                opacity: 0;
            }
            to { 
                max-height: 2000px;
                opacity: 1;
            }
        }
        
        .dropdown-title.active + .dropdown-links,
        .dropdown-links.show {
            animation: slideDown 0.4s ease forwards;
        }
        
        /* Improve touch targets for mobile */
        .dropdown-title,
        .dropdown-link {
            min-height: 44px;
            display: flex;
            align-items: center;
        }
        
        /* Animation for desktop dropdown */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .dropdown-mega.show {
            animation: fadeIn 0.3s ease forwards;
        }
        
        /* Badge notification animation */
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.1); }
            100% { transform: scale(1); }
        }
        
        .badge-notification {
            animation: pulse 2s infinite;
        }