/* Layout Principale Desktop per Shop, Categorie e Pagina di Ricerca */ 
.woocommerce-page .site-main, 
main.wp-block-group,
body.search-results .site-main,
body.search-results main,
body.search main.wp-block-group { 
    display: grid !important; 
    grid-template-columns: 260px 1fr; 
    gap: 2rem; 
    align-items: start; 
}

/* Stili Sidebar Generali */ 
.custom-shop-sidebar { 
    background: #f9f9f9; 
    padding: 1.5rem; 
    border-radius: 8px; 
    border: 1px solid #e5e5e5; 
    grid-column: 1; /* Forzo la posizione nella prima colonna della griglia */
}

.mobile-sidebar-toggle { display: none; }
.sidebar-section { margin-bottom: 2rem; }
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-title { font-size: 1.1rem; margin-bottom: 1rem; border-bottom: 2px solid #ddd; padding-bottom: 0.5rem; }

/* Accordion Categorie */ 
.cat-accordion-list, .subcat-list { list-style: none !important; padding: 0 !important; margin: 0 !important; } 
.cat-item { margin-bottom: 0.75rem; } 
.cat-header { display: flex; justify-content: space-between; align-items: center; } 
.cat-header a { text-decoration: none; color: #333; font-weight: 600; } 
.cat-accordion-list a.active-cat { color: #007cba !important; font-weight: 700 !important; } 

.toggle-btn { background: transparent; border: none; cursor: pointer; width: 24px; height: 24px; position: relative; } 
.toggle-btn::after { content: "+"; font-size: 16px; font-weight: bold; } 
.cat-item.open > .cat-header > .toggle-btn::after { content: "-"; } 

/* REGOLA ACCORDION: Nasconde le sottocategorie di default */
.custom-shop-sidebar .subcat-list { 
    display: none !important; 
    padding-left: 1rem !important; 
    margin-top: 0.5rem !important; 
} 

.custom-shop-sidebar .cat-item.open > .subcat-list { display: block !important; } 
.subcat-list li { margin-bottom: 0.4rem; } 
.subcat-list a { text-decoration: none; color: #666; font-size: 0.9em; }

/* COLONNE PRODOTTI SHOP E RISULTATI DI RICERCA */ 
ul.products { 
    display: grid !important; 
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 1.5rem !important; 
} 
ul.products::before, ul.products::after { display: none !important; } 
ul.products li.product { width: 100% !important; margin: 0 !important; }

/* MEDIA QUERY RESPONSIVE */ 
@media (max-width: 768px) { 
    .woocommerce-page .site-main, 
    main.wp-block-group,
    body.search-results .site-main,
    body.search-results main { 
        grid-template-columns: 1fr; 
    }
    
    ul.products { grid-template-columns: repeat(2, 1fr) !important; }
    
    .custom-shop-sidebar { padding: 0.75rem 1rem; margin-bottom: 1.5rem; }
    .mobile-sidebar-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; font-size: 1rem; font-weight: bold; padding: 0.5rem 0; cursor: pointer; color: #333; }

    .sidebar-content-wrapper { display: none; padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid #ddd; }
    .sidebar-content-wrapper.active { display: block; } 
} 
