/* WooCommerce Product Filters - Styles */

.wpf-filters-wrapper {
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.wpf-filter-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.wpf-filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.wpf-filter-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 4px solid #0073aa;
    padding-left: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpf-section-toggle {
    display: none;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s ease;
    user-select: none;
}

/* Categorie */
.wpf-category-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.wpf-category-list ul ul {
    padding-left: 15px;
    display: none;
    margin-top: 5px;
    border-left: 2px solid #e8e8e8;
}

.wpf-category-list ul ul.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpf-category-item {
    margin: 5px 0;
    position: relative;
}

.wpf-category-toggle {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    font-weight: bold;
    color: #fff;
    background: #0073aa;
    border-radius: 4px;
    user-select: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.wpf-category-toggle.wpf-category-expandable {
    cursor: pointer;
}

.wpf-category-toggle.wpf-category-expandable:hover {
    background: #005a87;
    transform: scale(1.1);
}

.wpf-category-toggle.wpf-category-leaf {
    cursor: default;
    font-weight: normal;
}

.wpf-category-item label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.wpf-category-item label:hover {
    background: #f8f9fa;
}

.wpf-category-item input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0073aa;
}

.wpf-category-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
}

/* Brand */
.wpf-brand-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.wpf-brand-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    cursor: pointer;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.wpf-brand-label:hover {
    border-color: #0073aa;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.15);
}

.wpf-brand-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0073aa;
}

.wpf-brand-label input[type="checkbox"]:checked + .wpf-brand-name {
    color: #0073aa;
    font-weight: 600;
}

.wpf-brand-name {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

/* Prezzo */
.wpf-price-inputs {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 400px;
}

.wpf-price-inputs input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.wpf-price-inputs input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

/* Indicatore che il prezzo è in attesa di conferma */
.wpf-price-inputs input.wpf-price-pending {
    border-color: #f0ad4e;
    background-color: #fffcf5;
}

.wpf-price-inputs input.wpf-price-pending:focus {
    border-color: #f0ad4e;
    box-shadow: 0 0 0 3px rgba(240,173,78,0.15);
}

/* Hint per l'utente */
.wpf-price-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    font-style: italic;
}

/* Pulsante Applica prezzo */
.wpf-price-apply {
    padding: 12px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.wpf-price-apply:hover {
    background-color: #005a87;
}

.wpf-price-apply:active {
    transform: scale(0.98);
}

.wpf-price-separator {
    color: #999;
    font-weight: bold;
    font-size: 18px;
}

/* Pulsanti */
.wpf-filter-reset {
    padding: 14px 30px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f5f5f5;
    color: #555;
}

.wpf-filter-reset:hover {
    background: #e8e8e8;
    border-color: #ccc;
    transform: translateY(-2px);
}

/* Filtri Attivi */
.wpf-active-filters {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.wpf-active-filters-title {
    font-weight: 700;
    font-size: 15px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpf-active-filters-list {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.wpf-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #0073aa;
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: default;
}

.wpf-active-filter:hover {
    background: #005a87;
}

.wpf-remove-filter {
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-weight: bold;
}

.wpf-remove-filter:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wpf-clear-all-filters {
    padding: 8px 16px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpf-clear-all-filters:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    /* Riduzione margini e padding */
    .wpf-filters-wrapper {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    .wpf-filter-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .wpf-filter-section:last-of-type {
        margin-bottom: 10px;
    }
    
    .wpf-brand-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .wpf-brand-label {
        padding: 10px 12px;
    }
    
    .wpf-price-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .wpf-price-inputs input {
        padding: 10px 12px;
    }
    
    .wpf-active-filters {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        margin-bottom: 20px;
        gap: 10px;
    }
    
    .wpf-active-filters-list {
        width: 100%;
        gap: 8px;
    }
    
    .wpf-active-filter {
        padding: 6px 12px;
    }
    
    .wpf-filter-reset {
        padding: 12px 24px;
        margin-top: 15px;
    }
    
    /* Toggle sezioni su mobile */
    .wpf-section-toggle {
        display: inline-block;
    }
    
    /* Per il filtro solo categorie: chiuso di default su mobile */
    .wpf-categories-only .wpf-filter-section {
        border-bottom: 1px solid #e5e5e5;
    }
    
    .wpf-categories-only .wpf-filter-section.collapsed .wpf-section-toggle {
        transform: rotate(-90deg);
    }
    
    .wpf-categories-only .wpf-filter-section.collapsed .wpf-filter-content {
        display: none;
    }
    
    /* Altri filtri comportamento normale */
    .wpf-filter-section.collapsed .wpf-section-toggle {
        transform: rotate(-90deg);
    }
    
    .wpf-filter-section.collapsed .wpf-filter-content {
        display: none;
    }
    
    .wpf-filter-title {
        cursor: pointer;
        font-size: 16px;
        margin-bottom: 12px;
        letter-spacing: 0.3px;
        padding-left: 10px;
        border-left-width: 3px;
        text-transform: none;
        word-break: break-word;
        line-height: 1.3;
    }
    
    .wpf-section-toggle {
        font-size: 12px;
    }
    
    .wpf-category-toggle {
        font-size: 14px;
        width: 22px;
        height: 22px;
        line-height: 20px;
    }
    
    .wpf-category-name {
        font-size: 12px;
        line-height: 1.4;
        word-break: break-word;
    }
    
    .wpf-category-item label {
        gap: 6px;
        padding: 4px 6px;
    }
    
    .wpf-category-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .wpf-brand-name {
        font-size: 13px;
    }
    
    .wpf-brand-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .wpf-price-inputs input {
        font-size: 14px;
    }
    
    .wpf-price-separator {
        font-size: 16px;
    }
    
    .wpf-filter-reset {
        font-size: 14px;
    }
    
    .wpf-active-filters-title {
        font-size: 14px;
    }
    
    .wpf-active-filter {
        font-size: 12px;
    }
    
    .wpf-remove-filter {
        font-size: 18px;
    }
    
    .wpf-clear-all-filters {
        font-size: 12px;
        padding: 7px 14px;
    }
}
