/* استایل حرفه‌ای برای صفحه دسته‌بندی */
:root {
    --primary-color: #324153;
    --secondary-color: #FE5000;
    --accent-color: #FFFB00;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --border-color: #e0e6ed;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --shadow-light: 0 2px 8px rgba(50, 65, 83, 0.08);
    --shadow-medium: 0 4px 20px rgba(50, 65, 83, 0.12);
    --shadow-heavy: 0 8px 32px rgba(50, 65, 83, 0.16);
    --gradient-primary: linear-gradient(135deg, #324153 0%, #2c3949 100%);
    --gradient-secondary: linear-gradient(135deg, #FE5000 0%, #e6470a 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeSpeed;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    width: 100%;
}

/* عنوان دسته‌بندی */
.category-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    transform: translateX(50%);
    width: 100px;
    height: 4px;
    background: var(--gradient-secondary);
    border-radius: 2px;
}

.category-description {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 40px;
}

/* گرید محصولات - 4 محصول در هر ردیف */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
    justify-content: center;
    align-items: stretch;
    width: 100%;
}

/* کارت محصول */
.product-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 380px;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--secondary-color);
    text-decoration: none;
}

/* تصویر محصول */
.product-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* اطلاعات محصول */
.product-info {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    min-height: 140px;
}

/* نام محصول */
.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-height: 2.8em;
}

/* باکس قیمت */
.price-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.original-price {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discounted-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--secondary-color);
}

.normal-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* پیام عدم وجود محصول */
.no-products {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 60px;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    border: 2px dashed var(--border-color);
    grid-column: 1 / -1;
}

/* رسپانسیو - دسکتاپ */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .product-image {
        height: 200px;
        padding: 15px;
    }
    
    .product-info {
        padding: 15px;
        min-height: 130px;
    }
}

/* رسپانسیو - تبلت بزرگ */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(200px, 1fr));
    }
    
    .category-title {
        font-size: 2.2rem;
    }
    
    .category-description {
        font-size: 1.1rem;
    }
}

/* رسپانسیو - تبلت */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .category-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .product-image {
        height: 180px;
    }
}

/* رسپانسیو - تبلت کوچک */
@media (max-width: 768px) {
    .container {
        margin: 30px auto;
        padding: 0 15px;
    }
    
    .category-title {
        font-size: 1.8rem;
        padding-bottom: 10px;
        margin-bottom: 25px;
    }
    
    .category-description {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .product-grid {
        gap: 15px;
    }
    
    .product-image {
        height: 160px;
        padding: 12px;
    }
    
    .product-info {
        padding: 12px;
        min-height: 120px;
    }
    
    .product-name {
        font-size: 1rem;
        min-height: 2.4em;
        margin-bottom: 12px;
    }
    
    .discounted-price,
    .normal-price {
        font-size: 1.1rem;
    }
    
    .original-price {
        font-size: 0.85rem;
    }
}

/* رسپانسیو - موبایل بزرگ */
@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .category-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    .product-card {
        min-height: 320px;
        border-radius: 16px;
    }
    
    .product-image {
        height: 140px;
        padding: 10px;
    }
    
    .product-info {
        padding: 10px;
        min-height: 110px;
    }
    
    .product-name {
        font-size: 0.9rem;
        min-height: 2.2em;
        margin-bottom: 10px;
    }
    
    .discounted-price,
    .normal-price {
        font-size: 1rem;
    }
    
    .original-price {
        font-size: 0.8rem;
    }
}

/* رسپانسیو - موبایل متوسط */
@media (max-width: 480px) {
    .container {
        margin: 20px auto;
        padding: 0 12px;
    }
    
    .category-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
    
    .category-description {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .product-card {
        min-height: 280px;
        border-radius: 14px;
    }
    
    .product-image {
        height: 120px;
        padding: 8px;
    }
    
    .product-info {
        padding: 8px;
        min-height: 100px;
    }
    
    .product-name {
        font-size: 0.85rem;
        min-height: 2em;
        margin-bottom: 8px;
    }
    
    .discounted-price,
    .normal-price {
        font-size: 0.9rem;
    }
    
    .original-price {
        font-size: 0.75rem;
    }
    
    .no-products {
        font-size: 1rem;
        padding: 20px;
        margin-top: 40px;
    }
}

/* رسپانسیو - موبایل کوچک */
@media (max-width: 375px) {
    .category-title {
        font-size: 1.3rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 280px;
        margin: 20px auto;
    }
    
    .product-card {
        min-height: 260px;
        max-width: 100%;
    }
    
    .product-image {
        height: 110px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 0.8rem;
    }
    
    .discounted-price,
    .normal-price {
        font-size: 0.85rem;
    }
}

/* رسپانسیو - موبایل خیلی کوچک */
@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .product-grid {
        gap: 10px;
        max-width: 260px;
    }
    
    .product-card {
        min-height: 240px;
    }
    
    .product-image {
        height: 100px;
        padding: 6px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-name {
        font-size: 0.75rem;
    }
}

/* انیمیشن‌ها */
@media (prefers-reduced-motion: no-preference) {
    .product-card {
        animation: fadeInUp 0.6s ease-out;
        animation-fill-mode: both;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* پشتیبانی از حالت کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
    .product-card,
    .product-image {
        animation: none !important;
        transition: none !important;
    }
}

/* پشتیبانی از حالت تیره */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .product-card {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .product-name {
        color: #ecf0f1;
    }
    
    .product-image {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    }
    
    .no-products {
        background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
        color: #bdc3c7;
        border-color: #34495e;
    }
    
    .normal-price {
        color: #ffa726;
    }
}