/* تعریف فونت */
@font-face {
    font-family: 'IranianSans';
    src: url('/public_html/main/fonts/IranianSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* تنظیمات کلی */
body {
    font-family: 'IranianSans', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f5f5f5;
    margin: 0;
}

body.no-scroll {
    overflow: hidden; /* غیرفعال کردن اسکرول وقتی پاپ‌آپ بازه */
}

/* کانتینر اصلی */
.chami-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8rem 1rem 2rem; /* فاصله بیشتر از هدر */
}

/* چیدمان محتوا */
.chami-main-content {
    display: block;
    overflow: hidden;
}

/* بخش محصولات */
.chami-products-section {
    width: 75%;
    float: left;
    padding-right: 1.5rem;
}

/* گرید محصولات */
.chami-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.chami-product-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardFade 0.6s ease-out backwards;
    animation-delay: calc(var(--chami-card-order) * 100ms);
    display: flex;
    flex-direction: column;
}

.chami-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.chami-product-image {
    width: 100%;
    height: 250px; /* افزایش ارتفاع برای دسکتاپ */
    background-size: contain; /* نمایش کامل عکس بدون کراپ */
    background-position: center;
    background-repeat: no-repeat;
}

.chami-product-title {
    font-size: 1.4rem; /* افزایش فونت */
    color: #292b76;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    margin: 0; /* حذف حاشیه برای جلوگیری از خطوط */
    border-bottom: none; /* حذف هرگونه خط زیرین */
}

.chami-product-price {
    font-size: 1.2rem; /* افزایش فونت */
    color: #555;
    padding: 0 12px 12px;
    text-align: center;
    margin: 0; /* حذف حاشیه برای جلوگیری از خطوط */
    border-bottom: none; /* حذف هرگونه خط زیرین */
}

.chami-product-cta {
    display: block;
    width: 100%;
    margin: 0; /* حذف فاصله از پایین */
    padding: 0.85rem 0;
    background-color: #292b76;
    color: #fff;
    border: none;
    border-radius: 0 0 12px 12px;
    font-size: 1rem;
    font-family: 'IranianSans', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: auto; /* چسباندن دکمه به انتهای کارت */
}

.chami-product-cta:hover {
    background-color: #3f4194;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chami-product-cta i {
    margin-left: 8px;
}

/* بخش فیلترها */
.chami-filter-sidebar {
    width: 25%;
    float: right;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 8rem;
}

/* استایل‌های فیلتر */
.chami-filter-heading {
    font-size: 1.5rem;
    color: #292b76;
    margin-bottom: 1rem;
    position: relative;
}

.chami-filter-heading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background-color: #292b76;
    bottom: -5px;
    right: 0;
}

.chami-filter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chami-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chami-filter-group h3 {
    font-size: 1.1rem;
    color: #292b76;
    margin-bottom: 0.5rem;
}

.chami-filter-group select,
.chami-filter-group input[type="number"] {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'IranianSans', Arial, sans-serif;
    font-size: 1rem;
    width: 100%;
}

.chami-filter-group input[type="radio"] {
    margin-left: 0.5rem;
}

.chami-filter-group label {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.3rem;
}

.chami-filter-apply {
    padding: 0.5rem;
    background-color: #292b76;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: 'IranianSans', Arial, sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chami-filter-apply:hover {
    background-color: #3f4194;
}

.chami-filter-reset {
    display: block;
    padding: 0.5rem;
    background-color: #6b7280;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    font-family: 'IranianSans', Arial, sans-serif;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.chami-filter-reset:hover {
    background-color: #4b5563;
}

/* استایل‌های متفرقه */
.chami-section-heading {
    font-size: 1.8rem;
    color: #292b76;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.chami-section-heading::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: #292b76;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
}

.chami-error-message {
    color: #dc2626;
    text-align: center;
    margin-bottom: 1rem;
}

.chami-no-products {
    text-align: center;
    color: #555;
    font-size: 1rem;
}

/* صفحه‌بندی */
.chami-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.chami-pagination-link {
    padding: 0.5rem 1rem;
    background-color: #292b76;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.chami-pagination-link.active {
    background-color: #3f4194;
}

.chami-pagination-link:hover {
    background-color: #3f4194;
}

/* نوار فیلتر افقی برای موبایل و تبلت */
.chami-filter-bar {
    display: none; /* در دسکتاپ مخفی */
    width: 100%;
    background-color: #fff;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto; /* اسکرول افقی */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* اسکرول روان در تاچ */
}

.chami-filter-bar .chami-filter-item {
    display: inline-block;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #e0e0e0;
    border-radius: 5px;
    font-size: 1rem; /* افزایش فونت برای بهتر دیده شدن */
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chami-filter-bar .chami-filter-item:hover {
    background-color: #d1d5db;
}

/* استایل پاپ‌آپ */
.chami-filter-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 80%; /* کاهش عرض برای تناسب با موبایل */
    max-height: 80vh;
    overflow-y: auto;
}

.chami-filter-popup.active {
    display: block;
}

.chami-filter-popup h3 {
    font-size: 1.3rem;
    color: #292b76;
    margin-bottom: 1rem;
}

.chami-filter-popup select,
.chami-filter-popup input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'IranianSans', Arial, sans-serif;
    font-size: 1rem;
}

.chami-filter-popup input[type="radio"] {
    margin-left: 0.5rem;
}

.chami-filter-popup label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem; /* افزایش فونت */
    color: #555;
}

.chami-filter-popup .chami-filter-apply,
.chami-filter-popup .chami-filter-reset {
    width: 100%;
    margin-top: 1rem;
}

.chami-filter-popup .chami-filter-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #dc2626;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease;
}

.chami-filter-popup .chami-filter-close:hover {
    background-color: #b91c1c;
}

/* انیمیشن کارت‌ها */
@keyframes cardFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* طراحی ریسپانسیو */
@media (max-width: 1023px) {
    .chami-products-section {
        width: 100%;
        float: none;
        padding-right: 0;
    }
    .chami-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chami-product-image {
        height: 220px; /* افزایش ارتفاع برای تبلت */
    }
    .chami-product-title {
        font-size: 1.3rem;
    }
    .chami-product-price {
        font-size: 1.1rem;
    }
    .chami-product-cta {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    .chami-filter-sidebar {
        display: none; /* مخفی کردن سایدبار در تبلت و موبایل */
    }
    .chami-filter-bar {
        display: block; /* نمایش نوار افقی */
        margin-bottom: 1rem;
    }
}

@media (max-width: 767px) {
    .chami-products-grid {
        grid-template-columns: 1fr;
    }
    .chami-product-image {
        height: 200px; /* افزایش ارتفاع برای موبایل */
    }
    .chami-product-title {
        font-size: 1.2rem;
    }
    .chami-product-price {
        font-size: 1rem;
    }
    .chami-product-cta {
        font-size: 0.95rem;
        padding: 0.65rem 0;
    }
}

/* پاکسازی float */
.chami-main-content::after {
    content: "";
    display: table;
    clear: both;
}