
body {
    font-family: 'Vazirmatn', 'IRANSans', sans-serif;
    direction: rtl;
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.content-area-products {
    flex-grow: 1;
}

/* کلاس برای محدود کردن متن به دو خط */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    max-height: 2.8em; /* 2 * line-height */
}

:root {
    --new-red-primary: #be1515;
    --new-red-darker: #a31111;
    --new-red-gradient: linear-gradient(to top, #a31111, #be1515);
    --primary-blue: #005691;
    --new-red-hover-bg: #fde8e8;
    --menu-text-red: var(--new-red-primary);
    --menu-hover-pink: var(--new-red-hover-bg);
}

/* کلاس‌های کمکی */
.text-brand-red { 
    color: var(--new-red-primary); 
}
.bg-brand-red { 
    background-color: var(--new-red-primary); 
}
.hover\:bg-brand-red-darker:hover { 
    background-color: var(--new-red-darker); 
}
.border-brand-red { 
    border-color: var(--new-red-primary); 
}
.text-new-red-primary { 
    color: var(--new-red-primary); 
}
.text-new-red-darker { 
    color: var(--new-red-darker); 
}
.bg-new-red-primary { 
    background-color: var(--new-red-primary); 
}

/* استایل‌های اصلی کارت‌های محصول */
.product-card-on-page {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
    will-change: transform, box-shadow;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.product-card-on-page:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-6px);
}

.product-title-on-page-fixed-height { 
    height: 3.2rem; 
    display: -webkit-box; 
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    line-height: 1.6;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.product-card-on-page .product-details-on-page { 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1;
    padding: 1rem 1.25rem;
}

.product-card-on-page .price-section-on-page { 
    margin-top: auto; 
    text-align: right;
}

.product-card-on-page .price-section-on-page p {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--new-red-darker);
}

.product-card-on-page .price-section-on-page p span {
    font-size: 0.75rem;
    font-weight: 400;
    color: #6b7280;
}

/* استایل‌های تصاویر محصول */
.product-card-on-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card-on-page:hover img {
    transform: scale(1.05);
}

/* استایل‌های badge محصول */
.product-card-on-page .absolute {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 10;
}

/* استایل‌های دکمه افزودن به سبد */
.add-to-cart-btn {
    margin-top: 1rem;
    width: 100%;
    background-color: var(--new-red-primary);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover:not(:disabled) {
    background-color: var(--new-red-darker);
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-to-cart-btn i {
    margin-left: 0.5rem;
}

/* استایل‌های هدر صفحه */
.page-header-products-bg { 
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/img/TempDesc/PIC/Gemini_Generated_Image_rlvw9urlvw9urlvw.png'); 
    background-size: cover; 
    background-position: center; 
}

/* استایل‌های فیلتر و مرتب‌سازی */
#sortProductsOptionsPage {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: white;
    color: #374151;
}

#sortProductsOptionsPage:focus {
    outline: none;
    border-color: var(--new-red-primary);
    box-shadow: 0 0 0 3px rgba(190, 21, 21, 0.1);
}

/* Grid محصولات */
#allProductsGridPage {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem 1.5rem;
}

@media (min-width: 640px) {
    #allProductsGridPage {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #allProductsGridPage {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    #allProductsGridPage {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

/* رنگ‌های Tailwind اضافی */
.focus\:ring-new-red-primary:focus { 
    --tw-ring-color: var(--new-red-primary); 
}

.focus\:border-new-red-primary:focus { 
    --tw-border-opacity: 1; 
    border-color: var(--new-red-primary); 
}

/* انیمیشن‌های اضافی */
.product-card-on-page {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* نمایش امتیاز محصول */
.product-card-on-page .flex.items-center.text-xs.text-gray-500 {
    margin-bottom: 0.75rem;
}

.product-card-on-page .text-yellow-400 i {
    color: #fbbf24;
}

/* موجودی محصول */
.product-card-on-page .price-section-on-page p + p {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* استایل‌های صفحه‌بندی */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    margin: 0 0.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pagination-btn:hover:not(.pagination-disabled):not(.pagination-current) {
    background-color: #f9fafb;
    border-color: var(--new-red-primary);
    color: var(--new-red-primary);
}

.pagination-btn.pagination-current {
    background-color: var(--new-red-primary);
    border-color: var(--new-red-primary);
    color: white;
    font-weight: 600;
}

.pagination-btn.pagination-disabled {
    color: #1f2937 !important;
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

.pagination-btn.pagination-disabled i {
    color: #1f2937 !important;
}

/* قانون اضافی برای تضمین رنگ تیره آیکون‌های disabled */
.pagination-btn.pagination-disabled .fas {
    color: #1f2937 !important;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    color: #6b7280;
    font-weight: 500;
}

.pagination-prev,
.pagination-next {
    font-size: 0.75rem;
}

/* Responsive صفحه‌بندی */
@media (max-width: 640px) {
    .pagination-btn {
        min-width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8rem;
        margin: 0 0.0625rem;
    }
}

/* --- Overrides نهایی برای آیکون صفحه‌بندی (SVG) --- */
nav[aria-label="صفحه‌بندی محصولات"] .pagination-btn .icon-arrow { display:inline-block; }
nav[aria-label="صفحه‌بندی محصولات"] .pagination-btn.pagination-disabled { 
    color:#111 !important; 
    background-color:#f3f4f6 !important; 
    border-color:#d1d5db !important; 
    opacity:1 !important; 
}
nav[aria-label="صفحه‌بندی محصولات"] .pagination-btn.pagination-disabled .icon-arrow path { 
    stroke:#111 !important; 
}
nav[aria-label="صفحه‌بندی محصولات"] .pagination-btn:not(.pagination-disabled):hover .icon-arrow path { 
    stroke: var(--new-red-primary); 
}