* {
    margin: 0;
    padding: 0;
}

header,
header * {
    font-family: 'Montserrat', sans-serif;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 40px;
    width: 100%;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}


header .img-reparation {
    height: 20px;
    width: 25px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

header nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

header ul {
    list-style: none;
    display: flex;
    gap: 42px;
    margin: 0;
    padding: 0;
}

header ul li {
    position: relative;
}

header ul li a {
    background: rgba(255, 208, 0, 0.9);
    color: #000000;
    padding: 8px 22px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}



.logo {
    height: 48px;
    margin-right: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: 0;
}

.btn {
    background: rgba(255, 208, 0, 0.9);
    color: #000000;
    padding: 8px 22px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: none;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);

    /* Align icons/images inside buttons with text */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background: #fdda3d;
}

/* Responsive adjustments for the repair icon and header buttons */
@media (max-width: 768px) {
    header .img-reparation {
        height: 20px;
        width: 20px;
        margin-right: 6px;
    }

    .btn {
        padding: 6px 14px;
        gap: 6px;
        font-size: 14px;
    }

    .header-actions {
        gap: 12px;
    }
}

@media (max-width: 420px) {

    /* On very small screens, hide the icon to save space and keep the label */
    header .img-reparation {
        display: none;
    }

    /* Reduce padding to fit mobile */
    .btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}


.cart-icon:hover {
    background: #e2e2e2;
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-icon img {
    height: 26px;
    width: 26px;
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    text-align: left;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px;
    min-width: 200px;
    max-width: 280px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Hover dropdown sur desktop - priorité élevée */
.dropdown:hover .dropdown-menu {
    display: block !important;
    animation: fadeInDropdown 0.3s ease;
}

/* S'assurer que le hover fonctionne même après manipulation JS */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        display: block !important;
        position: absolute !important;
        transform: translateX(-50%) !important;
        left: 50% !important;
        top: calc(100% + 10px) !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        animation: fadeInDropdown 0.3s ease !important;
    }

    /* Réinitialiser les styles JavaScript sur desktop */
    .dropdown-menu[style*="display: none"] {
        display: none !important;
    }

    .dropdown:hover .dropdown-menu[style*="display: none"] {
        display: block !important;
    }
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255, 255, 255, 0.95);
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.dropdown-menu li a {
    background-color: transparent;
    font-size: 14px;
    display: block;
    padding: 12px 16px;
    color: #333;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 4px;
    text-shadow: none;
    box-shadow: none;
}

.dropdown-menu li:last-child a {
    margin-bottom: 0;
}

.dropdown-menu li a:hover {
    background: linear-gradient(135deg, rgba(255, 208, 0, 0.9), rgba(244, 178, 22, 0.9));
    color: #fff;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(255, 208, 0, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.cart-count {
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    background: #FFD000;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
    pointer-events: none;
}





/* Responsive Design */
@media (max-width: 1200px) {
    header {
        padding: 10px 30px;
    }

    header ul {
        gap: 30px;
    }

    header ul li a {
        padding: 7px 18px;
        font-size: 15px;
    }

    .logo {
        height: 65px;
    }

    .btn {
        padding: 7px 18px;
        font-size: 15px;
    }
}

/* ...existing code... */




/* Menu hamburger - caché par défaut */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 10000;
    padding: 4px;
    border-radius: 5px;
    transition: background 0.3s ease;
    flex-shrink: 0;
    min-width: 35px;
    min-height: 35px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hamburger:hover {
    background: rgba(255, 208, 0, 0.1);
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #FFD000;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
    transform-origin: center;
}

.hamburger.active {
    transform: rotate(90deg);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: #ff4757;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0) rotate(180deg);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: #ff4757;
}

/* Améliorations responsive */
@media (max-width: 1024px) {
    header {
        padding: 8px 20px;
    }

    .dropdown-menu {
        min-width: 180px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {

    /* Afficher le hamburger et cacher la navigation normale */
    .hamburger {
        display: flex !important;
        z-index: 10000;
    }

    /* S'assurer que le header ne bloque pas le menu sur mobile */
    header {
        z-index: 9998;
        padding: 8px 12px;
        justify-content: space-between;
        width: 100%;
        max-width: 100vw;
        overflow: visible !important;
        /* Permettre au nav de sortir */
        box-sizing: border-box;
    }

    /* Forcer le nav à sortir du contexte du header */
    header nav {
        position: fixed !important;
        z-index: 99999 !important;
    }

    header nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.95)) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        transform: translateX(-100%) !important;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        visibility: hidden !important;
        opacity: 0 !important;
        margin: 0 !important;
        padding: 20px !important;
    }

    header nav.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    }

    /* Styles élégants du menu mobile */

    /* Animation du fond du menu */
    @keyframes menuBackgroundIn {
        0% {
            background: rgba(255, 255, 255, 0);
            backdrop-filter: blur(0px);
        }

        100% {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 245, 245, 0.95));
            backdrop-filter: blur(25px);
        }
    }

    header nav.active {
        animation: menuBackgroundIn 0.4s ease forwards;
    }

    header ul {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        width: 90%;
        max-width: 400px;
        margin: 0;
        padding: 40px 20px;
        list-style: none;
    }

    header ul li {
        list-style: none;
        margin: 0;
        position: relative;
        transform: translateY(20px);
        opacity: 0;
        animation: slideInMenu 0.6s ease forwards;
    }

    /* Animation d'apparition en cascade */
    header nav.active ul li:nth-child(1) {
        animation-delay: 0.1s;
    }

    header nav.active ul li:nth-child(2) {
        animation-delay: 0.2s;
    }

    header nav.active ul li:nth-child(3) {
        animation-delay: 0.3s;
    }

    header nav.active ul li:nth-child(4) {
        animation-delay: 0.4s;
    }

    header nav.active ul li:nth-child(5) {
        animation-delay: 0.5s;
    }

    @keyframes slideInMenu {
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    header ul li a {
        padding: 18px 30px;
        font-size: 20px;
        font-weight: 600;
        display: block;
        border-radius: 15px;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        color: #333 !important;
        background: rgba(255, 255, 255, 0.9) !important;
        text-decoration: none;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        border: none;
        cursor: pointer;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    header ul li a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 208, 0, 0.4), transparent);
        transition: left 0.5s;
    }

    header ul li a:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
        background: linear-gradient(135deg, rgba(255, 208, 0, 0.95), rgba(255, 220, 50, 0.9)) !important;
        color: #000 !important;
    }

    header ul li a:hover::before {
        left: 100%;
    }

    header ul li a:active {
        transform: translateY(-1px) scale(0.98);
        transition: all 0.1s;
    }

    /* Indicateur visuel élégant pour les dropdowns sur mobile */
    .dropdown>a {
        position: relative;
        padding-right: 50px !important;
    }

    .dropdown>a::after {
        content: '▼';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        color: rgba(0, 0, 0, 0.6);
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        background: rgba(255, 208, 0, 0.3);
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
    }

    .dropdown-open>a::after {
        transform: translateY(-50%) rotate(180deg);
        background: rgba(255, 208, 0, 0.8);
        color: #000;
    }

    .dropdown>a:hover::after {
        background: rgba(255, 208, 0, 0.9);
        transform: translateY(-50%) scale(1.1);
    }

    header ul li a:hover {
        background: #FFD000;
        transform: scale(1.05);
    }

    .logo {
        height: 45px;
        flex-shrink: 0;
        max-width: 120px;
        object-fit: contain;
    }

    .header-actions {
        z-index: 10000;
        flex-shrink: 0;
        position: relative;
    }

    .btn {
        padding: 6px 12px;
        font-size: 13px;
        white-space: nowrap;
        min-width: auto;
    }

    /* Dropdown dans le menu mobile */
    .dropdown-menu {
        position: static !important;
        display: none;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1) !important;
        border: none !important;
        margin: 10px 0 !important;
        padding: 10px !important;
        border-radius: 8px !important;
        overflow: visible !important;
        max-height: none !important;
        z-index: 1100 !important;
        transform: none !important;
        left: auto !important;
        /* Corrections pour mobile réel */
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        min-height: auto !important;
    }

    /* Supprimer le hover sur mobile et utiliser le JavaScript */
    .dropdown:hover .dropdown-menu {
        display: none !important;
    }

    /* Style pour quand le dropdown est ouvert via JavaScript - PRIORITÉ MAXIMALE */
    .dropdown-open .dropdown-menu,
    .dropdown-menu[style*="display: block"] {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        animation: slideDown 0.3s ease !important;
    }

    /* Corrections pour les liens dans les dropdowns */
    .dropdown-menu li a {
        background: transparent !important;
        margin: 2px 0 !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        transition: all 0.3s ease !important;
        color: #333 !important;
        font-weight: 500 !important;
        /* Corrections pour le tactile */
        touch-action: manipulation !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
    }

    /* Assurer que les dropdowns sont cliquables sur mobile */
    .dropdown {
        position: relative !important;
        z-index: 1100 !important;
    }

    /* Amélioration de l'interaction tactile pour les dropdowns */
    .dropdown>a {
        touch-action: manipulation !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        pointer-events: auto !important;
    }

    /* États actifs pour mobile */
    .dropdown>a:focus,
    .dropdown>a:active,
    .dropdown-open>a {
        outline: none !important;
        background: rgba(255, 208, 0, 1) !important;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .dropdown-menu::before {
        content: '' !important;
        position: absolute !important;
        top: -8px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 0 !important;
        height: 0 !important;
        border-left: 8px solid transparent !important;
        border-right: 8px solid transparent !important;
        border-bottom: 8px solid rgba(255, 255, 255, 0.98) !important;
    }

    .dropdown-menu li {
        width: 100% !important;
        margin: 0 !important;
    }



    .dropdown-menu li a:hover {
        background: linear-gradient(135deg, rgba(255, 208, 0, 0.9), rgba(244, 178, 22, 0.9)) !important;
        color: #fff !important;
        transform: translateX(5px) !important;
        box-shadow: 0 4px 15px rgba(255, 208, 0, 0.3) !important;
    }

    /* S'assurer que le nav container peut contenir les dropdowns */
    header nav {
        overflow-y: auto !important;
        padding: 20px 0 !important;
    }

    header ul {
        width: 90% !important;
        max-width: 400px !important;
    }
}

@media (max-width: 480px) {
    header {
        padding: 6px 8px;
        min-height: 60px;
    }

    .logo {
        height: 35px;
        max-width: 100px;
    }

    .btn {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 70px;
    }

    .hamburger {
        min-width: 30px;
        min-height: 30px;
        padding: 3px;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    header {
        padding: 5px 6px;
    }

    .logo {
        height: 30px;
        max-width: 80px;
    }

    .btn {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 60px;
    }

    .hamburger {
        min-width: 28px;
        min-height: 28px;
    }
}