/**
 * 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] {
    position: relative;
    aspect-ratio: 11 / 5;
    overflow: hidden;
}
[data-hero-carousel] [data-carousel-slide] > a {
    position: absolute;
    inset: 0;
    display: block;
}
[data-hero-carousel] [data-carousel-slide] > img,
[data-hero-carousel] [data-carousel-slide] img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    min-height: 0;
    aspect-ratio: auto;
    object-fit: cover;
    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;
    }
}

.sf-hero-side-banner .sf-side-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .45s ease;
    pointer-events: none;
}
.sf-hero-side-banner .sf-side-slide.is-on {
    opacity: 1;
    pointer-events: auto;
}
.sf-hero-side-banner .sf-side-slide img {
    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;
    }
}

/* Phone: the two tiles stay in one short row under the slider. Art is 2∶1, so cover does not crop the wording. */
@media (max-width: 1023px) {
    .sf-hero-side-banners {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        min-width: 0;
    }
    .sf-hero-side-banner {
        aspect-ratio: 2 / 1;
        min-width: 0;
    }
    .sf-hero-layout,
    .sf-category-grid,
    .sf-category-grid .max-w-6xl {
        max-width: 100%;
        min-width: 0;
    }
    .sf-category-grid-heading h2 {
        overflow-wrap: anywhere;
    }
}

/*
 * 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],
    [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],
    [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-carousel-slide] {
        aspect-ratio: 11 / 5;
    }
    [data-hero-carousel][data-hero-mobile-crop="center"] [data-carousel-slide] > img,
    [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: auto;
        height: 100%;
        object-fit: cover !important;
        object-position: center center !important;
    }
    [data-hero-carousel][data-hero-mobile-crop="top"] [data-carousel-slide] > img,
    [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: auto;
        height: 100%;
        object-fit: cover !important;
        object-position: center top !important;
    }
    [data-hero-carousel][data-hero-mobile-crop="bottom"] [data-carousel-slide] > img,
    [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: auto;
        height: 100%;
        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);
}

/* Dot designs. The section attribute updates in the editor even while the carousel is ignored. */
.sf-hero-section[data-hero-dots="dots"] .hero-carousel-dot,
.sf-hero-section[data-hero-dots="dots"] .hero-carousel-dot[aria-current='true'] {
    width: 0.55rem;
    min-width: 0.55rem;
    height: 0.55rem;
    background-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.sf-hero-section[data-hero-dots="dots"] .hero-carousel-dot[aria-current='true'] {
    background-color: var(--sf-primary, #f97316);
    box-shadow: none;
}

.sf-hero-section[data-hero-dots="bars"] .hero-carousel-dot,
.sf-hero-section[data-hero-dots="bars"] .hero-carousel-dot[aria-current='true'] {
    width: 1.15rem;
    min-width: 1.15rem;
    height: 0.28rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
}
.sf-hero-section[data-hero-dots="bars"] .hero-carousel-dot[aria-current='true'] {
    width: 2.1rem;
    min-width: 2.1rem;
    background-color: var(--sf-primary, #f97316);
}

.sf-hero-section[data-hero-dots="numbers"] .hero-carousel-dots-row {
    counter-reset: sf-hero-dot;
}
.sf-hero-section[data-hero-dots="numbers"] .hero-carousel-dot,
.sf-hero-section[data-hero-dots="numbers"] .hero-carousel-dot[aria-current='true'] {
    counter-increment: sf-hero-dot;
    width: auto;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.92);
    color: #18181b;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}
.sf-hero-section[data-hero-dots="numbers"] .hero-carousel-dot::before {
    content: counter(sf-hero-dot);
}
.sf-hero-section[data-hero-dots="numbers"] .hero-carousel-dot[aria-current='true'] {
    background-color: var(--sf-primary, #f97316);
    color: #fff;
    box-shadow: none;
}

.sf-hero-section[data-hero-dots="rings"] .hero-carousel-dot,
.sf-hero-section[data-hero-dots="rings"] .hero-carousel-dot[aria-current='true'] {
    width: 0.72rem;
    min-width: 0.72rem;
    height: 0.72rem;
    background-color: transparent;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.92);
}
.sf-hero-section[data-hero-dots="rings"] .hero-carousel-dot[aria-current='true'] {
    background-color: #fff;
    box-shadow: inset 0 0 0 2px var(--sf-primary, #f97316);
}

.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;
}

/*
 * Gadget Monkey desktop column matches Nexora: 1330px, main slide 982×500,
 * side tiles 315px. A full-bleed 11∶5 frame goes flat on a wide monitor.
 */
@media (min-width: 1024px) {
    body.sf-look-gadget-monkey #storefront-app .sf-hero-layout,
    body.sf-look-gadget-monkey #storefront-app:not(.sf-site-boxed) .max-w-6xl,
    body.sf-look-gadget-monkey #storefront-app .sf-scroll-text-wrap,
    body.sf-look-gadget-monkey .sf-gadgets-header > .mx-auto,
    body.sf-look-gadget-monkey .sf-gadgets-cat-strip > .mx-auto {
        max-width: min(1330px, calc(100% - 30px)) !important;
        margin-left: auto;
        margin-right: auto;
    }

    body.sf-look-gadget-monkey #storefront-app .sf-hero-layout,
    body.sf-look-gadget-monkey #storefront-app .sf-scroll-text-wrap,
    body.sf-look-gadget-monkey #storefront-app .max-w-6xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Hero content keeps a 1.5rem inset. The logo row and category row use the
       same inset so they line up with the slider and category cards. */
    body.sf-look-gadget-monkey .sf-gadgets-header > .mx-auto,
    body.sf-look-gadget-monkey .sf-gadgets-cat-strip > .mx-auto {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    /* Product, cart, checkout, footer, and narrow page roots use the home column. */
    body.sf-look-gadget-monkey #storefront-app .sf-pdp-shell,
    body.sf-look-gadget-monkey #storefront-app footer .max-w-6xl,
    body.sf-look-gadget-monkey #storefront-app .sf-footer-chrome > .w-full,
    body.sf-look-gadget-monkey #storefront-app .sf-footer-row > .w-full,
    body.sf-look-gadget-monkey #storefront-app main > .max-w-3xl,
    body.sf-look-gadget-monkey #storefront-app main > .max-w-4xl,
    body.sf-look-gadget-monkey #storefront-app main > .max-w-5xl {
        max-width: min(1330px, calc(100% - 30px)) !important;
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    body.sf-look-gadget-monkey #storefront-app .sf-hero-layout--sides {
        grid-template-columns: minmax(0, 982fr) minmax(0, 315fr) !important;
        gap: 15px !important;
    }

    body.sf-look-gadget-monkey #storefront-app .sf-hero-layout--sides.sf-hero-layout--left {
        grid-template-columns: minmax(0, 315fr) minmax(0, 982fr) !important;
    }

    body.sf-look-gadget-monkey #storefront-app .sf-hero-layout--sides [data-carousel-slide] > img {
        aspect-ratio: 982 / 500 !important;
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    body.sf-look-gadget-monkey #storefront-app .sf-hero-side-banners {
        gap: 15px !important;
    }
}

.sf-hero-video {
    aspect-ratio: 11 / 5;
}
.sf-hero-video[data-hero-height="compact"] { aspect-ratio: 3 / 1; }
.sf-hero-video[data-hero-height="tall"] { aspect-ratio: 16 / 9; }
@media (max-width: 1023px) {
    .sf-hero-video.has-phone { aspect-ratio: 4 / 5; }
}
.sf-hero-clip {
    display: none;
    position: absolute;
    inset: 0;
}
.sf-hero-clip.is-on { display: block; }
.sf-hero-clip__link,
.sf-hero-clip__desktop,
.sf-hero-clip__phone,
.sf-hero-clip__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    background: #18181b;
}
.sf-hero-clip__phone { display: none; }
@media (max-width: 1023px) {
    .sf-hero-clip.has-phone .sf-hero-clip__desktop { display: none; }
    .sf-hero-clip.has-phone .sf-hero-clip__phone { display: block; }
}
.sf-hero-video.is-contain .sf-hero-clip__desktop,
.sf-hero-video.is-contain .sf-hero-clip__phone { object-fit: contain; }
.sf-hero-sound {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 3;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}
.sf-hero-offer {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    z-index: 3;
    max-width: min(28rem, calc(100% - 1.5rem));
    pointer-events: none;
    border-radius: 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 0.45rem 0.7rem;
}
.sf-hero-offer p { margin: 0; font-size: 14px; font-weight: 650; }
.sf-hero-offer p + p { margin-top: 0.15rem; font-variant-numeric: tabular-nums; font-size: 13px; }
