.custom-product-filters {
    margin-bottom: 30px;
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-dropdown {
    position: relative;
    min-width: 200px;
}

.filter-toggle {
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-toggle:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.filter-toggle.active {
    border-color: #0073aa;
    background: #f0f8ff;
}

.filter-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.filter-toggle.active svg {
    transform: rotate(180deg);
}

.selected-count {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: none;
}

.selected-count.visible {
    display: inline-block;
}

.filter-dropdown-content {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 350px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.filter-dropdown-content.active {
    display: block;
}

.filter-search {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
    user-select: none;
}

.filter-option:hover {
    background: #f5f5f5;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-option span {
    font-size: 14px;
    color: #333;
}

.filter-reset {
    padding: 12px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.filter-reset:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.filter-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e3f2fd;
    color: #0073aa;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.filter-tag-remove {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 18px;
    line-height: 1;
}

.filter-loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-products {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

/* LAYOUT PRODOTTI - Lista verticale come Elementor */
.products-grid {
    display: block !important;
    width: 100%;
}

/* FORZA IL LAYOUT A UNA COLONNA - Override Elementor */
#products-container.products-grid {
    display: block !important;
    grid-template-columns: none !important;
}

#products-container .e-loop-item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
	border-bottom: 1px solid var(--e-global-color-secondary);
}

/* Forza il container a prendere tutta la larghezza */
#products-container .elementor-16796 {
    width: 100% !important;
    display: block !important;
}

#products-container .elementor-section {
    width: 100% !important;
}

#products-container .elementor-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Le colonne interne devono essere in fila orizzontale */
#products-container .elementor-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
}

#products-container .elementor-column {
    display: flex !important;
    flex-direction: column !important;
}

/* Larghezze specifiche per ogni colonna */
#products-container .elementor-col-20 {
    width: 20% !important;
    max-width: 20% !important;
    flex: 0 0 20% !important;
}

/* Intestazione Tabella Prodotti */
.products-table-header {
    display: flex;
    align-items: center;
    color: var( --e-global-color-accent );
    padding: 15px 20px;
    margin-bottom: 0;
    font-weight: 700;
    font-size: 24px;
    border-bottom: 2px solid var(--e-global-color-secondary, #000);
}

.header-column {
    padding: 0 15px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.header-product {
    width: 20%;
    flex: 0 0 20%;
}

.header-material {
    width: 20%;
    flex: 0 0 20%;
}

.header-dimension {
    width: 20%;
    flex: 0 0 20%;
}

.header-price {
    width: 20%;
    flex: 0 0 20%;
    justify-content: flex-end;
}

.header-action {
    width: 20%;
    flex: 0 0 20%;
}

/* Ogni prodotto è una riga completa */
.e-loop-item {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
}

/* Larghezze fisse delle colonne */
.elementor-16796 .elementor-element.elementor-element-eafb0fb {
    width: 20% !important;
    flex: 0 0 20% !important;
}

.elementor-16796 .elementor-element.elementor-element-material {
    width: 20% !important;
    flex: 0 0 20% !important;
}

.elementor-16796 .elementor-element.elementor-element-dimension {
    width: 20% !important;
    flex: 0 0 20% !important;
}

.elementor-16796 .elementor-element.elementor-element-d12fa47 {
    width: 20% !important;
    flex: 0 0 20% !important;
}

.elementor-16796 .elementor-element.elementor-element-d189890 {
    width: 20% !important;
    flex: 0 0 20% !important;
}

/* Stili per le colonne Materiale e Dimensione - PIÙ PADDING */
.product-categories,
.product-dimension {
    margin: 0;
    padding: 0px 25px;
    font-size: 16px;
    color: #333;
    line-height: 1.5;
}

/* Aumenta il padding verticale per tutte le colonne prodotto */
#products-container .elementor-widget-container {
    padding-top: 25px !important;
    padding-bottom: 25px !important;
}

/* Padding specifico per il titolo */
#products-container .elementor-element-08d1f1c .elementor-widget-container {
    padding: 25px 15px !important;
}

/* Padding per il prezzo */
#products-container .elementor-element-2752642 .elementor-widget-container {
    padding: 25px 40px 25px 15px !important;
}

/* Padding per il bottone */
#products-container .elementor-element-e598817 .elementor-widget-container {
    padding: 25px 15px !important;
}

/* Assicura che la section prenda tutta la larghezza */
.elementor-16796 .elementor-element.elementor-element-0b64306 {
    width: 100% !important;
}

.elementor-16796 .elementor-container {
    width: 100% !important;
    max-width: 100% !important;
}

/* Responsive per mobile */
@media (max-width: 768px) {
    .products-table-header {
        display: none;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-dropdown {
        min-width: 100%;
    }
    
    /* Su mobile le colonne diventano verticali */
    .elementor-16796 .elementor-row {
        flex-direction: column !important;
    }
    
    #products-container .elementor-row {
        flex-direction: column !important;
    }
    
    .elementor-16796 .elementor-element.elementor-element-eafb0fb,
    .elementor-16796 .elementor-element.elementor-element-material,
    .elementor-16796 .elementor-element.elementor-element-dimension,
    .elementor-16796 .elementor-element.elementor-element-d12fa47,
    .elementor-16796 .elementor-element.elementor-element-d189890 {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    #products-container .elementor-col-20 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    .product-categories::before {
        content: "Materiale: ";
        font-weight: 700;
    }
    
    .product-dimension::before {
        content: "Dimensione: ";
        font-weight: 700;
    }
    
    .header-column {
        font-size: 14px;
        padding: 0 10px;
    }
}

.add_to_cart_button {
    color: var( --e-global-color-accent );
    font-size: 22px;
	font-weight: 700;
}

.price {
	text-align: right;
}

/* Stile per il link "Visualizza carrello" dopo l'aggiunta al carrello */
#products-container .added_to_cart {
    display: block !important;
    margin-top: 10px !important;
    color: #000 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.3s ease !important;
}

#products-container .added_to_cart:hover {
    color: #333 !important;
    text-decoration: underline !important;
}

/* Aggiungi la freccia con un'icona */
#products-container .added_to_cart::after {
    content: " →" !important;
    display: inline !important;
    margin-left: 5px !important;
    font-size: 16px !important;
}

/* Oppure con una freccia SVG più elegante */
#products-container .added_to_cart::after {
    content: "" !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    margin-left: 8px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    vertical-align: middle !important;
}