/**
 * Simple Filters CSS - Sophisticated Design
 */

.sf-filters-wrapper {
    background: transparent;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    z-index: 100;
}

/* Fix for archive pages - brand/category/taxonomy pages */
.archive .sf-filters-wrapper,
.tax-product_cat .sf-filters-wrapper,
.tax-product_brand .sf-filters-wrapper,
.tax-pa_brand .sf-filters-wrapper,
.post-type-archive-product .sf-filters-wrapper {
    z-index: 999 !important;
    position: relative !important;
}

/* Ensure filters are clickable on archive pages */
.archive .sf-filter-block,
.tax-product_cat .sf-filter-block,
.tax-product_brand .sf-filter-block,
.tax-pa_brand .sf-filter-block,
.post-type-archive-product .sf-filter-block {
    position: relative;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

/* Fix filter content on archive pages */
.archive .sf-filter-content,
.tax-product_cat .sf-filter-content,
.tax-product_brand .sf-filter-content,
.tax-pa_brand .sf-filter-content {
    position: relative;
    z-index: 1001 !important;
    pointer-events: auto !important;
}

/* Fix Elementor column stacking on archive pages */
.archive .elementor-column.elementor-col-20,
.tax-product_cat .elementor-column.elementor-col-20,
.tax-product_brand .elementor-column.elementor-col-20,
.tax-pa_brand .elementor-column.elementor-col-20 {
    position: relative !important;
    z-index: auto !important;
}

/* Ensure sidebar stays on left on archive pages */
.archive .elementor-widget-sidebar,
.tax-product_cat .elementor-widget-sidebar,
.tax-product_brand .elementor-widget-sidebar,
.tax-pa_brand .elementor-widget-sidebar {
    position: relative !important;
    float: none !important;
}

/* Performance Optimizations */
.woocommerce ul.products {
    transition: opacity 0.15s ease-in-out;
}

.woocommerce ul.products.sf-loading {
    opacity: 0.6;
}

/* Remove height limits to show all products when filtering */
.sf-filtering .elementor-widget-woocommerce-products .woocommerce,
.sf-filtering .elementor-widget-container,
.sf-filtering .woocommerce .products {
    max-height: none !important;
    overflow: visible !important;
}

/* Price Slider - Sophisticated Design */
.sf-price-wrapper {
    margin-bottom: 4px;
    padding: 8px;
    background: #fff;
}

.sf-price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sf-price-label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.5px;
    width: 100%;
}

/* Old price display removed */

.sf-price-slider {
    position: relative;
    margin-top: 10px;
    margin-bottom: 10px;
    height: 26px;
}

.sf-slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 26px;
    background: #e8ecef;
    border-radius: 13px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    box-sizing: border-box;
}

.sf-slider-range {
    position: absolute;
    height: 26px;
    background: linear-gradient(90deg, rgba(39, 174, 96, 0.75) 0%, rgba(46, 204, 113, 0.75) 100%);
    border-radius: 13px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.sf-range-input {
    position: absolute;
    width: 100%;
    height: 26px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    margin: 0;
    padding: 0;
}

/* Min/Max values inside slider */
.sf-slider-min-value,
.sf-slider-max-value {
    font-size: 11px;
    font-weight: 700;
    z-index: 10;
    pointer-events: none;
    color: #2c3e50;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sf-slider-min-value.in-range,
.sf-slider-max-value.in-range {
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.95);
}

.sf-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid #27ae60;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    position: relative;
}

.sf-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.sf-range-input::-webkit-slider-thumb:active {
    transform: scale(1.15);
    background: #f8f9fa;
}

.sf-range-input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid #27ae60;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s ease;
    border: none;
    position: relative;
}

/* Firefox specific fixes for slider alignment */
.sf-range-input::-moz-range-track {
    background: transparent;
    border: none;
    height: 26px;
}

/* Filter Blocks */
.sf-filter-block {
    background: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.sf-filter-block:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sf-filter-title {
    padding: 4px 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.sf-filter-title:hover {
    background: #e9ecef;
}

.sf-toggle {
    font-size: 18px;
    color: #6c757d;
    transition: transform 0.2s ease;
}

.sf-filter-content {
    padding: 6px 10px;
    background: #fff;
}

/* Categories */
.sf-category-item {
    margin-bottom: 1px;
    padding-left: 8px;
}

.sf-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.sf-category-header:hover {
    background: #f0f0f0;
    padding-left: 8px;
}

.sf-category-header.sf-selected {
    background: #e8f5e9;
    color: #27ae60;
    font-weight: 600;
    padding-left: 8px;
}

.sf-category-name {
    font-size: 15px;
    line-height: 1.4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sf-expand-icon {
    font-size: 14px;
    color: #6c757d;
    margin-left: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
}

.sf-category-header:hover .sf-expand-icon {
    color: #27ae60;
}

.sf-children {
    padding-left: 20px;
    margin-top: 3px;
}

.sf-child-item {
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-bottom: 1px;
}

.sf-child-item:hover {
    background: #f0f0f0;
    padding-left: 12px;
}

.sf-child-item.sf-selected {
    background: #e8f5e9;
    color: #27ae60;
    font-weight: 600;
    padding-left: 12px;
}

/* Brands */
.sf-brand-item {
    padding: 4px 8px;
    padding-left: 16px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-bottom: 1px;
}

.sf-brand-item:hover {
    background: #f0f0f0;
    padding-left: 22px;
}

.sf-brand-item.sf-selected {
    background: #e8f5e9;
    color: #27ae60;
    font-weight: 600;
    padding-left: 22px;
}

/* Show More Link */
.sf-show-more-container {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
}

.sf-show-more-brands {
    color: #6c757d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: inline-block;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.sf-show-more-brands:hover {
    color: #27ae60;
    text-decoration: none;
}

/* Loading */
.sf-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    z-index: 9999;
}

.sf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #27ae60;
    border-radius: 50%;
    animation: sf-spin 1s linear infinite;
}

@keyframes sf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sf-price-wrapper {
        padding: 15px;
    }
    
    .sf-filter-title {
        font-size: 15px;
        padding: 12px;
    }
    
    .sf-children {
        padding-left: 15px;
    }
}
/* Loading Indicator */
.sf-loading {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    margin-top: 10px;
}

.sf-loading-spinner {
    color: #27ae60;
    font-size: 14px;
    font-weight: 600;
}
