/**
 * استایل‌های فیلترهای پیشرفته محصولات
 */

/* Layout */
.products-layout {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.products-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.products-page-header .section-title {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.products-count {
    color: #6b7280;
    font-size: 14px;
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* Sidebar Filters */
.products-filters {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 20px;
    border: 1px solid #e5e7eb;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.filters-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters-header h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 2px;
}

.clear-filters {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.filter-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #6366f1;
    border-radius: 2px;
}

.filter-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-content .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-content .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Price Range */
.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.price-range-inputs .form-control {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.price-range-inputs .form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.price-separator {
    color: #6b7280;
    font-size: 14px;
}

.price-range-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b7280;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.checkbox-label:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #6366f1;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: #6366f1;
}

.checkbox-label span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* Radio Labels */
.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.radio-label:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #6366f1;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked {
    background: #6366f1;
}

.radio-label span {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* Color Select */
.color-select {
    padding: 10px 40px 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.color-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.selected-color-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.color-box-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: inline-block;
    flex-shrink: 0;
}

/* Size Select */
.size-select {
    padding: 10px 40px 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.size-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Main Content */
.products-content {
    flex: 1;
    min-width: 0;
}

.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 250px;
}

.search-form .form-control {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.search-form .btn {
    padding: 10px 20px;
    border-radius: 8px;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.sort-select,
.per-page-select {
    padding: 10px 40px 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-select:focus,
.per-page-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* No Products */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.no-products svg {
    color: #9ca3af;
    margin-bottom: 20px;
}

.no-products h3 {
    font-size: 20px;
    color: #374151;
    margin-bottom: 10px;
}

.no-products p {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a {
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
}

.pagination a:hover {
    background: #f3f4f6;
    border-color: #6366f1;
    color: #6366f1;
}

.pagination .current {
    background: #6366f1;
    color: #fff;
    border: 1px solid #6366f1;
    font-weight: 600;
}

.pagination-dots {
    color: #9ca3af;
    padding: 0 5px;
}

.pagination-prev,
.pagination-next {
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .products-layout {
        flex-direction: column;
        gap: 20px;
    }

    .products-filters {
        width: 100%;
        position: static;
    }

    .filter-toggle-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 12px;
        background: #6366f1;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 500;
        cursor: pointer;
        margin-bottom: 20px;
        transition: background 0.2s;
    }

    .filter-toggle-mobile:hover {
        background: #4f46e5;
    }

    .products-filters {
        display: none;
    }

    .products-filters.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .products-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        flex-direction: column;
    }

    .sort-select,
    .per-page-select {
        width: 100%;
    }

    .price-range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .price-separator {
        display: none;
    }

}

/* Button Styles */
.btn-block {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    font-weight: 500;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #6366f1;
    color: #6366f1;
}

/* Mobile Filter Toggle */
.filter-toggle-mobile {
    display: none;
}
