/* متغیرهای رنگی برای تم سفید و لوکس */
:root {
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #1a1a1a;
    --blue: #1e5c8b;
    --gold: #ffd700;
    --gradient: linear-gradient(135deg, #ffffff, #ffd700);
    --red: #b22222;
}

.products {
    padding: 50px 20px;
    text-align: center;
    max-width: 1200px;
    margin: 20px auto;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.products h2 {
    color: var(--blue);
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card-link {
    text-decoration: none;
    display: block;
}

.product-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.product-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.03);
}

.product-info {
    padding: 15px;
    text-align: center;
    background: var(--white);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

.product-info h3 {
    color: var(--dark-gray);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-info p {
    color: #555555;
    font-size: 0.9rem;
    margin: 0 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}

.product-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
}

.product-price {
    background: var(--blue);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 0 0 12px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-price:hover {
    background: var(--gradient);
}

.original-price {
    color: var(--red);
    text-decoration: line-through;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.final-price {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-all-card {
    background: var(--light-gray);
    border: 2px solid var(--gold);
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-all-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--white);
}

.view-all-card .product-info {
    min-height: auto;
    padding: 15px;
    flex-grow: 0;
}

.view-all-card h3 {
    color: var(--blue);
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.view-all-card:hover h3 {
    color: var(--gold);
}

.view-all-card h3 i {
    font-size: 1.4rem;
    transition: transform 0.3s ease;
}

.view-all-card:hover h3 i {
    transform: rotate(360deg);
}

.error {
    color: var(--red);
    font-size: 1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* استایل فیلتر دسته‌بندی‌ها */
.subcategory-filter {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    margin: 20px auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--light-gray);
}

.subcategory-filter::-webkit-scrollbar {
    height: 8px;
}

.subcategory-filter::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

.subcategory-filter::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.subcategory-btn {
    background: var(--blue);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subcategory-btn:hover {
    background: var(--gradient);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.subcategory-btn.active {
    background: var(--gold);
    color: var(--dark-gray);
}

.subcategory-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    transition: transform 0.3s ease;
}

.subcategory-btn:hover .subcategory-img {
    transform: scale(1.1);
}

.subcategory-btn.active .subcategory-img {
    border-color: var(--blue);
}

/* انیمیشن لود */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* واکنش‌گرایی */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .products {
        padding: 40px 15px;
    }

    .products h2 {
        font-size: 2rem;
    }

    .product-card {
        min-height: 320px;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 12px;
        min-height: 90px;
    }

    .product-info h3 {
        font-size: 1.3rem;
    }

    .product-info p {
        font-size: 0.85rem;
    }

    .product-status {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.95rem;
        padding: 6px 12px;
    }

    .original-price {
        font-size: 0.8rem;
    }

    .final-price {
        font-size: 0.95rem;
    }

    .view-all-card {
        min-height: 320px;
    }

    .view-all-card h3 {
        font-size: 1.2rem;
    }

    .subcategory-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .subcategory-img {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .products {
        padding: 30px 10px;
    }

    .products h2 {
        font-size: 1.8rem;
    }

    .product-card {
        min-height: 300px;
    }

    .product-image {
        height: 140px;
    }

    .product-info {
        padding: 10px;
        min-height: 80px;
    }

    .product-info h3 {
        font-size: 1.2rem;
    }

    .product-info p {
        font-size: 0.8rem;
    }

    .product-status {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    .original-price {
        font-size: 0.75rem;
    }

    .final-price {
        font-size: 0.9rem;
    }

    .view-all-card {
        min-height: 300px;
    }

    .view-all-card h3 {
        font-size: 1.1rem;
    }

    .subcategory-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .subcategory-img {
        width: 18px;
        height: 18px;
    }
}