/* Custom Scrollbar Hide */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Filter Buttons Responsive */
.filter-btn {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .filter-btn {
        font-size: 0.875rem !important;
        padding: 0.625rem 1.25rem !important;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .filter-btn {
        font-size: 0.9375rem !important;
        padding: 0.75rem 1.5rem !important;
    }
}

/* Product Card Styles */
.product-card {
    position: relative;
    background-color: white;
    padding: 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

@media (max-width: 640px) {
    .product-card {
        box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    }
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.product-card::before,
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0.5rem;
    z-index: 15;
    pointer-events: none;
}

.product-card::before {
    border-left: 2px solid #92400e;
    border-right: 2px solid #92400e;
    transform: scaleY(0);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-card::after {
    border-top: 2px solid #92400e;
    border-bottom: 2px solid #92400e;
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: 0.1s;
}

.product-card:hover::before {
    transform: scaleY(1);
}

.product-card:hover::after {
    transform: scaleX(1);
}

.card-image-container {
    position: relative;
    margin-bottom: 1rem;
    height: 12rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-container img {
    max-width: 8rem;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s, transform 0.3s;
}

.default-img {
    position: relative;
    z-index: 5;
    opacity: 1;
}

.hover-img {
    position: absolute;
    opacity: 0;
    z-index: 6;
}

.product-card:hover .default-img {
    opacity: 0;
}

.product-card:hover .hover-img,
.product-card.group:hover .hover-img {
    opacity: 1;
}

.icon-group {
    position: absolute;
    top: 1rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 20;
}

.product-card:hover .icon-group {
    opacity: 1;
}

.icon-group button {
    background-color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #92400e;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.icon-group button:hover {
    background-color: #f59e0b;
    color: white;
    transform: scale(1.1);
}

/* Layout Grid Styles */
.layout-grid {
    display: grid;
    gap: 1rem;
}

/* Premium Spice Collection - Left Layout (Offer on LEFT, small cards on RIGHT) */
.left-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .left-layout-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .left-layout-grid {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 200px 200px 200px;
        grid-template-areas:
            "offer p1 p2"
            "offer p3 p4"
            "offer p5 p6";
        gap: 1rem;
    }

    .left-layout-grid .small-product-card:nth-child(1) { grid-area: p1; }
    .left-layout-grid .small-product-card:nth-child(2) { grid-area: p2; }
    .left-layout-grid .small-product-card:nth-child(3) { grid-area: p3; }
    .left-layout-grid .small-product-card:nth-child(4) { grid-area: p4; }
    .left-layout-grid .small-product-card:nth-child(5) { grid-area: p5; }
    .left-layout-grid .small-product-card:nth-child(6) { grid-area: p6; }

    .left-layout-grid .offer-card {
        grid-area: offer;
        height: 100%;
    }

    .left-layout-grid .small-product-card {
        height: 100%;
    }
}

/* Artisan Coffee - Right Layout (Small cards on LEFT, offer on RIGHT) */
.right-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .right-layout-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .right-layout-grid {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: 200px 200px;
        grid-template-areas:
            "p1 p2 offer"
            "p3 p4 offer";
        gap: 1rem;
    }

    .right-layout-grid .small-product-card:nth-child(1) { grid-area: p1; }
    .right-layout-grid .small-product-card:nth-child(2) { grid-area: p2; }
    .right-layout-grid .small-product-card:nth-child(3) { grid-area: p3; }
    .right-layout-grid .small-product-card:nth-child(4) { grid-area: p4; }

    .right-layout-grid .offer-card {
        grid-area: offer;
        height: 100%;
    }

    /* .right-layout-grid .small-product-card {
        height: 100%;
    } */
}

.left-layout-product-card img,
.right-layout-product-card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.left-layout-product-card,
.right-layout-product-card {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

/* Small cards hover effect */
.small-product-card {
    cursor: pointer;
    position: relative;
    height: 180px;
}

@media (min-width: 640px) {
    .small-product-card {
        height: 200px;
    }
}

/* @media (min-width: 1024px) {
    .small-product-card {
        height: 100%;
    }
} */

.small-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.small-product-card:hover::before {
    opacity: 1;
}

.small-product-card .product-hover-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1rem;
    z-index: 10;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.small-product-card:hover .product-hover-info {
    transform: translateY(0);
}

/* Offer card styles */
.offer-card {
    height: 280px;
}

@media (min-width: 640px) {
    .offer-card {
        height: 320px;
    }
}

@media (min-width: 1024px) {
    .offer-card {
        height: 100%;
    }
}

.offer-card .offer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem;
}

@media (min-width: 1024px) {
    .offer-card .offer-overlay {
        padding: 2rem;
    }
}

/* Gallery Card Styles - Exclusive Collection */
#product-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    #product-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    #product-gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 180px;
        gap: 1rem;
    }
}

.gallery-product-card {
    height: 160px;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

@media (min-width: 640px) {
    .gallery-product-card {
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .gallery-product-card {
        height: 100%;
    }

    .gallery-product-card.featured-card {
        /* grid-column: span 2; */
        grid-row: span 3;
    }
}

.gallery-product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background-color: white;
}

.gallery-product-card:hover img {
    transform: scale(1.05);
}

.gallery-product-card .gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

.gallery-product-card:hover .gallery-overlay {
    opacity: 1;
}

.gallery-product-card .gallery-overlay h3 {
    color: white;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .gallery-product-card .gallery-overlay h3 {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    .gallery-product-card.featured-card .gallery-overlay h3 {
        font-size: 1.25rem;
    }
}

/* Quick View Modal - Mobile Optimized */
#quickViewModal {
    -webkit-overflow-scrolling: touch;
}

#quickViewModal .relative {
    margin: 1rem;
}

@media (max-width: 640px) {
    #quickViewModal .relative {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    #quickViewContent {
        padding: 1rem !important;
    }

    #quickViewContent .grid {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure buttons are touchable on mobile */
.quick-view-btn,
.add-to-cart-btn,
.icon-quick-view,
.icon-cart {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
}

/* Mobile: Show info on tap/touch (using :active and .touched class) */
@media (max-width: 768px) {
    /* Best Products slider - hide icon group by default, show on touch */
    .product-card .icon-group {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .product-card:active .icon-group,
    .product-card.touched .icon-group {
        opacity: 1 !important;
    }

    .product-card .icon-group {
        top: 0.5rem;
        right: 0.5rem;
        left: auto;
        width: auto;
        padding: 0;
        flex-direction: row;
        gap: 0.375rem;
    }

    .product-card .icon-group button {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }

    /* Small product cards - show info only on touch */
    .small-product-card::before {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .small-product-card:active::before,
    .small-product-card.touched::before {
        opacity: 0.7 !important;
    }

    .small-product-card .product-hover-info {
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .small-product-card:active .product-hover-info,
    .small-product-card.touched .product-hover-info {
        transform: translateY(0) !important;
    }

    /* Gallery cards - show overlay only on touch */
    .gallery-product-card .gallery-overlay {
        opacity: 0;
        transition: opacity 0.3s ease;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 60%, transparent);
        justify-content: flex-end;
        padding-bottom: 0.75rem;
    }

    .gallery-product-card:active .gallery-overlay,
    .gallery-product-card.touched .gallery-overlay {
        opacity: 1 !important;
    }

    .gallery-product-card .gallery-overlay h3 {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .gallery-product-card .gallery-overlay .flex {
        gap: 0.375rem;
    }

    .gallery-product-card .gallery-overlay button {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
}