/* ===== HEADER RESPONSIVE STYLES ===== */
/* Styles de base pour le header responsive sur tous les appareils */

.main-header {
    position: relative;
    z-index: 1000;
    width: 100%;
}

.header-main {
    background-color: #2048ad !important;
    padding: 10px 0 !important; /* Forçage du padding pour homogénéiser la hauteur du header */
    box-shadow: none; /* Supprime l'ombre pour une transition fluide */
    margin-bottom: 0; /* Supprime l'espacement avec la navigation */
    border-bottom: none; /* Supprime toute bordure du header */
    width: 100%;
}

/* Normalisation du conteneur header pour éviter les écarts de hauteur entre pages */
header.main-header {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.container-fluid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

/* ===== LOGO ===== */
/* Styles pour le logo du header - Responsive */
.logo-container {
    flex-shrink: 0;
    min-width: 0; /* Permet au logo de se rétrécir si nécessaire */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    white-space: nowrap; /* Empêche le texte de se couper */
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.logo figcaption {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    flex-shrink: 0;
}

/* ===== SEARCH CONTAINER ===== */
/* Styles pour la barre de recherche - Responsive et accessible */
.search-container {
    flex: 1;
    max-width: 500px;
    min-width: 200px; /* Réduit pour mobile */
    width: 100%;
    box-sizing: border-box;
}

.search-form {
    width: 100%;
}

.search-wrapper {
    display: flex;
    background: white;
    border-radius: 25px;
    overflow: visible; /* Changé de hidden à visible pour les suggestions */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative; /* Ajouté pour le positionnement des suggestions */
    width: 100%;
    box-sizing: border-box;
}

.category-select {
    border: none;
    padding: 12px 15px;
    background: #f8f9fa;
    color: #333;
    font-size: 14px;
    min-width: 120px;
    outline: none;
    cursor: pointer;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 14px;
    outline: none;
    background: white;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    background: #2048ad;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background: #1a3d96;
}

.search-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* ===== HEADER ACTIONS ===== */
/* Conteneur pour les actions utilisateur (devise, compte, panier) */
.header-actions:root, :root {
    /* Hauteur uniforme des actions (desktop par défaut) */
    --header-action-height: 40px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    min-width: 0; /* Permet la flexibilité sur mobile */
    flex-wrap: nowrap; /* Empêche le retour à la ligne sur desktop */
}

/* Hauteur uniforme pour les trois actions */
.header-actions .currency-btn,
.header-actions .user-btn,
.header-actions .login-btn,
.header-actions .cart-btn {
    height: var(--header-action-height);
    display: inline-flex;
    align-items: center;
}

/* Alignement des symboles et icônes */
.currency-symbol {
    font-size: 16px;
    line-height: 1;
}

/* ===== CURRENCY DROPDOWN ===== */
.currency-dropdown-container {
    position: relative;
}

.currency-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.currency-btn:hover {
    background: rgba(255,255,255,0.2);
}

.currency-icon {
    font-size: 16px;
}

.dropdown-arrow {
    width: 12px;
    height: 12px;
    fill: white;
    transition: transform 0.3s;
}

.currency-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    display: none;
    margin-top: 5px;
    list-style: none;
    padding: 0;
    margin-left: 0;
}

.currency-dropdown li {
    border-bottom: 1px solid #eee;
}

.currency-dropdown li:last-child {
    border-bottom: none;
}

.currency-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
}

.currency-dropdown a:hover {
    background: #f8f9fa;
}

.currency-dropdown .selected a {
    background: #2048ad;
    color: white;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown-container {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.user-btn:hover {
    background: rgba(255,255,255,0.2);
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.login-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.user-icon {
    font-size: 16px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1001;
    display: none;
    margin-top: 5px;
    list-style: none;
    padding: 0;
    margin-left: 0;
}

.user-dropdown li {
    border-bottom: 1px solid #eee;
}

.user-dropdown li:last-child {
    border-bottom: none;
}

.user-dropdown a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
    font-size: 14px;
}

.user-dropdown a:hover {
    background: #f8f9fa;
}

/* ===== CART ===== */
/* Styles pour le bouton panier avec badge de compteur */
.cart-container {
    position: relative;
    flex-shrink: 0;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    position: relative;
    white-space: nowrap;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.cart-icon {
    width: 20px;
    height: 20px;
    fill: white;
    flex-shrink: 0;
}

.cart-count {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    box-sizing: border-box;
    line-height: 1;
}

/* ===== SEPARATOR ===== */
.header-separator {
    background: linear-gradient(90deg, #2048ad 0%, #1a3d96 100%);
    padding: 0 !important; /* Supprime complètement l'espacement pour coller la navigation */
    height: 0 !important; /* Rend le séparateur invisible */
    overflow: hidden !important; /* Cache le contenu du séparateur */
    display: none !important; /* Force la disparition visuelle pour empêcher toute prise d'espace */
}

/* Neutralisation de l'élément décoratif sous le header pour éviter tout impact sur la mise en page */
.westeros-separator {
    display: none !important;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.westeros-separator li {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.westeros-separator li:nth-child(2) { animation-delay: 0.2s; }
.westeros-separator li:nth-child(3) { animation-delay: 0.4s; }
.westeros-separator li:nth-child(4) { animation-delay: 0.6s; }
.westeros-separator li:nth-child(5) { animation-delay: 0.8s; }
.westeros-separator li:nth-child(6) { animation-delay: 1s; }
.westeros-separator li:nth-child(7) { animation-delay: 1.2s; }
.westeros-separator li:nth-child(8) { animation-delay: 1.4s; }

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes (max-width: 768px) */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    /* Réorganisation en ligne pour tablettes */
    .header-content {
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
    }
    
    /* Logo reste en première position */
    .logo-container {
        flex-shrink: 0;
        order: 0;
    }
    
    /* Barre de recherche prend l'espace disponible */
    .search-container {
        order: 2;
        flex: 1;
        min-width: 200px;
        max-width: calc(100% - 60px); /* Réserve de l'espace pour le bouton hamburger */
    }
    
    /* Bouton hamburger aligné avec la barre de recherche */
    .mobile-menu-toggle {
        display: flex;
        order: 3;
        align-self: center;
        margin-left: 8px;
    }
    
    /* Actions utilisateur alignées à droite */
    .header-actions {
        order: 1;
        flex-shrink: 0;
        gap: 8px;
    }
    
    /* Ajustement de la barre de recherche */
    .search-wrapper {
        border-radius: 20px;
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 10px 15px;
    }
}

/* Mobiles moyens (max-width: 480px) */
@media (max-width: 480px) {
    :root { --header-action-height: 34px; }
    .header-main {
        padding: 12px 0;
    }
    
    .container-fluid {
        padding: 0 12px;
    }
    
    /* Organisation en deux lignes sur mobile */
    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
    }
    
    /* Logo plus petit */
    .logo-container {
        order: 0;
        flex-shrink: 0;
    }
    
    .logo img {
        height: 32px;
        width: auto;
    }
    
    .logo figcaption {
        font-size: 14px;
    }
    
    /* Actions utilisateur sur la même ligne que le logo */
    .header-actions {
        order: 1;
        flex: 1;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
    }
    
    /* Boutons compacts avec icônes uniquement */
    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn {
        font-size: 12px;
        border-radius: 18px;
        min-width: 40px;
        justify-content: center;
    }
    
    /* Masquer les textes, garder uniquement les icônes */
    .currency-text,
    .user-name,
    .cart-text,
    .login-text {
        display: none;
    }
    
    /* Ajuster les icônes */
    .currency-icon,
    .user-icon {
        font-size: 18px;
    }
    
    .cart-icon {
        width: 18px;
        height: 18px;
    }
    
    /* Barre de recherche et bouton hamburger sur la même ligne */
    .search-container {
        order: 2;
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 60px); /* Réserve de l'espace pour le bouton hamburger */
    }
    
    /* Bouton hamburger aligné avec la barre de recherche */
    .mobile-menu-toggle {
        display: flex;
        order: 3;
        align-self: center;
        margin-left: 8px;
    }
    
    .search-wrapper {
        border-radius: 20px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }
    
    .search-input {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 10px 15px;
        flex-shrink: 0;
    }
    
    /* Dropdowns ajustés pour mobile */
    .currency-dropdown,
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
        max-width: calc(100vw - 24px);
    }
    
    /* Badge panier ajusté */
    .cart-count {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -3px;
        right: -3px;
    }
}

/* Petits mobiles (max-width: 375px) */
@media (max-width: 375px) {
    :root { --header-action-height: 32px; }
    .header-main {
        padding: 10px 0;
    }
    
    .container-fluid {
        padding: 0 10px;
    }
    
    .header-content {
        gap: 8px;
    }
    
    /* Logo encore plus petit */
    .logo img {
        height: 28px;
    }
    
    .logo figcaption {
        font-size: 12px;
    }
    
    /* Boutons encore plus compacts */
    .header-actions {
        gap: 5px;
    }
    
    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn {
        font-size: 11px;
        min-width: 36px;
    }
    
    .currency-icon,
    .user-icon {
        font-size: 16px;
    }
    
    .cart-icon {
        width: 16px;
        height: 16px;
    }
    
    /* Barre de recherche */
    .search-input {
        padding: 9px 12px;
        font-size: 13px;
    }
    
    .search-btn {
        padding: 9px 12px;
    }
    
    .search-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Badge panier */
    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}

/* Très petits écrans (max-width: 320px) */
@media (max-width: 320px) {
    :root { --header-action-height: 30px; }
    .container-fluid {
        padding: 0 8px;
    }
    
    .header-content {
        gap: 6px;
    }
    
    /* Logo minimal */
    .logo img {
        height: 24px;
    }
    
    .logo figcaption {
        font-size: 11px;
    }
    
    /* Boutons très compacts */
    .header-actions {
        gap: 4px;
    }
    
    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn {
        font-size: 10px;
        min-width: 32px;
    }
    
    .currency-icon,
    .user-icon {
        font-size: 14px;
    }
    
    .cart-icon {
        width: 14px;
        height: 14px;
    }
    
    /* Barre de recherche compacte */
    .search-input {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .search-input::placeholder {
        font-size: 11px;
    }
    
    .search-btn {
        padding: 8px 10px;
    }
    
    .search-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* Badge panier */
    .cart-count {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
    
    /* Dropdowns ajustés */
    .currency-dropdown,
    .user-dropdown {
        min-width: 160px;
        max-width: calc(100vw - 16px);
    }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header-main {
        padding: 8px 0;
    }
    
    .header-content {
        flex-direction: row;
        gap: 10px;
    }
    
    .search-container {
        order: 1;
        flex: 1;
        max-width: 300px;
    }
    
    .header-actions {
        order: 2;
        width: auto;
        gap: 8px;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .westeros-separator li {
        animation: none;
    }
    
    .dropdown-arrow,
    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn,
    .search-btn {
        transition: none;
    }
}

/* Navigation principale responsive */
.main-navigation {
    background-color: #fff;
    border-bottom: 3px solid #2048ad; /* Bordure unique et harmonisée */
    position: relative;
    z-index: 100;
    margin-top: 0; /* Supprime l'espacement avec le header */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* Ajoute l'ombre ici pour la continuité */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0; /* Supprime le padding pour coller la bordure */
    position: relative;
}

/* Menu mobile toggle - Version améliorée */
/* Bouton hamburger intégré dans le header pour alignement avec la barre de recherche */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 10px 12px;
    margin: 0;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    min-width: 44px; /* Taille minimale pour l'accessibilité tactile */
    height: auto;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger-line {
    width: 22px;
    height: 2.5px;
    background-color: white;
    margin: 2.5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 7px);
    background-color: #ff6b6b;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -7px);
    background-color: #ff6b6b;
}

/* Menu principal */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0 20px; /* Ajoute le padding ici pour maintenir l'espacement des éléments */
    align-items: center;
    flex-wrap: wrap;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 12px 20px; /* Réduit le padding pour harmoniser avec le header */
    color: #2048ad;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #1a3a8a;
    border-bottom-color: #2048ad;
    background-color: rgba(32, 72, 173, 0.05);
}

.mobile-only {
    display: none;
}

/* Responsive Design - Version améliorée */
@media (max-width: 1024px) {
    .container-fluid {
        padding: 0 15px;
    }
    
    .header-content {
        gap: 15px;
    }
    
    .search-container {
        min-width: 250px;
        max-width: 400px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .logo img {
        height: 35px;
    }
    
    .logo figcaption {
        font-size: 16px;
    }
}

/* Navigation mobile - Améliorations pour tablettes et mobiles */
@media (max-width: 768px) {
    /* Bouton menu hamburger visible dans le header */
    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
    }
    
    /* Navigation principale : pas d'espace vide sur mobile */
    .main-navigation {
        height: 0;
        min-height: 0;
        padding: 0;
        margin: 0;
        border-bottom: none;
        box-shadow: none;
        overflow: visible;
    }
    
    /* Navigation principale en menu déroulant */
    .nav-container {
        padding: 0;
        position: relative;
        height: 0;
        min-height: 0;
        overflow: visible;
    }
    
    .nav-menu {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        background-color: #fff;
        flex-direction: column;
        align-items: stretch;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        max-height: 0;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: none;
        z-index: 999;
        padding: 0;
        margin: 0;
    }
    
    .nav-menu.active {
        max-height: 80vh;
        overflow-y: auto;
        border-top: 1px solid #2048ad;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        margin: 0;
    }
    
    .nav-menu.active .nav-item {
        transform: translateX(0);
    }
    
    /* Animation d'apparition progressive */
    .nav-menu.active .nav-item:nth-child(1) { transition-delay: 0.05s; }
    .nav-menu.active .nav-item:nth-child(2) { transition-delay: 0.1s; }
    .nav-menu.active .nav-item:nth-child(3) { transition-delay: 0.15s; }
    .nav-menu.active .nav-item:nth-child(4) { transition-delay: 0.2s; }
    .nav-menu.active .nav-item:nth-child(5) { transition-delay: 0.25s; }
    .nav-menu.active .nav-item:nth-child(6) { transition-delay: 0.3s; }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 16px 20px;
        border-bottom: none;
        border-left: 4px solid transparent;
        font-size: 15px;
        font-weight: 500;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-left-color: #2048ad;
        border-bottom-color: transparent;
        background: linear-gradient(90deg, rgba(32, 72, 173, 0.08) 0%, transparent 100%);
        color: #2048ad;
        padding-left: 25px;
    }
    
    /* Styles pour les items avec sous-menus (mega-dropdown) sur mobile */
    .nav-item.mega-dropdown {
        position: relative;
    }
    
    .nav-item.mega-dropdown > .nav-link {
        position: relative;
        padding-right: 50px;
    }
    
    .nav-item.mega-dropdown > .nav-link::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid #2048ad;
        transition: transform 0.3s ease;
    }
    
    .nav-item.mega-dropdown.open > .nav-link::after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    /* Mega menu transformé en sous-menu sur mobile */
    .nav-item.mega-dropdown .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        min-width: auto;
        width: 100%;
        box-shadow: none;
        border: none;
        border-radius: 0;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        background-color: #f8f9fa;
        display: block;
    }
    
    .nav-item.mega-dropdown.open .mega-menu {
        max-height: 2000px;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
        opacity: 1;
    }
    
    .nav-item.mega-dropdown .mega-menu-content {
        padding: 0;
    }
    
    .nav-item.mega-dropdown .mega-menu-header {
        display: none;
    }
    
    .nav-item.mega-dropdown .mega-menu-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .nav-item.mega-dropdown .mega-menu-item {
        border-bottom: 1px solid #e8e8e8;
    }
    
    .nav-item.mega-dropdown .mega-menu-item:last-child {
        border-bottom: none;
    }
    
    .nav-item.mega-dropdown .mega-menu-link {
        padding: 14px 20px 14px 40px;
        border-radius: 0;
        border: none;
        background: transparent;
        color: #495057;
        font-size: 14px;
        font-weight: 400;
        display: flex;
        align-items: center;
        transition: all 0.2s ease;
    }
    
    .nav-item.mega-dropdown .mega-menu-link:hover {
        background-color: rgba(32, 72, 173, 0.05);
        color: #2048ad;
        transform: none;
        box-shadow: none;
        border-left: 4px solid #2048ad;
        padding-left: 36px;
    }
    
    .nav-item.mega-dropdown .mega-menu-item.featured .mega-menu-link {
        background: rgba(32, 72, 173, 0.08);
        color: #2048ad;
        font-weight: 600;
    }
    
    .nav-item.mega-dropdown .mega-menu-item.featured .mega-menu-link:hover {
        background: rgba(32, 72, 173, 0.12);
        border-left: 4px solid #2048ad;
    }
    
    .nav-item.mega-dropdown .mega-menu-icon {
        font-size: 16px;
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* Masquer le caret sur mobile */
    .nav-item.mega-dropdown .nav-link .caret {
        display: none;
    }
    
    /* Afficher les éléments mobile-only */
    .mobile-only {
        display: block;
    }
}

/* Navigation mobile - Ajustements pour petits écrans */
@media (max-width: 425px) {
    /* Navigation menu ajusté */
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-link {
        padding: 14px 15px;
        font-size: 14px;
    }
    
    .nav-menu.active {
        max-height: 75vh;
    }
    
    /* Bouton hamburger ajusté */
    .mobile-menu-toggle {
        padding: 10px;
    }
    
    .hamburger-line {
        width: 24px;
        height: 2px;
    }
}

/* Navigation mobile - Très petits écrans */
@media (max-width: 375px) {
    /* Navigation menu compact */
    .nav-link {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .nav-menu.active {
        max-height: 70vh;
    }
    
    /* Bouton hamburger plus compact */
    .mobile-menu-toggle {
        padding: 8px;
    }
    
    .hamburger-line {
        width: 22px;
        height: 2px;
        margin: 2.5px 0;
    }
}

/* Navigation mobile - Écrans très petits */
@media (max-width: 320px) {
    /* Navigation menu très compact */
    .nav-container {
        padding: 0 8px;
    }
    
    .nav-link {
        padding: 12px 12px;
        font-size: 12px;
    }
    
    .nav-menu.active {
        max-height: 65vh;
    }
    
    /* Bouton hamburger minimal */
    .mobile-menu-toggle {
        padding: 7px;
    }
    
    .hamburger-line {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }
}

/* Mode sombre (si nécessaire) - Version e-commerce optimisée */
@media (prefers-color-scheme: dark) {
    .main-header {
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .main-navigation {
        background: linear-gradient(135deg, #334155 0%, #475569 100%);
        border-bottom-color: #64748b;
    }
    
    .main-navigation .nav-link {
        color: #f1f5f9;
    }
    
    .main-navigation .nav-link:hover,
    .main-navigation .nav-link:focus {
        color: #60a5fa;
        background-color: rgba(96, 165, 250, 0.1);
    }
    
    .currency-dropdown,
    .user-dropdown {
        background: #334155;
        border-color: #475569;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .currency-dropdown a,
    .user-dropdown a {
        color: #f1f5f9;
    }
    
    .currency-dropdown a:hover,
    .user-dropdown a:hover {
        background: rgba(96, 165, 250, 0.15);
        color: #60a5fa;
    }
    
    .currency-dropdown .selected a {
        background: #2048ad;
    }
    
    .search-wrapper {
        background: #334155;
        border: 1px solid #475569;
    }
    
    .category-select {
        background: #475569;
        color: #f1f5f9;
    }
    
    .search-input {
        background: #334155;
        color: #f1f5f9;
    }
    
    .search-input::placeholder {
        color: #94a3b8;
    }
    
    .nav-menu {
        background-color: #334155;
    }
    
    .nav-link {
        color: #f1f5f9;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: #60a5fa;
        background-color: rgba(96, 165, 250, 0.1);
    }
    
    .hamburger-line {
        background-color: #60a5fa;
    }
    
    .nav-item {
        border-bottom-color: #475569;
    }
}

/* === Corrections de contraste et accessibilité du header (améliorations) === */

/* Texte uniquement pour lecteurs d'écran */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation principale (section catégories) - Version e-commerce optimisée */
.main-navigation {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); /* fond clair et moderne */
  border-bottom: 2px solid #2048ad; /* accent bleu principal harmonisé */
  box-shadow: 0 2px 4px rgba(32, 72, 173, 0.08); /* ombre subtile */
  margin-top: 0; /* Supprime complètement l'espacement avec le header */
}
.main-navigation .nav-link {
  color: #334155; /* gris foncé professionnel */
  font-weight: 600;
  transition: all 0.3s ease;
}
.main-navigation .nav-link:hover,
.main-navigation .nav-link:focus {
  color: #2048ad; /* bleu principal au survol */
  background-color: rgba(32, 72, 173, 0.05); /* fond subtil */
  outline: none;
}

/* Ajouter un état actif explicite et un focus visible */
.main-navigation .nav-link.active {
  color: #2048ad;
  background-color: rgba(32, 72, 173, 0.1);
  border-bottom: 3px solid #2048ad;
}
.main-navigation .nav-link:focus-visible {
  outline: 2px solid #2048ad;
  outline-offset: 2px;
}

/* Bouton menu mobile (hamburger) sur fond sombre */
.mobile-menu-toggle {
  color: #ffffff;
}
.mobile-menu-toggle.active .hamburger-line,
.mobile-menu-toggle .hamburger-line {
  background-color: #ffffff;
}

/* Barre de recherche: arrière-plan clair et bouton visible */
.search-form .search-wrapper {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.08);
}
.search-input {
  color: #1b1b1b;
}
.search-input::placeholder {
  color: #6b7280; /* gris medium pour accessibilité */
}
.search-btn {
  background-color: #ffc107; /* jaune doré très visible */
  color: #1b3a57; /* texte/icone contrasté */
  border: none;
  border-radius: 6px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.05s ease, box-shadow 0.2s ease;
}
.search-btn:hover {
  background-color: #e0a800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.search-btn:active {
  transform: translateY(1px);
}
.search-btn:focus-visible {
  outline: 2px solid #0ea5e9; /* focus très visible */
  outline-offset: 2px;
}
.search-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Boutons devise et compte (icônes visibles) */
.currency-btn,
.user-btn {
  color: #ffffff; /* les SVG utilisent currentColor */
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.currency-btn:hover,
.user-btn:hover {
  background: rgba(255,255,255,0.12);
}
.currency-btn:focus,
.user-btn:focus {
  outline: 2px solid #ffd166;
  outline-offset: 2px;
}
.currency-btn .dropdown-arrow svg,
.user-btn .dropdown-arrow svg {
  color: #ffffff;
}
.currency-icon svg,
.user-icon svg {
  color: currentColor;
  fill: currentColor;
}

/* Dropdowns (devise / utilisateur) - Version e-commerce optimisée */
.currency-dropdown,
.user-dropdown {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(32, 72, 173, 0.15);
}
.currency-dropdown a,
.user-dropdown a {
  color: #334155;
  padding: 12px 16px;
  display: block;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 4px;
}
.currency-dropdown li.selected > a,
.user-dropdown li.selected > a {
  color: #2048ad;
  background: rgba(32, 72, 173, 0.1);
}
.currency-dropdown a:hover,
.user-dropdown a:hover,
.currency-dropdown a:focus,
.user-dropdown a:focus {
  background: rgba(32, 72, 173, 0.08);
  color: #2048ad;
  outline: none;
}

/* Panier */
.cart-btn {
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
}
.cart-btn:hover {
  background: rgba(255,255,255,0.12);
}
.cart-count {
  background: #ef4444; /* rouge accessible */
  color: #ffffff;
}

/* Sélecteur de catégories à gauche de la recherche */
.category-select {
  background: #f9fafb;
  color: #111827;
  border: 1px solid #d1d5db;
}
.category-select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* Liens de la navigation mobile */
.mobile-menu ul li a {
  color: #ffffff;
}
.mobile-menu {
  background: #0b0b0b;
}

/* Mode sombre: conserver contrastes */
@media (prefers-color-scheme: dark) {
  .search-form .search-wrapper {
    background: #111214;
    border-color: #2a2a2a;
  }
  .search-input {
    color: #f3f4f6;
  }
  .search-input::placeholder {
    color: #9ca3af;
  }
}

/* ===== AJUSTEMENTS POUR LES PETITS ÉCRANS ===== */

/* Écrans intermédiaires (max-width: 425px) */
@media (max-width: 425px) {
    .header-main {
        padding: 8px 0;
    }

    .logo img {
        height: 30px;
    }

    .logo figcaption {
        font-size: 14px;
    }

    .header-actions {
        gap: 8px;
        flex-wrap: wrap;
    }

    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn {
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 12px;
    }

    .search-wrapper {
        border-radius: 5px;
    }

    .category-select,
    .search-input {
        padding: 8px 10px;
        font-size: 12px;
    }

    .search-btn {
        padding: 8px 12px;
    }
}

/* Écrans très petits (max-width: 375px) */
@media (max-width: 375px) {
    .header-actions {
        justify-content: center;
    }

    .currency-btn,
    .user-btn,
    .login-btn,
    .cart-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .currency-icon,
    .user-icon {
        font-size: 12px;
    }

    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
}