/**
 * Home hero carousel — plain CSS so aspect/dots work even when Tailwind
 * utilities are missing from the built bundle (e.g. classes only in PHP strings).
 */

/*
 * Same content column as trust / categories / product grids:
 * px-4 / sm:px-6 / lg:px-8 inside max-w-6xl. Gadgets skin zeroes
 * the large-desktop gutter so homepage blocks match the slider.
 */
.sf-hero-layout {
    width: 100%;
    box-sizing: border-box;
    padding-left: 1rem;
    padding-right: 1rem;
}
@media (min-width: 640px) {
    .sf-hero-layout {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}
@media (min-width: 1024px) {
    .sf-hero-layout {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/*
 * Never crop banner art: wide slides (e.g. 3:1) with object-cover + a taller
 * mobile frame cut off left/right text ("GAMING CHAIR"). Show the full image.
 */
[data-hero-carousel] [data-carousel-slide] > img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    min-height: 0;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
}

/* Gadgets skin used to force object-fit:cover + min-height on mobile, which
 * cropped left/right text on wide homepage banners. Keep full-bleed art. */
body.sf-skin-gadgets #storefront-app [data-hero-carousel] [data-carousel-slide] > img {
    min-height: 0;
    height: auto;
    width: 100%;
    object-fit: contain;
    object-position: center;
}

/* Desktop: taller 11∶5 frame so product banners are not squashed (with or without side tiles). */
@media (min-width: 1024px) {
    [data-hero-carousel] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel] [data-carousel-slide] > img {
        aspect-ratio: 11 / 5;
        width: 100%;
        height: auto;
        object-fit: cover;
        object-position: center;
    }
}

/*
 * Slider + side banners: 11∶5 (~2.2∶1) sets the row height so product art
 * is not squashed. The two side tiles share that same height (stacked).
 */
@media (min-width: 1024px) {
    .sf-hero-layout--sides {
        display: grid !important;
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 0.75rem;
    }
    .sf-hero-layout--sides.sf-hero-layout--left {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
    }
    .sf-hero-layout--sides.sf-hero-layout--left [data-hero-carousel] {
        grid-column: 2;
    }
    .sf-hero-layout--sides.sf-hero-layout--left .sf-hero-side-banners {
        grid-column: 1;
        grid-row: 1;
    }
    .sf-hero-layout--sides [data-hero-carousel] {
        min-width: 0;
        width: auto;
        max-width: none;
        align-self: stretch;
    }
    .sf-hero-layout--sides [data-hero-carousel] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app .sf-hero-layout--sides [data-hero-carousel] [data-carousel-slide] > img {
        aspect-ratio: 11 / 5;
        width: 100%;
        height: auto;
        object-fit: cover;
        object-position: center;
    }
    .sf-hero-layout--sides .sf-hero-side-banners {
        display: flex;
        min-width: 0;
        min-height: 0;
        height: 100%;
        flex-direction: column;
        gap: 0.75rem;
        grid-template-columns: none;
    }
    .sf-hero-layout--sides .sf-hero-side-banner {
        position: relative;
        flex: 1 1 0%;
        min-height: 0;
        aspect-ratio: auto !important;
    }
    .sf-hero-layout--sides .sf-hero-side-banner img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Dots sit near the bottom of the slide (short banners need a smaller offset). */
.hero-carousel-dots-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.75rem;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 0.25rem;
    pointer-events: none;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .hero-carousel-dots-wrap {
        bottom: 1rem;
    }
}

@media (min-width: 768px) {
    .hero-carousel-dots-wrap {
        bottom: 1.25rem;
    }
}

.hero-carousel-dots-wrap.hero-carousel-dots-wrap--overlay {
    bottom: 6.5rem;
}

@media (min-width: 640px) {
    .hero-carousel-dots-wrap.hero-carousel-dots-wrap--overlay {
        bottom: 7.5rem;
    }
}

@media (min-width: 768px) {
    .hero-carousel-dots-wrap.hero-carousel-dots-wrap--overlay {
        bottom: 8.5rem;
    }
}

.hero-carousel-dots-wrap .hero-carousel-dots-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    pointer-events: auto;
}

.hero-carousel-dots-wrap .hero-carousel-dot {
    box-sizing: border-box;
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    flex-shrink: 0;
    transition: width 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease;
}

.hero-carousel-dots-wrap .hero-carousel-dot:hover {
    background-color: #fff;
}

.hero-carousel-dots-wrap .hero-carousel-dot[aria-current='true'] {
    width: 1.75rem;
    height: 0.5rem;
    background-color: var(--sf-primary, #f97316);
    box-shadow: none;
}

/* Gadgets home: tight stack like the sample (slider → trust → categories). */
@media (min-width: 768px) {
    body.sf-skin-gadgets #storefront-app .sf-hero-layout {
        margin-top: 0.5rem;
        margin-bottom: 0.35rem;
    }
    body.sf-skin-gadgets #storefront-app .sf-trust-badges {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    body.sf-skin-gadgets #storefront-app .sf-category-grid {
        margin-top: 0;
        padding-top: 1rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Mobile: slider uses the same 1rem gutter as banners / trust / categories (not full-bleed). */
@media (max-width: 767px) {
    body.sf-skin-gadgets #storefront-app .sf-hero-layout {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    body.sf-skin-gadgets #storefront-app .sf-hero-layout [data-hero-carousel] {
        border-radius: 0.5rem;
        box-shadow: 0 1px 3px rgba(17, 24, 39, 0.1);
    }
    body.sf-skin-gadgets #storefront-app .sf-hero-side-banners {
        padding: 0.5rem 0 0;
        gap: 0.4rem;
    }
}

/*
 * Mobile fixed bars (Chat now / sticky cart) must not insert a blank
 * gap between the last homepage block (View all) and the footer.
 * Clearance lives on the footer so the last section sits tight.
 */
@media (max-width: 639px) {
    body:has(.sf-mobile-chat-bar) #main,
    body:has(.sf-floating-contact-mobile) #main,
    body:has(.sf-sticky-checkout-bar) #main {
        padding-bottom: 0;
    }

    body:has(.sf-mobile-chat-bar) footer,
    body:has(.sf-floating-contact-mobile) footer {
        padding-bottom: 5.75rem;
        margin-top: 0.5rem;
    }

    body:has(.sf-sticky-checkout-bar) footer {
        padding-bottom: 6.25rem;
        margin-top: 0.5rem;
    }
}

/*
 * Theme editor Phase 7: desktop height, phone crop, equal dots, arrows.
 * Default remains desktop 11∶5 + phone contain (full image). Crop/height
 * attrs must beat gadgets skin + StorefrontThemeCssVars contain/cover.
 */
@media (min-width: 1024px) {
    [data-hero-carousel][data-hero-height="compact"] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel][data-hero-height="compact"] [data-carousel-slide] > img {
        aspect-ratio: 3 / 1;
    }
    [data-hero-carousel][data-hero-height="tall"] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel][data-hero-height="tall"] [data-carousel-slide] > img {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 1023px) {
    [data-hero-carousel][data-hero-mobile-crop="center"] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel][data-hero-mobile-crop="center"] [data-carousel-slide] > img {
        aspect-ratio: 16 / 9;
        height: auto;
        object-fit: cover !important;
        object-position: center center !important;
    }
    [data-hero-carousel][data-hero-mobile-crop="top"] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel][data-hero-mobile-crop="top"] [data-carousel-slide] > img {
        aspect-ratio: 16 / 9;
        height: auto;
        object-fit: cover !important;
        object-position: center top !important;
    }
    [data-hero-carousel][data-hero-mobile-crop="bottom"] [data-carousel-slide] > img,
    body.sf-skin-gadgets #storefront-app [data-hero-carousel][data-hero-mobile-crop="bottom"] [data-carousel-slide] > img {
        aspect-ratio: 16 / 9;
        height: auto;
        object-fit: cover !important;
        object-position: center bottom !important;
    }
}

[data-hero-carousel][data-hero-dots="dots"] .hero-carousel-dot[aria-current='true'] {
    width: 0.5rem;
    min-width: 0.5rem;
    height: 0.5rem;
    background-color: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.hero-carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: rgba(24, 24, 27, 0.55);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.hero-carousel-arrow:hover {
    background: rgba(24, 24, 27, 0.75);
}
.hero-carousel-arrow--prev {
    left: 0.5rem;
}
.hero-carousel-arrow--next {
    right: 0.5rem;
}
