/* Best Seller Section - Matching Figma Design */
.bestseller-section {
    position: relative;
}

.bestseller-wrapper {
    position: relative;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Product Card */
.product-card-home {
    position: relative;
    background: #594a42;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
}

.product-card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(89, 74, 66, 0.3);
}

/* Product Image Wrapper */
.product-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Product Image */
.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card-home:hover .product-image {
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-card-home {
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 400px;
        margin: 0 auto;
    }

    .product-card-home {
        border-radius: 8px;
    }
}

/* Ensure consistent aspect ratio across all cards */
.product-card-home::before {
    content: "";
    display: block;
    padding-bottom: 100%;
}

.product-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Focus state for accessibility */
.product-card-home:focus-within {
    outline: 3px solid #3ab54a;
    outline-offset: 4px;
}

/* Loading state placeholder */
.product-image {
    background: linear-gradient(90deg, #594a42 0%, #6b5a52 50%, #594a42 100%);
    background-size: 200% 100%;
}

/* Smooth image loading */
.product-image[src] {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Grid layout for different screen sizes */
@media (min-width: 1280px) {
    .products-grid {
        gap: 28px;
    }
}

@media (min-width: 1536px) {
    .products-grid {
        gap: 32px;
    }
}

/* Tablet landscape specific */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

/* Small mobile optimization */
@media (max-width: 374px) {
    .products-grid {
        gap: 12px;
    }
}
