/**
 * YITH Proteo Ajax Filters
 *
 * @package yith-proteo
 */

/* Filter Widgets */
.yith-proteo-filter-widget {
    margin-bottom: 24px;
    padding: 16px;
    background-color: #f8f8f8;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.yith-proteo-filter-widget h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 8px;
}

/* Category Filters */
.yith-proteo-filter-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yith-proteo-filter-category li {
    margin-bottom: 8px;
}

.yith-proteo-filter-category input[type="checkbox"] {
    margin-right: 8px;
}

.yith-proteo-filter-category label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.2s ease;
}

.yith-proteo-filter-category label:hover {
    color: #2a73cc;
}

.yith-proteo-filter-category label input[type="checkbox"] {
    flex-shrink: 0;
}

/* Attribute Filters */
.yith-proteo-filter-attribute {
    margin-bottom: 20px;
}

.yith-proteo-filter-attribute ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.yith-proteo-filter-attribute li {
    margin-bottom: 8px;
}

.yith-proteo-filter-attribute input[type="checkbox"] {
    margin-right: 8px;
}

.yith-proteo-filter-attribute label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.2s ease;
}

.yith-proteo-filter-attribute label:hover {
    color: #2a73cc;
}

/* Color Swatches */
.yith-proteo-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.yith-proteo-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.yith-proteo-color-swatch:hover {
    transform: scale(1.1);
}

.yith-proteo-color-swatch.active {
    border-color: #2a73cc;
    box-shadow: 0 0 0 2px rgba(42, 115, 204, 0.2);
}

/* Price Filter */
.yith-proteo-filter-price {
    margin-bottom: 20px;
}

.yith-proteo-price-slider {
    margin: 20px 0;
}

.yith-proteo-price-slider .ui-slider {
    position: relative;
    text-align: left;
    background: #e5e5e5;
    height: 6px;
    border-radius: 3px;
}

.yith-proteo-price-slider .ui-slider-handle {
    position: absolute;
    z-index: 2;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -6px;
    background: #2a73cc;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.yith-proteo-price-slider .ui-slider-handle:hover {
    background: #1a56a1;
    transform: scale(1.1);
}

.yith-proteo-price-slider .ui-slider-range {
    position: absolute;
    z-index: 1;
    height: 100%;
    background: #2a73cc;
    border-radius: 3px;
}

.yith-proteo-price-values {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
    margin-top: 12px;
}

.yith-proteo-price-values span {
    font-weight: 600;
}

.yith-proteo-price-inputs {
    display: none;
}

/* Clear Filters Button */
.yith-proteo-clear-filters {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 16px;
    background-color: #f1f1f1;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
}

.yith-proteo-clear-filters:hover {
    background-color: #e5e5e5;
    color: #333;
    border-color: #ccc;
}

/* Loading State */
.filter-loading {
    position: relative;
    opacity: 0.6;
}

.yith-proteo-filter-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.yith-proteo-filter-loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(42, 115, 204, 0.2);
    border-top-color: #2a73cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Filter Results Count */
.woocommerce-result-count {
    margin-bottom: 16px;
    font-size: 14px;
    color: #666;
}

/* Active Filters */
.yith-proteo-active-filters {
    margin-bottom: 20px;
    padding: 12px;
    background-color: #e8f0fe;
    border: 1px solid #d1e0fe;
    border-radius: 4px;
}

.yith-proteo-active-filters h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2a73cc;
}

.yith-proteo-active-filters ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yith-proteo-active-filter {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #fff;
    border: 1px solid #d1e0fe;
    border-radius: 16px;
    font-size: 13px;
    color: #2a73cc;
}

.yith-proteo-active-filter .remove-filter {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: color 0.2s ease;
}

.yith-proteo-active-filter .remove-filter:hover {
    color: #333;
}

/* Responsive Design */
@media (max-width: 767px) {
    .yith-proteo-filter-widget {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .yith-proteo-filter-widget h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .yith-proteo-filter-category label,
    .yith-proteo-filter-attribute label {
        font-size: 13px;
    }
    
    .yith-proteo-color-swatches {
        gap: 6px;
    }
    
    .yith-proteo-color-swatch {
        width: 20px;
        height: 20px;
    }
    
    .yith-proteo-price-values {
        font-size: 13px;
    }
    
    .yith-proteo-clear-filters {
        width: 100%;
        text-align: center;
        font-size: 13px;
        padding: 10px;
    }
    
    .yith-proteo-active-filters ul {
        flex-direction: column;
        gap: 6px;
    }
    
    .yith-proteo-active-filter {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .yith-proteo-filter-widget {
        padding: 10px;
    }
    
    .yith-proteo-filter-widget h3 {
        font-size: 14px;
    }
    
    .yith-proteo-price-slider {
        margin: 15px 0;
    }
}

/* WooCommerce Compatibility */
.woocommerce .yith-proteo-filter-widget {
    margin-bottom: 24px;
}

.woocommerce .yith-proteo-filter-widget:last-child {
    margin-bottom: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .yith-proteo-filter-widget {
        background-color: #fff;
        border: 1px solid #000;
    }
    
    .yith-proteo-filter-widget h3 {
        border-bottom-color: #000;
    }
    
    .yith-proteo-price-slider .ui-slider {
        background: #ccc;
    }
    
    .yith-proteo-price-slider .ui-slider-range {
        background: #000;
    }
    
    .yith-proteo-clear-filters {
        border-color: #000;
        background-color: #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .yith-proteo-color-swatch {
        transition: none;
    }
    
    .yith-proteo-color-swatch:hover {
        transform: none;
    }
    
    .yith-proteo-price-slider .ui-slider-handle {
        transition: none;
    }
    
    .yith-proteo-clear-filters {
        transition: none;
    }
    
    .yith-proteo-filter-loader .spinner {
        animation: none;
    }
}
