.easy-filter-widget {
    background: #fff;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    margin-bottom: 20px;
}

.easy-filter-widget .filter-title {
    margin: 4px 0 10px 0;
    padding: 0 0 4px 0;
    border-bottom: 2px solid #000000;
 
    font-weight: 900;
    text-transform: uppercase;
}

.filter-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f1f1;
}

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

.filter-group h4 {
    margin: 14px 0 12px 0;
    font-size: 14px !important;
    font-weight: 900;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group h5 {
    margin: 10px 0 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.filter-group label:hover {
    color: #000000;
}

.filter-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.attribute-group {
  
}

.attribute-group h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.attribute-group label {
    margin-bottom: 6px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 12px;
}

.attribute-group label:hover {
    background: #f0f8ff;
    border-color: #000;
    color: #000;
}

.attribute-group input[type="checkbox"]:checked + span {
    color: #000;
    font-weight: 500;
}

.price-filter {
    position: relative;
}

.price-filter #price-slider {
            margin: 8px 14px 10px 16px;
    height: 8px;
    background: #f1f1f1;
    border-radius: 4px;
}

.price-filter .ui-slider-range {
    background: #000;
    border-radius: 4px;
    height: 8px;
    border: none;
}

.price-filter .ui-slider-handle {
    width: 18px;
    height: 18px;
    background: #000;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    top: -6px;
}

.price-filter .ui-slider-handle:hover {
    background: #005a87;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.price-inputs input[type="number"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}

.price-inputs input[type="number"]:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 1px #000;
}

.filter-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.filter-submit, .filter-reset {
    padding: 10px 16px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.filter-submit {
    background: #000;
    color: #fff;
    flex: 1;
}

.filter-submit:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.filter-reset {
    background: #666;
    color: #fff;
    flex: 0 0 auto;
}

.filter-reset:hover {
    background: #444;
}

#filter-loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #666;
}

@media (max-width: 768px) {
    .easy-filter-widget {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .easy-filter-widget .filter-title {
        margin-bottom: 12px;
        font-size: 16px;
    }
    
    .filter-buttons {
        flex-direction: column;
        gap: 6px;
        margin-top: 12px;
    }
    
    .filter-reset {
        flex: 1;
    }
}

.easy-filter-widget input[type="checkbox"]:checked + label {
    color: #000;
    font-weight: 500;
}

.easy-filter-widget .filter-group label:first-child {
    margin-top: 5px;
}

.easy-filter-widget .no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Divi Integration Styles */
.et_pb_section .easy-filter-widget {
    margin-bottom: 30px;
}

.et-db .easy-filter-widget {
    font-family: inherit;
}

.et_pb_wc_products .products li.product,
.et_pb_shop .products li.product {
    margin-bottom: 30px !important;
}

/* Better Divi sidebar integration */
.et_pb_widget_area .easy-filter-widget {
    background: transparent;
    border: none;
    padding: 0;
}

.et_pb_widget_area .easy-filter-widget .filter-title {
    font-size: 16px;
    color: inherit;
    border-bottom-color: currentColor;
}

/* Responsive fixes for Divi */
@media (max-width: 980px) {
    .et_pb_section .easy-filter-widget {
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .et_pb_widget_area .easy-filter-widget {
        margin-bottom: 15px;
    }
}

/* Custom Product Listing Styles - Minimal wrapper only */
.easy-products-wrapper {
    margin-top: 20px;
    width: 100%;
}

/* Let WooCommerce handle all product styling */

/* Pagination styles */
.easy-products-wrapper .woocommerce-pagination {
    text-align: center;
    margin-top: 40px;
    clear: both;
}

.easy-products-wrapper .woocommerce-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.easy-products-wrapper .woocommerce-pagination .page-numbers:hover,
.easy-products-wrapper .woocommerce-pagination .page-numbers.current {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Improved attribute display */
.attribute-group .attribute-terms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.attribute-group .attribute-terms label {
    margin: 0;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Filter Styles */
@media (max-width: 768px) {
    /* Mobile filter toggle */
    .easy-filter-widget {
        position: relative;
    }
    
    .attribute-group .attribute-terms {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .easy-filter-widget .filter-title {
        cursor: pointer;
        position: relative;
        padding-right: 30px;
        user-select: none;
           font-size: 13px !important;
    }
    
    .easy-filter-widget .filter-title:after {
        content: '▼';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.3s ease;
        font-size: 12px;
    }
    
    .easy-filter-widget.collapsed .filter-title:after {
        transform: translateY(-50%) rotate(-90deg);
    }
    
    .easy-filter-widget #easy-filter-form {
        max-height: 1000px;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }
    
    .easy-filter-widget.collapsed #easy-filter-form {
        max-height: 0;
        opacity: 0;
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
    }
    
    /* Compact mobile filter groups */
    .filter-group {
        margin-bottom: 8px;
        padding-bottom: 6px;
        border-bottom: 1px solid #f1f1f1;
    }
    
    .filter-group:last-child {
        margin-bottom: 0;
        border-bottom: none;
    }
    
    .filter-group h4 {
        font-size: 13px;
        margin-bottom: 4px;
        cursor: pointer;
        position: relative;
        padding-right: 25px;
        user-select: none;
    }
    
    .filter-group h4:after {
        content: '+';
        position: absolute;
        right: 0;
        font-size: 16px;
        font-weight: bold;
        transition: all 0.2s ease;
        color: #666;
        width: 20px;
        height: 20px;
        text-align: center;
        line-height: 18px;
        border-radius: 3px;
        background: rgba(0,0,0,0.05);
    }
    
    .filter-group.expanded h4:after {
        content: '−';
        color: #000;
        background: rgba(0,0,0,0.1);
    }
    
    .filter-group .filter-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
        opacity: 0;
    }
    
    .filter-group.expanded .filter-content {
        max-height: 300px;
        opacity: 1;
        transition: max-height 0.3s ease-in, opacity 0.3s ease-in;
    }
    
    .filter-group label {
        font-size: 12px;
        margin-bottom: 3px;
        padding: 6px 5px;
        border-radius: 3px;
        transition: background-color 0.2s ease;
        cursor: pointer;
        display: flex;
        align-items: center;
        min-height: 28px;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
    
    .filter-group label:hover,
    .filter-group label:active {
        background-color: rgba(0, 115, 170, 0.1);
    }
    
    .filter-group input[type="checkbox"] {
        transform: scale(1.2);
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .price-inputs {
        display: flex !important;
        flex-direction: column;
        gap: 4px;
        margin-top: 6px;
        visibility: visible !important;
    }
    
    .price-inputs input[type="number"] {
        display: block !important;
        padding: 5px 8px;
        font-size: 11px;
        height: 30px;
        width: 100%;
        visibility: visible !important;
    }
    
    .filter-buttons {
        flex-direction: row;
        gap: 6px;
        margin-top: 10px;
    }
    
    .filter-submit, .filter-reset {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 32px;
    }
    
    /* Products responsive layout */
    .easy-products-wrapper .woocommerce-ordering {
        float: none;
        margin-bottom: 15px;
    }
    
    .easy-products-wrapper .woocommerce-ordering select {
        font-size: 13px;
        padding: 6px 10px;
    }
    
}

@media (max-width: 480px) {
    /* Attribute groups mobile optimization */
    .attribute-group {
        margin: 8px 0 6px 0;
        padding: 8px;
    }
    
    .attribute-group h5 {
        margin: 0 0 6px 0;
        font-size: 12px;
        padding-bottom: 3px;
    }
    
    .attribute-group .attribute-terms {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 4px;
        margin-top: 4px;
    }
    
    .attribute-group .attribute-terms label {
        padding: 5px 6px;
        font-size: 10px;
        min-height: 24px;
        margin: 0;
    }
    
    /* Price filter mobile */
    .price-filter {
        margin-bottom: 8px;
    }
    
    .price-filter #price-slider {
              margin: 8px 14px 10px 16px;
    }
    
    /* Mobile filter styles only - let WooCommerce handle products */
}



@media (max-width: 480px) {
    /* Ultra-compact mobile styles */
    .easy-filter-widget {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .easy-filter-widget .filter-title {
        margin-bottom: 8px;
        font-size: 15px;
    }
    
    .filter-group {
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .filter-group h4 {
        margin-bottom: 3px;
        font-size: 12px;
    }
    
    .filter-group label {
        margin-bottom: 2px;
        padding: 4px 5px;
        min-height: 24px;
        font-size: 11px;
    }
    
    .attribute-group {
        margin: 6px 0 4px 0;
        padding: 6px;
    }
    
    .attribute-group h5 {
        margin-bottom: 4px;
        font-size: 11px;
    }
    
    .attribute-group .attribute-terms {
        gap: 3px;
        margin-top: 3px;
    }
    
    .attribute-group .attribute-terms label {
        padding: 4px 5px;
        font-size: 9px;
        min-height: 20px;
    }
    
    .filter-buttons {
        gap: 4px;
        margin-top: 8px;
    }
    
    .filter-submit, .filter-reset {
        padding: 5px 8px;
        font-size: 10px;
        min-height: 28px;
    }
    
    .price-inputs {
        display: flex !important;
        flex-direction: column;
        gap: 3px;
        margin-top: 4px;
        visibility: visible !important;
    }
    
    .price-inputs input[type="number"] {
        display: block !important;
        padding: 4px 6px;
        font-size: 10px;
        height: 26px;
        width: 100%;
        visibility: visible !important;
    }
}

/* Loading state for products wrapper */
.easy-products-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

.easy-products-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

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