/* صفحه لیست محصولات */
.product-list-page {
    direction: rtl;
}

/* هدر لیست محصولات */
.product-list-header h4 {
    font-size: 1.25rem;
}

/* گرید محصولات
   - روی col-12 col-md-4 تنظیم شده است:
     موبایل: 1 ستون (12)
     md و بالاتر: 3 ستون (4+4+4) */
.product-grid .product-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-grid .product-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

/* تصویر محصول */
.product-card .card-img-top {
    object-fit: cover;
    max-height: 220px;
}

/* دکمه‌های چشم/قلب حذف شده‌اند؛ اگر از قبل استایل دارند، خنثی‌شان می‌کنیم */
.product-actions {
    display: none !important;
}

/* سایدبار فیلترها */
.filter-sidebar {
    position: relative;
}

/* نسخه موبایل: سایدبار کشویی از سمت راست */
@media (max-width: 767.98px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -320px; /* مخفی بیرون صفحه */
        width: 320px;
        max-width: 85%;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 8px rgba(0,0,0,0.15);
        z-index: 1050;
        overflow-y: auto;
        transition: right 0.3s ease;
        padding: 0.75rem 0.75rem 1rem;
    }

    .filter-sidebar-open {
        right: 0;
    }

    .filter-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 0.5rem 0.5rem;
        border-bottom: 1px solid #e5e5e5;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }

    /* کارت عنوان "فیلتر محصولات" دسکتاپی را در موبایل مخفی می‌کنیم تا عنوان دوبل نشود */
    .filter-sidebar .card:first-of-type .card-header {
        display: none;
    }

    .search-card {
        margin-bottom: 0 !important;
    }

    /* بک‌دراپ موبایل */
    .mobile-filter-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(0,0,0,0.3);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
    }

    .mobile-filter-overlay-show {
        opacity: 1;
        visibility: visible;
    }
}

/* نسخه دسکتاپ: سایدبار مثل قبل عادی باشد */
@media (min-width: 768px) {
    .filter-sidebar {
        position: static;
        height: auto;
        box-shadow: none;
        padding: 0;
    }

    .mobile-filter-overlay {
        display: none;
    }
}

/* دکمه فیلتر موبایل */
.filter-toggle-btn {
    font-size: 0.9rem;
}

/* استایل‌های جزئی کارت محصول */
.product-card .card-title a {
    color: #212529;
}

.product-card .card-title a:hover {
    color: #0d6efd;
}

/* متن توضیح کوتاه */
.product-card .card-text {
    min-height: 40px;
}

/* ستاره‌های امتیاز */
.product-card .bi-star-fill {
    font-size: 0.85rem;
}

.product-card .bi-star {
    font-size: 0.85rem;
}

/* اسکرول نرم داخل سایدبار موبایل */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

/* فاصله‌ها برای کارت‌های فیلتر و جستجو */
.filter-sidebar .card {
    margin-bottom: 1rem;
}

/* کمی نظم بیشتر روی فرم فیلترها */
#filterForm h6 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

#filterForm .form-check {
    margin-bottom: 0.25rem;
}

#filterForm .btn {
    font-size: 0.9rem;
}
