/**
 * Filters CSS
 * 
 * Stili per filtri dello shop (top e sidebar)
 */

/* ===================================
   FILTRI TOP SHOP
   =================================== */

.shop-filters-top {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    margin: 0 0 30px 0;
}

.shop-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input[type="number"]:focus {
    outline: none;
    border-color: #942b25;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Checkbox Pronta Consegna */
.filter-checkbox {
    display: flex;
    align-items: center;
    min-width: auto;
}

.filter-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    text-transform: none;
    font-weight: 500;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff6b35;
}

/* Azioni filtri */
.filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filter-actions .button {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.filter-actions button[type="submit"] {
    background: #942b25;
    color: #fff;
}

.filter-actions button[type="submit"]:hover {
    background: #70231d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.filter-actions .button-secondary {
    background: #6c757d;
    color: #fff;
}

.filter-actions .button-secondary:hover {
    background: #5a6268;
}

/* ===================================
   FILTRI SIDEBAR
   =================================== */

.vehicle-sidebar-filters {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.filter-section {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #942b25;
}

/* Lista filtri */
.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-item {
    margin: 0 0 10px 0;
    padding: 0;
}

.filter-item:last-child {
    margin-bottom: 0;
}

.filter-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-item a:hover {
    background: #e9ecef;
    color: #942b25;
    transform: translateX(5px);
}

.filter-item.active a {
    background: #942b25;
    color: #fff;
    font-weight: 600;
}

.filter-item .count {
    font-size: 12px;
    opacity: 0.7;
}

/* Lista scrollabile */
.filter-list-scrollable {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.filter-list-scrollable::-webkit-scrollbar {
    width: 6px;
}

.filter-list-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-list-scrollable::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.filter-list-scrollable::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form filtri sidebar */
.filter-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-form select:focus {
    outline: none;
    border-color: #942b25;
}

/* Checkbox group sidebar */
.filter-checkbox-group {
    margin: 0;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.filter-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff6b35;
}

/* Pulsante reset filtri */
.button-reset-filters {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #dc3545;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* ===================================
   FILTRI ATTIVI (badge)
   =================================== */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px 0;
    padding: 15px;
    background: #fff9e6;
    border: 1px solid #ffe066;
    border-radius: 6px;
}

.active-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
}

.active-filter-badge .remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s ease;
}

.active-filter-badge .remove-filter:hover {
    background: #c82333;
}

/* ===================================
   WIDGET SIDEBAR
   =================================== */

.widget.widget_vehicle_filters_widget {
    margin-bottom: 30px;
}

.widget.widget_vehicle_filters_widget .widget-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #942b25;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 992px) {
    .shop-filters-form {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
        min-width: auto;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-actions .button {
        flex: 1;
    }
}

@media (max-width: 576px) {
    .shop-filters-top {
        padding: 20px 15px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .button {
        width: 100%;
    }
    
    .vehicle-sidebar-filters {
        margin-top: 30px;
    }
}

/* ===================================
   LOADING STATE
   =================================== */

.filters-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.filters-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #942b25;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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