/*
 * QATARSHOES THEME — HOMEPAGE SECTIONS CSS
 * Conditionally loaded on homepage templates only.
 *
 * Specificity strategy:
 *   Every selector is prefixed with .page-homepage (on <body>)
 *   giving specificity 0,0,2,0+ which ties or beats JSX's
 *   double-class selectors (0,0,2,0). Since wp_head() loads
 *   AFTER JSX <style> blocks, equal specificity wins by
 *   cascade order — no !important needed.
 *
 *   !important is kept ONLY where we must override:
 *     – JSX rules that themselves use !important
 *     – inline style="" attributes
 */

/* ============================================
   HERO IMAGE GENDER SWITCHING
   ============================================ */

/* Hero image base — mobile: cover centered */
.page-homepage .hero-image {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Mobile hero adjustments per dept/mode */
@media (max-width: 1023px) {
    /* Men: clip the scaled overflow */
    .page-homepage.dept-men .hero-image-container {
        overflow: hidden;
    }
    .page-homepage.dept-women .hero-image-container {
        overflow: hidden;
    }
    .page-homepage.mode-ready-to-go.dept-men .hero-image {
        scale: 1.3;
    }
    .page-homepage.mode-ready-to-ship.dept-men .hero-image {
        margin-top: 90px;
        scale: 1.3;
    }
    .page-homepage.mode-ready-to-ship.dept-women .hero-image {
        background-position: 35% center !important;
    }
}

/* 1024–1399px: cover but anchor at top so the head stays visible */
@media (min-width: 1024px) and (max-width: 1399px) {
    .page-homepage .hero-image {
        background-size: cover !important;
        background-position: top center !important;
    }
}

/* 1400px+: full-width, no zoom */
@media (min-width: 1400px) {
    .page-homepage .hero-image {
        background-size: 100% auto !important;
        background-position: top center !important;
    }
}

/* ============================================
   HOMEPAGE PRODUCT CARDS — Brand & Title Overrides
   ============================================ */

/* Hide brand name on homepage product cards */
.page-homepage .homepage-section .brand {
    display: none;
}

/* Product title — clean sans-serif style on desktop */
@media (min-width: 1024px) {
    .page-homepage .homepage-section .model {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 20px;
        font-weight: 500;
        line-height: 28px;
        color: #2D1F1F;
    }

    /* Product price — desktop */
    .page-homepage .homepage-section .price-container .price {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 24px;
        font-weight: 600;
        line-height: 100%;
        letter-spacing: -0.02em;
        color: #2D1F1F;
    }
}

/* ============================================
   HIDE UNCONFIGURED SECTIONS
   Based on collection configuration per gender
   ============================================ */

/* Hide sections when current gender doesn't have collection configured */
.page-homepage.dept-women .homepage-section[data-has-women="false"] {
    display: none;
}

.page-homepage.dept-men .homepage-section[data-has-men="false"] {
    display: none;
}

/* ============================================
   HOMEPAGE PRODUCT SECTIONS - 2x2 GRID ON MOBILE
   ============================================ */

/* Mobile: 2 columns grid - Override jsx styles */
@media (max-width: 1023px) {
    /* Override ALL products-container jsx classes to 2x2 grid */
    .page-homepage .products-container.jsx-3213987687,
    .page-homepage .products-container.jsx-2630333056,
    .page-homepage .products-container.jsx-2492920896,
    .page-homepage .homepage-section .products-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        grid-template-areas: "a b" "c d";
        gap: 1px;
        border-radius: 12px;
        overflow: hidden;
        background: #E0DCD3;
    }

    /* MUST use !important: overrides JSX rules that use !important to hide grid-area:a */
    .page-homepage .jsx-2630333056[style*="grid-area:a"],
    .page-homepage .jsx-2492920896[style*="grid-area:a"],
    .page-homepage .products-container > div[style*="grid-area:a"],
    .page-homepage .products-container > div[style*="grid-area: a"] {
        display: flex !important;
    }

    /* Product card grid areas - reassign based on child position */
    .page-homepage .products-container > div:nth-child(1) {
        grid-area: a;
    }
    .page-homepage .products-container > div:nth-child(2) {
        grid-area: b;
    }
    .page-homepage .products-container > div:nth-child(3) {
        grid-area: c;
    }
    .page-homepage .products-container > div:nth-child(4) {
        grid-area: d;
    }

    /* Show only first 4 products (2x2 grid) — default for most sections
       !important: overrides JSX scoped rules that force display on all children */
    .page-homepage .products-container > *:nth-child(n+5) {
        display: none !important;
    }

    /* Explore by Category: show 8 products (4 rows × 2 columns) */
    .page-homepage .trending-products-container .products-container {
        grid-template-rows: auto !important;
        grid-template-areas: none !important;
    }
    .page-homepage .trending-products-container .products-container > *:nth-child(n+5) {
        display: flex !important;
    }
    .page-homepage .trending-products-container .products-container > *:nth-child(n+9) {
        display: none !important;
    }
    .page-homepage .trending-products-container .products-container > div {
        grid-area: unset !important;
    }
}

/* ============================================
   HOMEPAGE SECTION — FIGMA REDESIGN
   BASE STYLES (all viewports)
   ============================================ */

/* === SECTION HEADING ROW: Figma layout === */
.page-homepage .showcase-section-heading-row {
    background: white;
    border: none;
    border-radius: 16px 16px 0 0;
    height: auto;
    align-items: center;
    justify-content: space-between;
    display: flex;
}

/* === SECTION TITLE: Inter 600 semi-bold, 366×28 === */
.page-homepage .showcase-section-heading {
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 28px;
    height: 28px;
    letter-spacing: 0;
    color: #2d1f1f;
    text-transform: capitalize;
}

/* === CTA BUTTON: solid dark pill (all sections default) === */
.page-homepage .jsx-2551956705.button {
    height: 48px;
    border-radius: 900px;
    border: none;
    background: #2d1f1f;
    padding: 0 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 126px;
    width: auto;
}

.page-homepage .jsx-1999640959.button-content,
.page-homepage .jsx-3286509370.button-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-homepage .jsx-1999640959.view-more,
.page-homepage .jsx-3286509370.view-more {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    font-family: Arial, sans-serif;
    line-height: 1;
}

/* === DESKTOP HERO MASK: white gradient from bottom to top === */
.page-homepage .jsx-3970551290.hero-image-mask,
.page-homepage .hero-image-mask {
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 1.00)  15%,
        rgba(255, 255, 255, 0.60) 20%,
        rgba(255, 255, 255, 0.00) 25%
    );
}

/* === NEW ARRIVALS: glass wrapper over hero === */
.page-homepage .new-arriaval-products-container .showcase-section {
    gap: 0;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    margin-bottom: 96px;
}

/* === NEW ARRIVALS: plain transparent heading row === */
.page-homepage .new-arriaval-products-container .showcase-section-heading-row {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    height: 88px;
    padding: 0 32px;
    box-sizing: border-box;
}

.page-homepage .new-arriaval-products-container .showcase-section-heading {
    color: white;
    font-size: 28px;
    font-weight: 500;
}

/* New Arrivals button: solid white, dark text */
.page-homepage .new-arriaval-products-container .jsx-2551956705.button {
    background: white;
}

.page-homepage .new-arriaval-products-container .jsx-1999640959.view-more {
    color: #2d1f1f;
}

/* === EXPLORE BY CATEGORY — Tab pills === */
.page-homepage .category-explore-heading-row {
    flex-wrap: wrap;
    gap: 16px;
    background: #ffffff;
    /* padding: 16px 0; */
}

/* Sticky clone — injected by JS */
.category-explore-sticky-clone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 201;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 15px;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.35s; /* Wait for header to finish hiding */
    pointer-events: none;
    box-sizing: border-box;
}
.category-explore-sticky-clone.visible {
    transform: translateY(0);
    pointer-events: auto;
}
/* When hiding, no delay — disappear before header reappears */
.category-explore-sticky-clone:not(.visible) {
    transition-delay: 0s;
}
.category-explore-sticky-clone .category-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-explore-sticky-clone .category-tabs::-webkit-scrollbar {
    display: none;
}
.category-explore-sticky-clone .category-tab {
    flex: 1 0 84px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    border: 1px solid rgba(45, 31, 31, 0.10);
    outline: none;
    color: #2d1f1f;
    background: transparent;
    line-height: 24px;
    white-space: nowrap;
    box-sizing: border-box;
}
.category-explore-sticky-clone .category-tab.category-tab--active {
    background: #1a1a1a;
    color: white;
    font-weight: 600;
    border-color: transparent;
}
/* Hide heading in clone on mobile */
.category-explore-sticky-clone .showcase-section-heading {
    display: none;
}
/* Desktop: show heading + tabs in a row, matching original layout */
@media (min-width: 769px) {
    .category-explore-sticky-clone {
        top: 0;
        justify-content: space-between;
        padding: 16px 32px;
        transition-delay: 0s;
    }
    .category-explore-sticky-clone:not(.visible) {
        transition-delay: 0s;
    }
    .category-explore-sticky-clone .showcase-section-heading {
        display: block;
        font-family: 'Inter', sans-serif;
        font-size: 32px;
        font-weight: 600;
        line-height: 28px;
        color: #2d1f1f;
        text-transform: capitalize;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .category-explore-sticky-clone .category-tabs {
        justify-content: flex-end;
    }
    .category-explore-sticky-clone .category-tab {
        flex: 0 0 auto;
    }
}

.page-homepage .category-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-homepage .category-tab {
    height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: Inter, sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    cursor: pointer;
    border: 1px solid rgba(45, 31, 31, 0.10);
    outline: none;
    color: #2d1f1f;
    background: transparent;
    line-height: 24px;
    white-space: nowrap;
    box-sizing: border-box;
}

.page-homepage .category-tab.category-tab--active {
    background: #1a1a1a;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    border-color: transparent;
}

/* "View More" button centered below the products grid */
.page-homepage .category-section-footer {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

/* ============================================
   HOMEPAGE FIGMA — MOBILE (max-width: 1023px)
   ============================================ */
@media (max-width: 1023px) {

    /* === MOBILE HERO MASK: Figma — very late white fade at 87.5% === */
    .page-homepage .jsx-3970551290.hero-image-mask,
    .page-homepage .hero-image-mask {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0) 87.5%, #fff);
    }

    /* === Main sections wrapper — transparent at top, white from 25vh down === */
    .page-homepage .full-height-flex > .jsx-1401438402 {
        background: linear-gradient(
            to bottom,
            transparent 0vh,
            #ffffff 25vh
        );
    }

    /* === Explicit white on all section containers below New Arrivals === */
    .page-homepage .best-sellers-products-container,
    .page-homepage .home-featured-section,
    .page-homepage .gift-products-container,
    .page-homepage .featured-products-container,
    .page-homepage .trending-products-container,
    .page-homepage .jsx-1844652196.vertical-spacer {
        background: #ffffff;
    }
    .page-homepage .jsx-1844652196.vertical-spacer {
        height: 72px;
    }

    /* === Category section footer === */
    .page-homepage .category-section-footer {
        padding-top: 32px;
        padding-bottom: 40px;
    }

    /* === Same horizontal spacing as other sections === */
    .page-homepage .new-arriaval-products-container.jsx-1401438402 {
        padding: 0 15px;
    }

    /* === Glass wrapper — Figma: light translucent, top-rounded only === */
    .page-homepage .new-arriaval-products-container .showcase-section {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(32px);
        -webkit-backdrop-filter: blur(32px);
        border-radius: 12px 12px 0 0;
        overflow: hidden;
        padding: 0;
        margin-bottom: 0;
    }

    /* === Heading row: Figma compact 48px, top-rounded === */
    .page-homepage .new-arriaval-products-container .showcase-section-heading-row {
        border-radius: 10px 10px 0 0;
        justify-content: center;
        height: 48px;
        padding: 6px 6px 5px 16px;
    }

    /* === Hide View More button from heading row on mobile — all sections === */
    .page-homepage .homepage-section .showcase-section-heading-row .jsx-2551956705.button {
        display: none;
    }

    /* === Product grid: 12px radius per Figma, no side margin === */
    .page-homepage .new-arriaval-products-container .products-container {
        border-radius: 12px;
        margin: 0;
    }

    /* === Product card: 262px total, 148px square image, 16px gap to text === */
    .page-homepage .homepage-section .product-card-wrapper a.jsx-2594485245 {
        padding: 15px;
        line-height: normal;
    }
    .page-homepage .homepage-section .image-container {
        flex: none;
        width: 100%;
        aspect-ratio: 1/1;
        height: auto;
        overflow: hidden;
        background: #f7f7f7;
    }
    .page-homepage .homepage-section .image-container img.jsx-2129118153 {
        width: 100%;
        height: 100%;
        margin: 0;
        object-fit: cover;
    }
    .page-homepage .homepage-section .text-wrapper .vertical-spacer {
        display: none;
    }
    .page-homepage .homepage-section .text-wrapper {
        padding-top: 7.5px;
    }
    .page-homepage .homepage-section .text-wrapper .model {
        font-family: 'Inter', sans-serif;
        font-weight: 500;
        font-size: 12px;
        line-height: 18px;
    }

    /* === All section containers: flex column, no top/bottom padding === */
    .page-homepage .homepage-section.jsx-1401438402 {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    /* === Heading rows: center title on mobile === */
    .page-homepage .homepage-section .showcase-section-heading-row {
        justify-content: center;
        width: 100%;
        padding: 0;
    }

    /* === Product grid wrapper === */
    .page-homepage .homepage-section .showcase-section {
        box-sizing: border-box;
    }

    /* === Section titles: 24px semi-bold, 28px line-height, 32px bottom margin === */
    .page-homepage .homepage-section .showcase-section-heading {
        font-family: 'Inter', sans-serif;
        font-size: 24px;
        font-weight: 600;
        line-height: 28px;
        letter-spacing: 0;
        color: #2d1f1f;
        text-transform: capitalize;
        text-align: center;
        width: 100%;
        margin-bottom: 32px;
    }
    /* New Arrivals title: white, no bottom margin — MUST come after generic rule */
    .page-homepage .new-arriaval-products-container .showcase-section-heading {
        color: #ffffff;
        margin-bottom: 0;
        height: auto;
    }

    /* === Explore by Category: stacked layout (title above pills) — Figma spec === */
    .page-homepage .homepage-section .category-explore-heading-row {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        /* padding: 16px 0; */
        margin-bottom: 32px;
    }
    .page-homepage .homepage-section .category-explore-heading-row .showcase-section-heading {
        margin-bottom: 0;
    }
    /* Pills row: 8px gap, scrollable when tabs overflow */
    .page-homepage .homepage-section .category-explore-heading-row .category-tabs {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .page-homepage .homepage-section .category-explore-heading-row .category-tabs::-webkit-scrollbar {
        display: none;
    }
    .page-homepage .homepage-section .category-explore-heading-row .category-tab {
        flex: 1 0 84px;
        height: 40px;
        text-align: center;
        justify-content: center;
        border-radius: 8px;
    }

    /* === Marquee: Figma 390×52, 14px/20px, #1A1A1A bg === */
    .page-homepage .marquee.jsx-13216223 {
        font-size: 14px;
        line-height: 20px;
        font-weight: 400;
        letter-spacing: 0;
        padding: 16px 0;
        margin: 0;
        background: #1A1A1A;
    }

    /* === Standalone View More button — dark pill below product grid === */
    .page-homepage .section-mobile-view-more {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 48px;
        border-radius: 900px;
        background: #2d1f1f;
        padding: 0 18px;
        margin-top: 32px;
        text-decoration: none;
        box-sizing: border-box;
    }
    /* First and last View More buttons: 24px bottom margin */
    .page-homepage .new-arriaval-products-container .section-mobile-view-more,
    .page-homepage .last-before-explore .section-mobile-view-more {
        margin-bottom: 24px;
    }

    /* Hide spacer when the section below it is hidden */
    .page-homepage .vertical-spacer:has(+ .homepage-section[style*="display: none"]) {
        display: none !important;
    }
    .page-homepage.dept-women .vertical-spacer:has(+ .homepage-section[data-has-women="false"]) {
        display: none !important;
    }
    .page-homepage.dept-men .vertical-spacer:has(+ .homepage-section[data-has-men="false"]) {
        display: none !important;
    }
    .page-homepage .new-arriaval-products-container:has(~ .best-sellers-products-container[style*="display: none"]) .section-mobile-view-more {
        margin-bottom: 0;
    }
    .page-homepage .section-mobile-view-more b {
        font-size: 14px;
        font-family: Arial, sans-serif;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #fff;
        line-height: 1;
    }

    /* === Product Price: 16px semi-bold === */
    .page-homepage .homepage-section .price-container .price {
        font-size: 16px;
        line-height: 24px;
        font-weight: 600;
    }

    /* === Section Spacing: remove all padding on showcase containers === */
    .page-homepage .best-sellers-products-container.jsx-1401438402,
    .page-homepage .gift-products-container.jsx-1401438402,
    .page-homepage .featured-products-container.jsx-1401438402,
    .page-homepage .trending-products-container.jsx-1401438402 {
        padding: 0px 15px;
    }

    /* === House of Brands: Figma mobile tile grid === */
    .page-homepage .brands-on-qatarshoes.homepage-section {
        padding: 40px 15px;
        gap: 20px;
    }
    .page-homepage .brands-on-qatarshoes.homepage-section .brands-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .page-homepage .brands-on-qatarshoes.homepage-section .brand-item {
        flex: unset;
        width: auto;
        height: auto;
        aspect-ratio: 1/1;
        border-radius: 7.48px;
        outline: none;
        border: 1px solid #e5e5e5;
    }
    .page-homepage .brands-on-qatarshoes.homepage-section .brand-image-container {
        height: 100%;
        padding: 0px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border: 1px solid #E5E5E5;
        transform: scale(1.5);
    }
    .page-homepage .brands-on-qatarshoes.homepage-section .brand-image-container img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    /* === Category Explore Pills: match Figma === */
    .page-homepage .category-tabs {
        gap: 8px;
    }
    .page-homepage .category-tab {
        height: 40px;
        padding: 0;
    }

    /* === Header Border: subtle grey === */
    .page-homepage .mobile-top-header-inside-hero,
    .page-homepage header[class*="jsx"] {
        border-bottom: 1px solid rgba(141, 141, 141, 0.18);
    }
}

/* ============================================
   HOMEPAGE FIGMA — DESKTOP (min-width: 1024px)
   ============================================ */
@media (min-width: 1024px) {

    /* === Section wrapper: full padding + gap between heading and grid === */
    .page-homepage .new-arriaval-products-container.jsx-1401438402,
    .page-homepage .best-sellers-products-container.jsx-1401438402,
    .page-homepage .gift-products-container.jsx-1401438402,
    .page-homepage .featured-products-container.jsx-1401438402 {
        padding: 40px ;
    }

    /* New Arrivals: 40px side padding, transparent over hero, white below */
    .page-homepage .new-arriaval-products-container.jsx-1401438402 {
        padding: 0 40px;
        background: linear-gradient(to bottom, transparent 0vh, transparent 50vh, #ffffff 50vh);
    }
    .page-homepage .showcase-section {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    /* === White background: spacer + Best Sellers container only === */
    .page-homepage .new-arriaval-products-container + .jsx-1844652196,
    .page-homepage .best-sellers-products-container,
    .page-homepage .best-sellers-products-container + .jsx-1844652196 {
        background: #ffffff;
    }

    /* Hide vertical spacers on desktop — keep on mobile only */
    .page-homepage .vertical-spacer {
        display: none;
    }

    /* === Category explore: desktop spacing === */
    .page-homepage .category-explore-heading-row {
        margin-top: 48px;
    }

    /* Sticky clone: desktop padding */
    .category-explore-sticky-clone {
        padding-left: 40px;
        padding-right: 40px;
    }

    /* === Hide standalone mobile View More on desktop === */
    .page-homepage .section-mobile-view-more {
        display: none;
    }

    /* === PRODUCTS GRID: beige bg, rounded corners, 1px card dividers === */

    /* New Arrivals: big card LEFT, 2×2 small cards RIGHT, rows fixed at 578px each */
    .page-homepage .new-arriaval-products-container .products-container.jsx-2630333056 {
        grid-template-areas: "a a b c" "a a d e";
        grid-template-rows: 578px 578px;
    }

    /* Explore by Category: uniform 4×3 grid (12 products, all equal size) */
    .page-homepage .trending-products-container .products-container.jsx-2492920896 {
        grid-template-areas: unset !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: auto !important;
    }
    .page-homepage .trending-products-container .products-container.jsx-2492920896 > * {
        grid-area: auto !important;
        grid-column: auto !important;
        grid-row: auto !important;
        display: flex !important;
    }

    /* Explore by Category: hide incomplete last row (only show multiples of 4) */
    .page-homepage .trending-products-container .products-container > :nth-child(4n+1):last-child,
    .page-homepage .trending-products-container .products-container > :nth-child(4n+1):nth-last-child(2),
    .page-homepage .trending-products-container .products-container > :nth-child(4n+1):nth-last-child(2) ~ *,
    .page-homepage .trending-products-container .products-container > :nth-child(4n+1):nth-last-child(3),
    .page-homepage .trending-products-container .products-container > :nth-child(4n+1):nth-last-child(3) ~ * {
        display: none !important;
    }

    /* New Arrivals: wrapper divs fill grid cells */
    .page-homepage .new-arriaval-products-container .products-container > div {
        overflow: hidden;
    }
    /* New Arrivals: ALL cards — text-wrapper always visible, image fills remaining space */
    .page-homepage .new-arriaval-products-container .products-container > div > a {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        overflow: hidden;
        flex: 1;
    }
    /* Image wrapper fills remaining space */
    .page-homepage .new-arriaval-products-container .products-container > div > a > div:not(.trending-label-container):not(.text-wrapper) {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .page-homepage .new-arriaval-products-container .products-container > div > a > div:not(.trending-label-container):not(.text-wrapper) img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: contain;
    }
    /* Text-wrapper: never shrinks, always at bottom */
    .page-homepage .new-arriaval-products-container .products-container > div > a .text-wrapper {
        flex: 0 0 auto;
        width: 100%;
    }
    /* Large card (first child) — image fills available space naturally */
    .page-homepage .new-arriaval-products-container .products-container > div:first-child > a > div:not(.trending-label-container):not(.text-wrapper) {
        flex: 1 1 0;
    }

    /* All homepage sections (except New Arrivals): square image area */
    .page-homepage .best-sellers-products-container .image-container,
    .page-homepage .gift-products-container .image-container,
    .page-homepage .featured-products-container .image-container,
    .page-homepage .trending-products-container .image-container {
        aspect-ratio: 1/1;
        flex: none;
        width: 100%;
        overflow: hidden;
        background: #f7f7f7;
    }
    .page-homepage .best-sellers-products-container .image-container img,
    .page-homepage .gift-products-container .image-container img,
    .page-homepage .featured-products-container .image-container img,
    .page-homepage .trending-products-container .image-container img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .page-homepage .products-container {
        border-radius: 12px;
        overflow: hidden;
        background: #E0DCD3;
        outline: 1px #E0DCD3 solid;
        outline-offset: -1px;
        gap: 1px;
        padding: 1px;
    }
}
