/* Sidebar catégories WooCommerce - GL Custom */

/* Overlay/masque noir semi-transparent */
.gl-categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    z-index: 99998;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    pointer-events: none;
}

.gl-categories-overlay.show {
    opacity: 1;
    visibility: visible;
    z-index: 99998;
    pointer-events: auto;
}

/* Sidebar à gauche */
.gl-categories-sidebar {
    position: fixed;
    background-color: var(--dropdown-bg-color, #fff);
    top: 0;
    left: 0;
    height: 100%;
    width: 400px;
    max-width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    z-index: 99999;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
    overflow-y: auto;
    border-right: 1px solid #000;
}

.gl-categories-sidebar.sidebar-open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    z-index: 99999;
}

/* Sur tablette et mobile, sidebar plein écran */
@media (max-width: 1024px) {
    .gl-categories-sidebar {
        width: 300px;
    }
}

/* Bouton de fermeture */
.gl-categories-sidebar .close-button {
    font-size: 0;
    flex-shrink: 0;
    background-color: transparent;
    color: var(--dropdown-text-color, #000);
    border: none;
    padding: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.gl-categories-sidebar .close-button:hover {
    transform: rotate(90deg);
}

.gl-categories-sidebar .close-button svg {
    width: 18px;
    height: 18px;
}

/* Contenu de la sidebar */
.gl-categories-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 40px;
}

@media (max-width: 768px) {
    .gl-categories-content {
        padding: 30px;
    }
}

.gl-categories-wrapper {
    width: 100%;
}

.gl-categories-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 50px;
}

.gl-categories-header h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--site-heading-color, #000);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Liste des catégories */
.gl-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gl-category-item {
    margin-bottom: 5px;
}

.gl-category-item > a {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    color: var(--site-text-color, #333);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s, padding-left 0.2s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.gl-category-item > a:hover {
    color: #000;
    padding-left: 5px;
}

/* Sous-catégories (niveau 2) */
.gl-subcategories-list {
    list-style: none;
    margin: 10px 0 15px 20px;
    padding: 0;
}

.gl-subcategory-item {
    margin-bottom: 3px;
}

.gl-subcategory-item a {
    display: block;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--site-text-color, #666);
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
}

.gl-subcategory-item a:hover {
    color: #000;
    padding-left: 5px;
}

/* Lien "Voir tout" */
.gl-subcategory-item.gl-view-all a {
    font-weight: 600;
    color: #000;
}

/* Compteur de produits (optionnel) */
.gl-category-count,
.gl-subcategory-count {
    font-size: 0.85rem;
    color: #999;
    margin-left: 5px;
}

/* Style pour le lien actif */
.gl-category-item.active > a,
.gl-subcategory-item.active a {
    color: #000;
    font-weight: 700;
}

/* Animation d'ouverture des sous-catégories */
.gl-subcategories-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.gl-category-item.has-children.open .gl-subcategories-list {
    max-height: 1000px;
}

/* Icône pour les catégories avec enfants */
.gl-category-item.has-children > a::after {
    content: "+";
    float: right;
    font-weight: 700;
    transition: transform 0.3s;
}

.gl-category-item.has-children.open > a::after {
    transform: rotate(45deg);
}
