/* فیلتر محصولات - استایل‌های جدید */

.wc-flatsome-filter-container {
    position: relative;
    background: #F4F4F4;
    border-radius: 0;
    direction: rtl;
    text-align: right;
    padding: 20px;
}

/* فیلترهای فعال در بالا */
.active-filters-container {
    margin-bottom: 15px;
    display: none;
}

.active-filters-container.has-filters {
    display: block;
}

.active-filter-tag {
    display: inline-block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 12px;
    margin: 0 5px 8px 0;
    font-size: 12px;
    color: #555;
}

.active-filter-tag .remove-filter {
    margin-right: 8px;
    color: #999;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.active-filter-tag .remove-filter:hover {
    color: #222;
}

/* عناوین فیلتر */
.filter-section {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
    background: #fff;
    margin-bottom: 12px;
    border-radius: 3px;
    overflow: hidden;
}

.filter-title {
    padding: 12px 15px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

/* محتوای فیلتر - همیشه باز */
.filter-content {
    padding: 0;
    background: #fff;
}

.filter-section.active .filter-content {
    display: block;
}

/* باکس جستجو */
.filter-search-box {
    position: relative;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.filter-search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 12px;
    background: #fafafa;
    transition: all 0.2s;
}

.filter-search-input:focus {
    outline: none;
    border-color: #999;
    background: #fff;
}

.search-icon {
    display: none;
}

/* باکس اسکرول */
.filter-scroll-box {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px 15px;
    background: #fff;
}

/* اسکرول‌بار سفارشی */
.filter-scroll-box::-webkit-scrollbar {
    width: 6px;
}

.filter-scroll-box::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.filter-scroll-box::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.filter-scroll-box::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* لیست فیلترها */
.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-list li {
    margin-bottom: 8px;
}

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

.filter-list-children {
    list-style: none;
    margin: 8px 0 0 20px;
    padding: 0;
}

/* چک‌باکس و رادیو */
.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-right: 28px;
    font-size: 13px;
    color: #555;
    transition: color 0.2s ease;
    user-select: none;
}

.filter-checkbox:hover {
    color: #222;
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    position: absolute;
    right: 0;
    opacity: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.filter-checkbox .checkbox-label {
    display: block;
    width: 100%;
}

.filter-checkbox .checkbox-label::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    background: #fff;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"] + .checkbox-label::before {
    border-radius: 3px;
}

.filter-checkbox input[type="radio"] + .checkbox-label::before {
    border-radius: 50%;
}

.filter-checkbox input:checked + .checkbox-label::before {
    background: #222;
    border-color: #222;
}

.filter-checkbox input:checked + .checkbox-label::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
}

.filter-checkbox input[type="radio"]:checked + .checkbox-label::after {
    right: 5px;
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
}

/* فیلتر قیمت */
.price-slider-wrapper {
    padding: 15px;
}

#price-slider {
    margin: 20px 5px;
    direction: ltr;
}

.noUi-target {
    background: #e8e8e8;
    border: none;
    box-shadow: none;
    height: 6px;
}

.noUi-connect {
    background: #222;
}

.noUi-handle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #222;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    top: -7px;
    cursor: pointer;
}

.noUi-handle::before,
.noUi-handle::after {
    display: none;
}

.noUi-horizontal .noUi-handle {
    right: -9px;
}

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

.price-input-group {
    flex: 1;
}

.price-input-group label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 5px;
}

.price-input-group input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
    background: #fafafa;
}

/* سلکت مرتب‌سازی */
.orderby-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #333;
}

.orderby-select:focus {
    outline: none;
    border-color: #999;
}

.filter-sort .filter-content {
    padding: 15px;
}

/* لودینگ */
.filter-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(244, 244, 244, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border-radius: 3px;
}

.filter-loading-overlay.active {
    display: flex;
}

.filter-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8e8;
    border-top: 3px solid #222;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* لودینگ محصولات */
.products-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

/* پیام خطا */
.no-brands {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin: 0;
    padding: 15px;
}

/* مخفی کردن آیتم‌های جستجو نشده */
.filter-list li.hidden {
    display: none;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .wc-flatsome-filter-container {
        padding: 15px;
    }
    
    .filter-scroll-box {
        max-height: 150px;
    }
    
    .filter-checkbox {
        font-size: 12px;
    }
    
    .price-inputs {
        flex-direction: column;
        gap: 8px;
    }
}

/* سازگاری با فلت‌سام */
.woocommerce-flatsome .wc-flatsome-filter-widget {
    background: #F4F4F4;
}

/* بهبود تجربه کاربری */
.filter-checkbox:hover .checkbox-label::before {
    border-color: #999;
}

.filter-search-input::placeholder {
    color: #aaa;
}

/* انیمیشن‌ها */
.active-filter-tag {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* حذف استایل‌های اضافی */
.filter-toggle-icon,
.filter-actions,
.reset-filters-btn,
.price-filter-btn {
    display: none !important;
}

