:root {
    --header-top: clamp(0.75rem, 2.5vw, 2rem);
    --header-gap: clamp(0.75rem, 2vw, 2rem);
    --header-pad-x: clamp(0.75rem, 2vw, 1.5rem);
    --header-pad-y: 0px;
    --header-max: 1800px;
    --header-font: clamp(0.85rem, 0.8rem + 0.25vw, 1rem);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ==========================================
   1. HERO CAROUSEL (base = mobile first)
   ========================================== */
.hero-carousel {
    --hero-gutter: clamp(0.5rem, 1.2vw, 1.25rem);
    --hero-bottom-space: clamp(2rem, 6vh, 4rem);
    --hero-radius: clamp(1.25rem, 3vw, 2.75rem);
    --hero-accent: #ffffff;
    --hero-ink: #111111;

    /* Glass tokens */
    --glass-bg: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18),
        rgba(255, 255, 255, 0.06)
    );
    --glass-border: rgba(255, 255, 255, 0.28);
    --glass-blur: blur(22px);
    --glass-shadow:
        0 20px 50px -20px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);

    position: relative;
    width: calc(100% - (var(--hero-gutter) * 2));
    height: calc(82vh - (var(--hero-gutter) * 2));
    height: calc(82svh - (var(--hero-gutter) * 2));
    min-height: clamp(24rem, 60vh, 28rem);
    max-height: 70rem;
    margin: calc(var(--header-top) * -1.5) auto var(--hero-gutter);
    overflow: hidden;
    border-radius: var(--hero-radius);
    color: #fff;
    background: #111111;
    isolation: isolate;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.55);
    contain: layout paint;
}

.hero-carousel img,
.hero-carousel video {
    max-width: 100%;
    object-fit: cover;
}

/* ==========================================
   2. SITE HEADER (base = mobile first)
   ========================================== */
.site-header {
    position: sticky;
    top: calc(
        var(--header-top) + var(--safe-top) + var(--header-offset, 0.75rem)
    );
    z-index: 50;
    box-sizing: border-box;
    width: min(calc(100% - 1.5rem), var(--header-max));
    margin: var(--header-gap) auto 0;
    padding: var(--header-pad-y) var(--header-pad-x);
    font-size: var(--header-font);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

/* Scroll hide/show navbar */
.site-header--hidden {
    transform: translateY(-100%);
    pointer-events: none;
}

.site-header--visible {
    transform: translateY(0);
    pointer-events: auto;
}

/* Product page: header above section (no negative margin overlap) */
body.product-page .site-header {
    position: sticky;
    top: var(--safe-top);
    margin-bottom: 1rem;
    border-radius: revert-rule;
    /* border-radius: 0 0 1.5rem 1.5rem; */
}

/* Product page hero carousel adjustment */
body.product-page .hero-carousel {
    margin-top: 0 !important;
}

/* ==========================================
   3. SMALL PHONES (up to 480px)
   ========================================== */
@media (max-width: 480px) {
    .hero-carousel {
        --hero-gutter: 0.75rem;
        --hero-radius: 1.75rem;
        height: calc(78svh - (var(--hero-gutter) * 2));
        min-height: 24rem;
        margin: var(--hero-gutter) auto;
        border-radius: var(--hero-radius);
        overflow: hidden;
    }

    .hero-carousel-image {
        border-radius: var(--hero-radius);
    }

    .hero-carousel-dots {
        position: absolute;
        bottom: 1rem;
        left: 1rem;
        right: auto;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0.5rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 999px;
        backdrop-filter: blur(8px);
    }

    .site-header {
        top: var(--hero-gutter);
        left: var(--hero-gutter);
        right: var(--hero-gutter);
        z-index: 10;

        background: rgba(18, 18, 22, 0.85) !important;
        border-color: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(16px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        min-height: 2.75rem;
        width: 100%;
    }

    .header-brand-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        position: relative;
    }

    .header-logo {
        width: 6.5rem;
        height: auto;
        aspect-ratio: 1380 / 530;
    }

    .header-tools {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 0 0 auto;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        background: transparent;
        border: none;
        color: #fff;
    }

    /* Hide desktop nav on mobile */
    .desktop-nav {
        display: none !important;
    }
}

/* ==========================================
   4. MOBILE (481px to 767px)
   Stops at 767px so the tablet band (>= 768px) owns its own layout.
   ========================================== */
@media (min-width: 481px) and (max-width: 767px) {
    .hero-carousel {
        --hero-gutter: 1rem;
        --hero-radius: 2rem;
        height: calc(80svh - (var(--hero-gutter) * 2));
        margin: var(--hero-gutter) auto;
        border-radius: var(--hero-radius);
        overflow: hidden;
    }

    .hero-carousel-image {
        border-radius: var(--hero-radius);
    }

    .hero-carousel-dots {
        position: absolute;
        bottom: 1.25rem;
        left: 1.25rem;
        right: auto;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 999px;
        backdrop-filter: blur(8px);
    }

    .site-header {
        width: 92%;
        max-width: 480px;
        padding-inline: 1rem;
        font-size: 0.9rem;
        position: absolute;
        top: var(--hero-gutter);
        left: var(--hero-gutter);
        right: var(--hero-gutter);
        z-index: 10;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0.5rem 1rem;
        border-radius: 999px;
        background: rgba(18, 18, 22, 0.85) !important;
        border-color: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(16px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-height: 3rem;
        width: 100%;
    }

    .header-brand-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        position: relative;
    }

    .header-logo {
        width: 7.5rem;
        height: auto;
        aspect-ratio: 1380 / 530;
    }

    .header-tools {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    .menu-toggle {
        display: grid;
        place-items: center;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        background: transparent;
        border: none;
        color: #fff;
    }

    /* Hide desktop nav on mobile. Stops at 767px so the tablet rule
       (min-width: 768px, in glassmorphism.css) can show it. */
    .desktop-nav {
        display: none !important;
    }
}

/* ==========================================
   MOBILE PERFORMANCE OVERRIDES (<= 767px)
   Keeps backdrop-filter on floating header, disables on other elements.
   Stops at 767px so the tablet band (>= 768px) owns its own layout.
   ========================================== */
@media (max-width: 767px) {
    .site-header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(18, 18, 22, 0.92) !important;
        border-color: rgba(255, 255, 255, 0.18);
    }
    .hero-carousel-controls {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(18, 18, 22, 0.88) !important;
        border-color: rgba(255, 255, 255, 0.18);
    }
}

/* ==========================================
   5. TABLET (768px to 1023px)
   Starts at 768px so iPad mini portrait (768px) gets the tablet layout
   instead of falling into a gap between the mobile and tablet bands.
   ========================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-carousel {
        margin: calc(var(--header-top) * -1.5) auto var(--hero-gutter);
        height: calc(75svh - (var(--hero-gutter) * 2));
    }

    .site-header {
        width: 94%;
        max-width: 720px;
        padding-inline: 1.5rem;
        padding-block: 0.4rem;
        font-size: 0.95rem;
    }
}

/* ==========================================
   6. LAPTOP (1024px to 1279px)
   ========================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .hero-carousel {
        margin: calc(var(--header-top) * -1.5) auto var(--hero-gutter);
        height: calc(80svh - (var(--hero-gutter) * 2));
    }

    .site-header {
        width: min(calc(100% - 2rem), 1200px);
    }
}

/* ==========================================
   7. LARGE DESKTOP / ULTRAWIDE (1280px+)
   ========================================== */
@media (min-width: 1280px) {
    .hero-carousel {
        margin: calc(var(--header-top) * -1.5) auto var(--hero-gutter);
        height: calc(94svh - (var(--hero-gutter) * 2));
        max-width: 2200px;
    }

    .site-header {
        width: min(calc(100% - 4rem), var(--header-max));
    }
}

/* ==========================================
   8. LANDSCAPE PHONES / SHORT SCREENS
   ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .site-header {
        top: calc(0.5rem + var(--safe-top));
        margin-top: 0.5rem;
        padding-block: 0.2rem;
    }

    .hero-carousel {
        height: calc(100svh - (var(--hero-gutter) * 2));
        min-height: 18rem;
        margin: calc(var(--header-top) * -1.5) auto var(--hero-gutter);
    }
}

/* ==========================================
   8b. SHORT LAPTOPS — 1366x768 class

   At >= 1280px the hero is 94svh tall, which on a 768px-tall screen works out
   to ~690px: the announcement bar + floating header then push the copy, the
   dots and the "Shop Now" notch down to the very bottom edge (and sometimes
   past it). Cap the height against the real viewport so the whole hero —
   copy, controls and notch — stays visible above the fold on a 1366x768
   laptop without changing the layout on taller desktops.
   ========================================== */
@media (min-width: 1024px) and (max-height: 820px) {
    .hero-carousel {
        /* 78svh of 768px leaves room for the announcement bar (~2.5rem) plus the
           floating header so the bottom edge of the hero is never clipped. */
        height: clamp(26rem, 78svh, 42rem);
        min-height: 26rem;
        max-height: 42rem;
    }

    .hero-carousel-copy h1 {
        font-size: clamp(2.2rem, 4.6vw, 4rem);
    }

    .hero-carousel-description {
        margin-top: 0.9rem;
        font-size: clamp(0.88rem, 1.1vw, 1.05rem);
    }

    .hero-carousel-copy .button {
        margin-top: 1.15rem;
    }
}

/* ==========================================
   9. BROWSER FALLBACKS & ACCESSIBILITY
   ========================================== */
@supports not (backdrop-filter: blur(1px)) {
    .site-header {
        background: rgba(17, 17, 17, 0.7);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-carousel,
    .site-header {
        transition: none;
        animation: none;
    }
}

.hero-carousel-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: inherit;
}

.hero-carousel-picture,
.hero-carousel-image,
.hero-carousel-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-carousel-picture {
    z-index: 0;
    overflow: hidden;
}

.hero-carousel-image {
    z-index: 0;
    object-fit: cover;
    object-position: center;
    transform: translateZ(0);
}

.hero-carousel-shade {
    z-index: 1;
    background: linear-gradient(
        90deg,
        rgba(8, 15, 18, 0.62) 0%,
        rgba(8, 15, 18, 0.32) 48%,
        rgba(8, 15, 18, 0.04) 100%
    );
}

.hero-carousel-copy .eyebrow {
    margin: 0 0 0.85rem;
    color: inherit;
    font-size: clamp(0.7rem, 1vw, 0.9rem);
    font-weight: 750;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.hero-carousel-copy h1 {
    max-width: 13ch;
    margin: 0;
    color: inherit;
    font-family: var(--font-heading, "Inter", Arial, sans-serif);
    font-size: clamp(2.4rem, 5.4vw, 5.35rem);
    font-weight: 750;
    letter-spacing: -0.055em;
    line-height: 1.02;
    text-wrap: balance;
}

.hero-carousel-description {
    max-width: 39rem;
    margin: 1.15rem 0 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(0.92rem, 1.25vw, 1.15rem);
    line-height: 1.65;
}

.hero-carousel-copy .button {
    margin-top: 1.5rem;
}

/* ---------- Controls ---------- */

.hero-carousel-controls {
    position: absolute;
    right: clamp(1.25rem, 3vw, 2.75rem);
    bottom: clamp(1.25rem, 3vw, 2.5rem);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.hero-carousel-arrow,
.hero-carousel-dot {
    display: grid;
    padding: 0;
    place-items: center;
    border: 0;
    color: #fff;
    cursor: pointer;
}

.hero-carousel-arrow {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.2rem;
    line-height: 1;
    transition:
        background 180ms ease,
        color 180ms ease;
}

.hero-carousel-arrow:hover {
    color: var(--hero-ink);
    background: #fff;
}

.hero-carousel-dots {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hero-carousel-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition:
        width 220ms ease,
        background 220ms ease;
}

.hero-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

.hero-carousel-dot[aria-current="true"] {
    width: 1.5rem;
    border-radius: 999px;
    background: #fff;
}

.hero-carousel-arrow:focus-visible,
.hero-carousel-dot:focus-visible {
    outline: 2px solid var(--hero-accent);
    outline-offset: 3px;
}

/* ---------- Tablet ---------- */

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-carousel {
        --hero-gutter: 0.9rem;
        height: clamp(30rem, 70svh, 46rem);
        min-height: 30rem;
    }

    .hero-carousel-copy {
        width: min(100% - 2rem, 40rem);
        margin-left: clamp(1.25rem, 4vw, 3rem);
    }

    .hero-carousel-copy h1 {
        font-size: clamp(2.5rem, 6vw, 4.2rem);
    }
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
    .hero-carousel {
        --hero-gutter: 0.5rem;
        height: clamp(31rem, 78svh, 43rem);
        min-height: 31rem;
    }

    .hero-carousel-slide {
        align-items: center;
        padding-bottom: 4.25rem;
    }

    .hero-carousel-image {
        object-position: center;
    }

    .hero-carousel-shade {
        background: linear-gradient(
            0deg,
            rgba(8, 15, 18, 0.62) 0%,
            rgba(8, 15, 18, 0.28) 58%,
            rgba(8, 15, 18, 0.04) 100%
        );
    }

    .hero-carousel-copy {
        width: calc(100% - 1.5rem);
        margin: 0 auto;
        padding: clamp(1rem, 5vw, 1.5rem);
        border-radius: 1rem;
    }

    .hero-carousel-copy h1 {
        max-width: 12ch;
        font-size: clamp(2.15rem, 10vw, 3.25rem);
    }

    .hero-carousel-description {
        margin-top: 0.8rem;
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .hero-carousel-copy .button {
        min-height: 2.8rem;
        margin-top: 1rem;
    }

    .hero-carousel-controls {
        right: 50%;
        bottom: 1rem;
        transform: translateX(50%);
        gap: 0.65rem;
        padding: 0.35rem 0.45rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-carousel-dot,
    .hero-carousel-arrow {
        transition: none;
    }
}

/* ==========================================
   STOREFRONT REDESIGN: hero card, dots, Shop Now notch
   ========================================== */
:root {
    --page-bg: #f4f5f6; /* must match your page background (body.storefront gradient) */
    --hero-red: #e53935;
}

/* ---------- 1. HERO: dots bottom-left, no arrows, no glass pill ---------- */
.hero-carousel {
    --notch-r: 1.5rem;
}

.hero-carousel .hero-carousel-controls {
    left: clamp(1.1rem, 2.5vw, 2.25rem);
    right: auto;
    bottom: clamp(1.1rem, 2.5vw, 2.25rem);
    transform: none;
    gap: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none !important;
    box-shadow: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.hero-carousel .hero-carousel-arrow {
    display: none;
}

.hero-carousel .hero-carousel-dots {
    position: static;
    padding: 0;
    gap: 0.4rem;
    background: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero-carousel .hero-carousel-dot {
    width: 0.6rem;
    height: 0.6rem;
    background: rgba(255, 255, 255, 0.55);
}

.hero-carousel .hero-carousel-dot[aria-current="true"] {
    width: 1.7rem;
    background: var(--hero-red);
}

/* If your slide images already contain the headline/text (like the RONIN banner),
   uncomment these two rules to hide the extra text + dark overlay:
.hero-carousel .hero-carousel-copy  { display: none; }
.hero-carousel .hero-carousel-shade { display: none; }
*/

/* ---------- 2. SHOP NOW notch, bottom-right of the hero ---------- */
/* Add ONE of these inside .hero-carousel in your hero Blade:
   <a href="{{ $url }}" class="hero-carousel-cta">Shop Now <svg ...cart icon...></svg></a> */
.hero-carousel .hero-carousel-cta {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.15rem 0.8rem 1.4rem;
    background: var(--page-bg);
    color: #1e3a8a;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border-top-left-radius: var(--notch-r);
}

.hero-carousel .hero-carousel-cta svg {
    width: 1.35rem;
    height: 1.35rem;
}

/* smooth inverted corners so the notch flows into the hero edges */
.hero-carousel .hero-carousel-cta::before,
.hero-carousel .hero-carousel-cta::after {
    content: "";
    position: absolute;
    width: var(--notch-r);
    height: var(--notch-r);
    pointer-events: none;
    background: radial-gradient(
        circle at 0 0,
        transparent var(--notch-r),
        var(--page-bg) calc(var(--notch-r) + 1px)
    );
}
.hero-carousel .hero-carousel-cta::before {
    right: 100%;
    bottom: 0;
}
.hero-carousel .hero-carousel-cta::after {
    right: 0;
    bottom: 100%;
}

/* ---------- Desktop hero: bigger notch ---------- */
@media (min-width: 1024px) {
    .hero-carousel {
        --notch-r: 2.25rem;
    }

    .hero-carousel .hero-carousel-cta {
        gap: 0.8rem;
        padding: 1.1rem 2.25rem 1.1rem 2.5rem;
        font-size: clamp(1.1rem, 1.7vw, 1.6rem);
    }
    .hero-carousel .hero-carousel-cta svg {
        width: 2rem;
        height: 2rem;
    }
}

/* ---------- 5. HEADER FLOATS OVER THE HERO CARD (same behaviour at every size) ----------
   Your hero-carousel.css only pulled the hero up by ~1rem, so the header sat above the card
   instead of on top of it. This pulls the hero up by exactly the header height. */
body.storefront:not(.product-page) {
    --hdr-h: 3.6rem; /* header height: inner 2.75rem + padding + border */
    --hdr-mt: 1.1rem; /* gap above the header */
}

body.storefront:not(.product-page) .site-header {
    position: sticky;
    top: calc(var(--safe-top) + 0.5rem);
    left: auto;
    right: auto;
    z-index: 50;
    margin: var(--hdr-mt) auto 0;
}

body.storefront:not(.product-page) .hero-carousel {
    margin-top: calc(-1 * (var(--hdr-h) + var(--hdr-mt)) + var(--hero-gutter));
}

@media (max-width: 767px) {
    body.storefront:not(.product-page) .site-header {
        width: calc(100% - 1.5rem);
        max-width: 560px;
        padding: 0.4rem 0.75rem;
        border-radius: 999px;
    }
}

@media (min-width: 768px) {
    body.storefront:not(.product-page) {
        --hdr-h: 4.3rem;
        --hdr-mt: 1.25rem;
    }
}
