/**
 * Shop Sidebar Styles
 * Version corrigée pour Desktop + Mobile + Tablette
 */

/* ========================================
   OVERLAY
   ======================================== */
.jackcrow-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.jackcrow-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========================================
   SIDEBARS - Desktop + Mobile + Tablette
   ======================================== */
.jackcrow-shop-sidebar {
    position: fixed !important;
    top: 0 !important;
    height: 100vh !important;
    width: 180px;
    background: #fff;
    z-index: 99999 !important;
    overflow-y: auto;
    transition: transform 0.3s ease;
    padding: 30px 15px;
}

/* Sidebar GAUCHE (Collections) */
.jackcrow-sidebar-left {
    left: 0 !important;
    right: auto !important;
    transform: translateX(-100%);
}

.jackcrow-sidebar-left.open {
    transform: translateX(0);
}

/* Sidebar DROITE (Trier) */
.jackcrow-sidebar-right {
    left: auto !important;
    right: 0 !important;
    transform: translateX(100%);
}

.jackcrow-sidebar-right.open {
    transform: translateX(0);
}

/* ========================================
   NAVIGATION DU MENU
   ======================================== */
.jackcrow-shop-sidebar nav {
    width: 100%;
}

.jackcrow-shop-sidebar .hfe-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Items principaux (L'Homme, La Femme) */
.jackcrow-shop-sidebar .hfe-nav-menu > li {
    position: relative;
    margin-bottom: 30px;
}

.jackcrow-shop-sidebar .hfe-nav-menu > li:last-child {
    margin-bottom: 0;
}

/* Titres des sections */
.jackcrow-shop-sidebar .hfe-menu-item {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
    line-height: 1.4;
}

.jackcrow-shop-sidebar .hfe-menu-item:hover {
    opacity: 0.7;
}

/* ========================================
   SOUS-MENUS
   ======================================== */
.jackcrow-shop-sidebar .sub-menu {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: none;
}

.jackcrow-shop-sidebar .sub-menu li {
    margin: 0 0 10px 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.jackcrow-shop-sidebar .sub-menu li:last-child {
    margin-bottom: 0;
}

/* Sous-catégories */
.jackcrow-shop-sidebar .hfe-sub-menu-item {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #555555;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: block !important;
    padding: 0;
    line-height: 1.4;
    visibility: visible !important;
}

.jackcrow-shop-sidebar .hfe-sub-menu-item:hover {
    opacity: 0.7;
}

/* Forcer l'affichage des sous-menus */
.jackcrow-shop-sidebar .hfe-has-submenu .sub-menu,
.jackcrow-shop-sidebar .menu-item-has-children .sub-menu,
.jackcrow-shop-sidebar ul.sub-menu {
    display: block !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* Cacher les icônes et toggles */
.jackcrow-shop-sidebar .hfe-menu-toggle,
.jackcrow-shop-sidebar .sub-arrow,
.jackcrow-shop-sidebar .hfe-menu-child-0 {
    display: none !important;
}

/* ========================================
   DÉSACTIVATION DES FLYOUTS HFE ORIGINAUX
   ======================================== */
#shop-sidebar-trigger .hfe-flyout-overlay,
#ald-sort-trigger .hfe-flyout-overlay,
#shop-sidebar-trigger .hfe-side,
#ald-sort-trigger .hfe-side {
    display: none !important;
}

#shop-sidebar-trigger .hfe-flyout-wrapper,
#ald-sort-trigger .hfe-flyout-wrapper {
    pointer-events: none !important;
}

body.hfe-flyout-open {
    overflow: auto !important;
}

/* ========================================
   RESPONSIVE - Mobile & Tablette
   ======================================== */
@media (max-width: 1024px) {
    .jackcrow-shop-sidebar {
        width: 200px;
        max-width: 75vw;
    }
}

@media (max-width: 768px) {
    .jackcrow-shop-sidebar {
        width: 200px;
        max-width: 80vw;
        padding: 25px 15px;
    }
}

@media (max-width: 480px) {
    .jackcrow-shop-sidebar {
        width: 200px;
        max-width: 85vw;
        padding: 25px 15px;
    }
}