/* === BOUTON SHOP MOBILE === */
.shop-sidebar-toggle.mobile-shop-btn {
    display: none;
    background: #3b0510;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px;
    align-items: center;
    gap: 8px;
    z-index: 9998; /* Ajouté */
    position: fixed; /* Ajouté */
    left: 10px; /* Ajouté */
    top: 10px; /* Ajouté */
}

.shop-sidebar-toggle:hover {
    background: #005a87;
    transform: translateY(-2px);
}

.shop-icon {
    font-size: 18px;
}

/* === OVERLAY === */
.shop-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 9998; /* Ajouté */
}

/* === SIDEBAR PRINCIPALE === */
.shop-categories-sidebar {
    position: fixed;
    top: 0;
    left: 0px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 9999; /* Ajouté */
}

.shop-categories-sidebar.active {
    left: 0;
}

/* === HEADER SIDEBAR === */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e1e1e1;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000; /* Ajouté */
}

.sidebar-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 700;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-sidebar:hover {
    background: #e9ecef;
    color: #333;
}

/* === CONTENU SIDEBAR === */
.sidebar-content {
    flex: 1;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RECHERCHE */
.search-categories {
    margin-bottom: 20px;
}

#categorySearch {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    transform: translateZ(0);
}

#categorySearch:focus {
    outline: none;
    border-color: #3b0510;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* LISTE DES CATÉGORIES */
.shop-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    border-bottom: 1px solid #e1e1e1;
    position: relative;
}

.category-item:last-child {
    border-bottom: none;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 15px 0;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    gap: 12px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.category-link:hover {
    color: #3b0510;
    background: #f8f9fa;
    padding-left: 10px;
    padding-right: 10px;
    margin: 0 -10px;
    border-radius: 4px;
}

.category-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

.category-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    -webkit-font-smoothing: antialiased;
}

.product-count {
    font-size: 12px;
    color: #666;
    -webkit-font-smoothing: antialiased;
}

/* SOUS-CATÉGORIES */
.toggle-subcategories {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid #e1e1e1;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1; /* Ajouté */
}

.toggle-subcategories:hover {
    background: #3b0510;
    color: white;
    border-color: #3b0510;
}

.subcategories {
    list-style: none;
    margin: 0;
    padding: 0 0 0 62px;
    display: none;
}

.subcategories.active {
    display: block;
}

.subcategory-item {
    border-top: 1px solid #f0f0f0;
}

.subcategory-item .category-link {
    padding: 12px 0;
}

.subcategory-item .category-image {
    width: 40px;
    height: 40px;
}

.subcategory-item .category-name {
    font-size: 14px;
    font-weight: 500;
}

/* FOOTER SIDEBAR */
.sidebar-footer {
    padding: 20px;
    border-top: 2px solid #e1e1e1;
    background: #f8f9fa;
}

.view-all-products {
    display: block;
    text-align: center;
    padding: 12px;
    background: #3b0510;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.view-all-products:hover {
    background: #005a87;
    transform: translateY(-2px) translateZ(0);
}

/* === STYLE POUR LE MENU PRINCIPAL === */
.shop-menu-trigger > a {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 600;
}

.shop-menu-trigger > a:hover {
    color: #3b0510 !important;
}

.shop-menu-trigger > a::after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 5px;
    opacity: 0.7;
}

/* === RECHERCHE FILTRÉE === */
.category-item.hidden {
    display: none;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    display: none; /* Ajouté */
}

.no-results.show {
    display: block; /* Ajouté */
}

/* === CORRECTIONS IMPORTANTES POUR LA VISIBILITÉ === */
/* Assurer que la sidebar est cachée par défaut */
.shop-categories-sidebar:not(.active) {
    left: -420px !important;
}

.shop-sidebar-overlay:not(.active) {
    display: none !important;
}

/* Empêcher le scroll du body quand la sidebar est ouverte */
body.sidebar-open {
    overflow: hidden;
}

/* === RESPONSIVE - SIDEBAR GAUCHE === */
@media (max-width: 768px) {
    .shop-menu-trigger {
        display: none !important;
    }
    
    .shop-sidebar-toggle.mobile-shop-btn {
        display: flex !important;
        position: fixed;
        left: 10px;
        top: 10px;
        background: #3b0510;
        color: white;
        border: none;
        padding: 12px 20px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 16px;
        z-index: 9998;
    }
    
    .shop-categories-sidebar {
        width: 100%;
        max-width: 100vw;
        left: -100%;
    }
    
    .shop-categories-sidebar.active {
        left: 0;
    }
    
    .shop-sidebar-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-content {
        padding: 15px;
    }
    
    .category-link {
        padding: 12px 0;
    }
    
    .subcategories {
        padding-left: 52px;
    }
}

@media (max-width: 480px) {
    .shop-sidebar-toggle.mobile-shop-btn {
        left: 5px;
        top: 5px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .category-link {
        gap: 10px;
    }
    
    .category-image {
        width: 40px;
        height: 40px;
    }
    
    .category-name {
        font-size: 14px;
    }
    
    .subcategories {
        padding-left: 50px;
    }
}

/* === CORRECTIONS SPÉCIFIQUES POUR LE FLOU === */
.shop-categories-sidebar,
.sidebar-content,
.category-item,
.category-link,
.category-image,
.category-name,
.product-count {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    blur: none !important;
}

/* Forcer un rendu net sur Webkit */
@media (-webkit-min-device-pixel-ratio: 1.5) {
    .shop-categories-sidebar {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* === ANIMATIONS ET TRANSITIONS AMÉLIORÉES === */
.shop-categories-sidebar {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-sidebar-overlay {
    transition: opacity 0.3s ease;
}

/* === CORRECTIONS DE Z-INDEX POUR LA SUPERPOSITION === */
@media (min-width: 769px) {
    .shop-categories-sidebar {
        z-index: 10000;
    }
    
    .shop-sidebar-overlay {
        z-index: 9999;
    }
}