/* ========================================
   Advanced Filter Widget - Modern & Clean Design
   ======================================== */

.lebasino-advanced-filter-widget {
    padding: 20px 5px;
    direction: rtl;
    font-family: inherit;
}

/* ========================================
   Active Filters Section
   ======================================== */
.filter-section.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 25px;
    align-items: center;
    flex-direction: column;
}
.active-filters-section {
    margin-bottom: 20px;
}

.active-filters-display {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-direction: column;
    padding:20px;
}

.active-filters-title {
    margin:0;
    font-size: 16px;
    font-weight: 500;
    color: #242B3D;
    display: flex;
    align-items: center;
    gap: 8px;
}

.active-filters-title i {
    color: #C83B3B;
    font-size: 16px;
}

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

.active-filter-tag {
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    animation: slideInFilter 0.3s ease-out;
    border-radius: 8px;
}

.active-filter-tag:hover {
    transform: translateY(-1px);
}

.active-filter-tag span {
    background: rgba(255,255,255,0.9);
    border: none;
    color: #C83B3B;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
}

.active-filter-tag:hover span {
transform:scale(1.05);
background:rgba(255,255,255,1)
}

.clear-all-filters {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.clear-all-filters:hover {
    background: linear-gradient(135deg, #c82333, #dc3545);
    transform: translateY(-1px);
}

@keyframes slideInFilter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Filter Sections
   ======================================== */

.filter-sections {
    display: flex;
    flex-direction: column;
    gap:30px;
}
.filter-sections .filter-section{
border-radius: 16px;
background: #FFF;
box-shadow: 0 4px 16px 0 rgba(36, 43, 61, 0.10);
    transition: all 0.3s ease;
}
.filter-header {
    padding: 16px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-header:hover {
transform: scale(1.01);
}

.filter-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    color: #242B3D;
font-family: Peyda;
font-size: 17px;
font-weight: 400;
line-height: 180%; /* 30.6px */
}

.filter-title i:first-child {
    color: #C83B3B;
    font-size: 16px;
    margin-left:5px;
}

.filter-count {
    background: #e5e7eb;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: auto;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px !important;
    color: #242B3D !important;
    position: absolute;
    left: 20px;
}

.filter-section.expanded .toggle-icon {
    transform: rotate(180deg);
}

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-section.expanded .filter-content {
    max-height: 500px;
    padding: 0 18px 18px;
}

/* ========================================
   Price Filter
   ======================================== */

.price-filter-container {
    padding-top: 10px;
}

.price_slider_wrapper {
    margin-bottom: 20px;
}

.price-separator {
    color: #9ca3af;
    font-weight: 600;
    font-size: 14px;
}

.price-labels {
    display: flex;
    flex-direction:row-reverse;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
}

.price-labels span {
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

 .price_slider_wrapper {
    margin-bottom: 15px;
    position: relative;
    gap: 25px;
    display: flex
;
    flex-direction: column;
}

 .price_slider {
    height: 4px ;
    background:rgba(207, 207, 207, 1) ;
    border-radius: 8px;
    border: none;
    position: relative;
    display: block;
    visibility: visible;
    opacity: 1 ;
    width: 100% ;
    min-height: 3px;
}

/* Force show UI slider */
 .ui-slider,
 .price_slider.ui-slider {
    display: block ;
    visibility: visible ;
    opacity: 1 ;
    position: relative ;
    height: 4px ;
}

 .price_slider_amount {
    display: flex;
    gap: 15px;
   border-radius: 8px;
    border: 1px solid rgba(36, 43, 61, 0.30);
    padding:5px 10px;
    direction:rtl;
    align-items:center;
    flex-direction:row-reverse;
}

 .price_slider_amount input[type="text"] {
    flex: 1;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: rgba(36, 43, 61, 0.9);
    position: relative;
    width: 100%;
}

 .price_slider_amount input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    color: rgba(36, 43, 61, 1);
    transform: translateY(-1px);
}

 .price_slider_amount input[type="text"]::placeholder {
    color: rgba(36, 43, 61, 0.5);
    font-weight: normal;
}

 .submit-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
 .ui-slider .ui-slider-handle {
    position: absolute;
    z-index: 2;
    width: 14px;
    height: 14px;
    cursor: grab;
    touch-action: none;
    border-radius: 50%;
    background: #fff;
    border: 2px solid rgba(200, 59, 59, 1) ;
    outline: none ;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    top: -5px;
    margin-right: -11px;
}

 .ui-slider .ui-slider-handle:hover {
    transform: scale(1.2) !important;
}

 .ui-slider .ui-slider-handle:active {
    cursor: grabbing;
    transform: scale(1.3);
}

 .ui-slider .ui-slider-range {
    position: absolute ;
    z-index: 1 ;
    font-size: .7em ;
    display: block ;
    border: 0 ;
    background: rgba(200, 59, 59, 1);
    height: 100% ;
   
}

/* Price Range Labels */
 .price-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

 .price-range-labels span {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
}


/* ========================================
   Quick Filters
   ======================================== */

.quick-filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.quick-filter-item {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.quick-filter-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.quick-filter-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 5px 10px 20px;
    background: #fff;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.quick-filter-content i {
    font-size: 16px;
    color:#C83B3B;
    transition: color 0.3s ease;
}
.quick-filter-item .checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #F0F0F0;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-filter-item:hover input ~ .checkmark {
    border-color: #C83B3B;
    transform: translateY(-50%) scale(1.1);
    border-width: 2px;
    background: #fff;
    outline:0;
}

.quick-filter-item  input:checked ~ .checkmark {
    border-color: #C83B3B;
    transform: translateY(-50%) scale(1.1);
    border-width: 3px;
    background: #fff;
    outline:0;
}

.quick-filter-item .checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.quick-filter-item input:checked ~ .checkmark:after {
    display: block;
    animation: checkmark 0.2s ease-in-out;
    outline:0;
}

@keyframes checkmark {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.quick-filter-item .checkmark:after {
    right: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #C83B3B;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}
/* ========================================
   Color Swatches
   ======================================== */

.filter-section .color-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 5px;
        justify-content: center;
    justify-items: center;
}

.filter-section .color-swatch {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.filter-section .color-swatch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-section .color-preview {
    width: 32px;
    height: 32px;
    position:relative;
    border-radius: 6px;
    border: 4px solid #fff;      
    box-shadow: 0 0 0 1px #D9D9D9;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background:#fff; 
    display: block;
}

.filter-section .color-name {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
    transition: color 0.3s ease;
}

.filter-section .color-swatch:hover .color-preview {
    transform: scale(1.1);
}

.filter-section .color-swatch.selected .color-preview {
    box-shadow: 0 0 0  1px #C83B3B;
}
/* ========================================
   Size Buttons
   ======================================== */

.filter-section .size-buttons {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, 1fr);
}

.filter-section .size-button {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.filter-section .size-button input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-section .size-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    line-height:1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-section .size-count {
    font-size: 10px;
    color: #9ca3af;
    margin-right: 4px;
}

.filter-section .size-button:hover .size-label {
    border-color:#C83B3B;
    color: rgba(200, 59, 59, 1);
}

.filter-section .size-button.selected .size-label {
    background: rgba(200, 59, 59, 1);
    border-color: rgba(200, 59, 59, 1);
    color: white;
}

.filter-section .size-button.selected .size-count {
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Attribute Checkboxes
   ======================================== */

.attribute-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.attribute-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 35px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    line-height: 1.6;
    transition: color 0.3s ease;
    font-weight: 500;
    color: #374151;
    padding: 8px 35px 8px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.attribute-checkbox:hover {
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.attribute-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.attribute-checkbox .checkmark {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.attribute-checkbox:hover input ~ .checkmark {
    border-color: #667eea;
    background-color: #f8fafc;
}

.attribute-checkbox input:checked ~ .checkmark {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: #667eea;
}

.attribute-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    right: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.attribute-checkbox input:checked ~ .checkmark:after {
    display: block;
    animation: checkmark 0.3s ease-in-out;
}

.term-count {
    font-size: 11px;
    color: #9ca3af;
    margin-right: auto;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 10px;
}

@keyframes checkmark {
    0% { opacity: 0; transform: scale(0.5) rotate(45deg); }
    100% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* ========================================
   Category Filter
   ======================================== */

.category-filter-container,.brand-filter-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 8px;
}
.filter-item {
    display: flex;
    align-items: center;
    position: relative;
    padding-right: 35px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    line-height: 1.6;
    transition: color 0.3s ease;
    font-weight: 500;
    color: #374151;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.filter-item:hover {
    color: #C83B3B;
}

.filter-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.filter-item .checkmark {
    position: absolute;
    top: 50%;
    right:5px;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #D9D9D9;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-item:hover input ~ .checkmark {
    border-color: #C83B3B;
}

.filter-item input:checked ~ .checkmark {
    border-color: #C83B3B;
}

.filter-item input:checked ~ .filter-name {
    color: #C83B3B;
}
.filter-item .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    right: 6px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #C83B3B;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.filter-item input:checked ~ .checkmark:after {
    display: block;
}

.filter-count {
    font-size: 11px;
    color: #9ca3af;
    margin-right: auto;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ========================================
   Filter Actions
   ======================================== */

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f3f4;
}

.btn-apply-filters,
.btn-reset-filters {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none;
}

.btn-apply-filters {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--box-shadow);
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-reset-filters {
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-reset-filters:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-apply-filters:active,
.btn-reset-filters:active {
    transform: translateY(0);
}

/* Loading State */
.lebasino-advanced-filter-widget.applying-filter {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.lebasino-advanced-filter-widget.applying-filter:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    z-index: 10;
}

.lebasino-advanced-filter-widget.applying-filter .btn-apply-filters {
    background: #6c757d;
    cursor: not-allowed;
}

.lebasino-advanced-filter-widget.applying-filter .btn-apply-filters:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    
    .lebasino-advanced-filter-widget {
        padding: 16px;
        border-radius: 12px;
    }

    .filter-header {
        padding: 14px 16px;
    }

    .filter-title {
        font-size: 14px;
    }

    .filter-content {
        padding: 0 16px 16px;
    }
        .filter-sections {
    gap:16px;
}
    .quick-filters-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .color-swatches {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }

    .color-preview {
        width: 28px;
        height: 28px;
    }

    .size-buttons {
        gap: 6px;
    }

    .size-label {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .filter-actions {
        flex-direction: column;
        gap: 8px;
    }

    .price_slider_amount {
        flex-direction: column;
        gap: 8px;
    }

    .price_slider_amount input[type="text"] {
        width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }

    .price-separator {
        display: none;
    }

    .active-filters-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .lebasino-advanced-filter-widget {
        padding: 12px;
    }

    .filter-header {
        padding: 12px;
    }

    .filter-content {
        padding: 0 12px 12px;
    }

    .color-swatches {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }

    .color-preview {
        width: 24px;
        height: 24px;
    }

    .color-name {
        font-size: 11px;
    }
}


/* ========================================
   Accessibility
   ======================================== */

.lebasino-advanced-filter-widget *:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.lebasino-advanced-filter-widget .checkmark:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* No products found message */
.no-products-found {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 16px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
    margin: 20px 0;
}

.no-products-found:before {
    content: "🔍";
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

.shop-filter-toolbar {
        padding: 10px 0;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .btn-toggle-filters {
        background: #007cba;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    
    .btn-toggle-filters:hover {
        background: #005a87;
        transform: translateY(-1px);
    }
    
    .btn-toggle-filters svg {
        width: 16px;
        height: 16px;
    }
    
    @media (min-width: 769px) {
        .shop-filter-toolbar {
            display: none;
        }
    }
    
        .lebasino-filter-shortcode.filter-style-horizontal {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        padding: 20px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        margin: 20px 0;
    }
    
    /* Shop Active Filters Styles */
    .shop-active-filters-wrapper {
        margin: 0 0 20px 0;
    width: 100%;
    }
    
    .shop-active-filters-wrapper .active-filters-display {
        margin: 0;
    }
    
    
    .shop-active-filters-wrapper .active-filters-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .shop-active-filters-wrapper .active-filter-tag:hover {

        transform: translateY(-1px);
    }
    
    .lebasino-filter-shortcode.filter-style-horizontal .filter-section {
        flex: 1;
        min-width: 200px;
    }
    
    .lebasino-filter-shortcode.filter-style-popup {
        position: relative;
    }
    
    .filter-shortcode-title {
        margin: 0 0 15px 0;
        font-size: 18px;
        font-weight: 600;
        color: #2c3e50;
    }
    
    /* Mobile optimizations */
    @media (max-width: 768px) {
        .lebasino-filter-shortcode.filter-style-horizontal {
            flex-direction: column;
        }
        
        .lebasino-filter-shortcode.filter-style-horizontal .filter-section {
            min-width: auto;
        }
    }
    
    /* RTL improvements */
    body.rtl .lebasino-filter-shortcode.filter-style-horizontal {
        direction: rtl;
    }
    
    body.rtl .lebasino-filter-shortcode .filter-section {
        text-align: right;
    }
