.products-section {
    padding: 5rem 0;
    background: var(--light-bg);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); /* زيادة الحد الأدنى */
    gap: 1.875rem;
    padding: 1.25rem;
}

.product-card {
    background: white;
    border-radius: 0.625rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-0.625rem);
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.2);
}

.product-link {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    position: relative;
    aspect-ratio: 4/3; /* نسبة ثابتة للصورة */
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.product-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(227, 30, 36, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.product-card:hover .overlay {
    opacity: 1;
}

.overlay span {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    transform: translateY(1.25rem);
    transition: all 0.3s ease;
}

.product-card:hover .overlay span {
    transform: translateY(0);
}

.product-title {
    padding: 0.938rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin: 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Media Queries */
@media (max-width: 64rem) { /* 1024px */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 48rem) { /* 768px */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        padding: 1rem;
    }

    .product-title {
        font-size: 1.1rem;
        padding: 0.75rem;
    }
}

@media (max-width: 36rem) { /* 576px - للشاشات الصغيرة */
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* عرض منتجين في الصف */
        gap: 0.875rem;
        padding: 0.75rem;
    }

    .product-card {
        border-radius: 0.5rem;
    }

    .product-image {
        aspect-ratio: 3/2.5; /* تعديل نسبة الصورة */
    }

    .product-title {
        font-size: 0.938rem;
        padding: 0.625rem;
        -webkit-line-clamp: 2;
    }

    .overlay span {
        font-size: 0.875rem;
    }
}

@media (max-width: 20rem) { /* 320px - للشاشات الصغيرة جداً */
    .products-grid {
        gap: 0.625rem;
        padding: 0.5rem;
    }

    .product-image {
        aspect-ratio: 1/1; /* نسبة مربعة للصورة */
    }

    .product-title {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    .overlay span {
        font-size: 0.813rem;
    }
}