﻿/* =========================================================
BREAKPOINTS
Desktop:  >= 992px
Tablet:   768px .. 991.98px
Mobile:   < 768px
========================================================= */
:root {
    --header-control-height: 44px;
}

.top-menu-menu .navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    width: 100%;
}

.top-menu-logo {
    display: flex;
    align-items: center;
    height: var(--header-control-height);
}

    .top-menu-logo a {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .top-menu-logo img.logo-img {
        height: 100%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        display: block;
    }

/* =========================================================
Theme icon button (Desktop + Tablet)
========================================================= */
@media (min-width: 768px) {
    .theme-toggle.theme-toggle--icon {
        --h: var(--header-control-height);
        width: var(--h);
        height: var(--h);
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
    }

        .theme-toggle.theme-toggle--icon .theme-toggle__label {
            display: none;
        }

        .theme-toggle.theme-toggle--icon .theme-toggle__knob {
            width: 100%;
            height: 100%;
            border-radius: inherit;
            background: transparent !important;
            border: 0 !important;
            box-shadow: none !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .theme-toggle.theme-toggle--icon:not(.is-dark) {
            background: #f5b301;
            border: 1px solid #f59e0b55;
            color: #3b2f00;
            box-shadow: 0 3px 12px rgba(245,158,11,.25);
        }

        .theme-toggle.theme-toggle--icon.is-dark {
            background: #1e3a8a;
            border: 1px solid #60a5fa55;
            color: #ffe58f;
            box-shadow: 0 3px 12px rgba(96,165,250,.25);
        }

        .theme-toggle.theme-toggle--icon .theme-toggle__knob .bi {
            font-size: 1.15rem;
            color: inherit !important;
        }
}

/* =========================================================
Desktop (>= 992px)
========================================================= */
@media (min-width: 992px) {
    .logo-col {
        padding-inline-end: 0;
    }

    .search-col {
        padding-inline-start: 0;
    }

        .search-col .sa-search-wrapper {
            width: 100%;
            margin-inline: 0 !important;
        }

    .top-menu-logo {
        padding-inline-end: 15px;
        padding-inline-start: 0;
    }

    .theme-toggle-item {
        margin-inline-start: .5rem;
    }
}

/* =========================================================
Tablet (768px .. 991.98px)
========================================================= */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root {
        --header-control-height: 44px;
    }

    .logo-col {
        padding-inline-end: 0;
    }

    .search-col {
        padding-inline-start: 0;
    }

    .top-menu-logo {
        padding-inline-end: 12px;
        padding-inline-start: 0;
    }

    .search-col .sa-search-box {
        height: var(--header-control-height);
        display: flex;
        align-items: center;
    }

    .search-col .sa-search-input {
        height: var(--header-control-height);
        padding-block: 0;
        font-size: 13px;
    }

    .header-actions--main {
        gap: 0 !important;
    }

        .header-actions--main > li {
            margin: 0 !important;
        }

            .header-actions--main > li:not(:first-child) {
                margin-inline-start: 6px !important;
            }

            .header-actions--main > li > a,
            .header-actions--main > li > button:not(.theme-toggle) {
                width: var(--header-control-height);
                height: var(--header-control-height);
                padding: 0 !important;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                line-height: 1;
            }

            .header-actions--main > li > a {
                font-size: 0;
            }

                .header-actions--main > li > a i,
                .header-actions--main > li > a .bi {
                    font-size: 1.1rem !important;
                    line-height: 1 !important;
                    display: block;
                }

    .menu-row {
        margin-top: .5rem !important;
    }
}

/* =========================================================
Mobile (< 768px)
========================================================= */
@media (max-width: 767.98px) {
    :root {
        --header-control-height: 40px;
    }

    header {
        padding-bottom: 0 !important;
    }

    .mobile-hamburger {
        width: var(--header-control-height);
        height: var(--header-control-height);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--sa-border-color);
        border-radius: var(--sa-btn-radius);
        background: var(--sa-btn-secondary);
        box-shadow: 0 1px 2px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.05);
    }

        .mobile-hamburger .bi {
            font-size: 1.25rem;
        }

    .mobile-logo {
        display: inline-flex;
        align-items: center;
        height: var(--header-control-height);
    }

        .mobile-logo img.logo-img {
            height: 30px;
            width: auto;
            display: block;
        }

    .header-actions--mobile {
        gap: 6px;
    }

        .header-actions--mobile > li {
            margin: 0 !important;
        }

            .header-actions--mobile > li > a,
            .header-actions--mobile > li > button:not(.theme-toggle) {
                width: var(--header-control-height) !important;
                height: var(--header-control-height) !important;
                padding: 0 !important;
                display: inline-flex !important;
                align-items: center !important;
                justify-content: center !important;
                line-height: 1 !important;
                box-sizing: border-box;
            }

            .header-actions--mobile > li > a {
                font-size: 0 !important;
            }

                .header-actions--mobile > li > a i,
                .header-actions--mobile > li > a .bi {
                    font-size: 1.1rem !important;
                    line-height: 1 !important;
                    display: block;
                }
    /* Search row */
    .mobile-search-row {
        margin-top: 10px;
        margin-bottom: 10px;
        position: relative;
    }

        .mobile-search-row .sa-search-wrapper {
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            min-width: 0 !important;
            position: relative;
        }

        .mobile-search-row .sa-search-box {
            width: 100% !important;
            max-width: none !important;
        }

        .mobile-search-row .sa-search-input-mobile {
            width: 100% !important;
            max-width: none !important;
            height: var(--header-control-height) !important;
            padding-block: 0 !important;
        }

        .mobile-search-row .sa-search-dropdown {
            position: absolute;
            top: 100%;
            inset-inline-start: 0;
            inset-inline-end: 0;
            z-index: 10058; /* was 99999 */
            background: var(--sa-card-bg, #fff);
            border: 1px solid var(--sa-border-color, #e2e8f0);
            border-top: none;
            border-radius: 0 0 8px 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,.12);
            max-height: 60vh;
            overflow-y: auto;
        }

            .mobile-search-row .sa-search-dropdown .sa-product-item,
            .mobile-search-row .sa-search-dropdown [class*="product-item"],
            .mobile-search-row .sa-search-dropdown [class*="search-product"] {
                width: 100% !important;
                display: flex !important;
                flex-direction: row !important;
            }
}

/* =========================================================
               HEADER: unify control sizes
               ========================================================= */
header {
    --header-control-height: 44px;
    --header-control-pad-x: 14px;
    position: relative; /* required for z-index to work */
    z-index: 10100;
}

@media (max-width: 767.98px) {
    header {
        --header-control-height: 40px;
    }
}

header .header-actions--main .sa-auth-btn,
header .header-actions--main .sa-cart-btn,
header .header-actions--main .theme-toggle.theme-toggle--icon,
header .header-actions--mobile .sa-auth-btn,
header .header-actions--mobile .sa-cart-btn,
header .mobile-hamburger {
    height: var(--header-control-height) !important;
    min-height: var(--header-control-height) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-block: 0 !important;
    line-height: 1 !important;
    box-sizing: border-box;
}

header .header-actions--main .sa-cart-btn,
header .header-actions--main .theme-toggle.theme-toggle--icon {
    width: var(--header-control-height) !important;
    padding-inline: 0 !important;
}

header .mobile-hamburger {
    width: var(--header-control-height) !important;
}

header .header-actions--main .sa-auth-btn {
    width: auto !important;
    padding-inline: var(--header-control-pad-x) !important;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    header .header-actions--main .sa-auth-btn {
        width: var(--header-control-height) !important;
        padding-inline: 0 !important;
    }
    /* Search dropdown: one item per row (same as mobile) */
    .search-col .sa-search-dropdown {
        position: absolute;
        inset-inline-start: 0;
        inset-inline-end: 0;
        z-index: 10058; /* was 99999 — now below auth/cart (10060) */
    }

        .search-col .sa-search-dropdown .sa-product-item,
        .search-col .sa-search-dropdown [class*="product-item"],
        .search-col .sa-search-dropdown [class*="search-product"] {
            width: 100% !important;
            display: flex !important;
            flex-direction: row !important;
            flex: 0 0 100% !important;
            max-width: 100% !important;
        }

        .search-col .sa-search-dropdown .sa-products-grid,
        .search-col .sa-search-dropdown [class*="products-grid"],
        .search-col .sa-search-dropdown [class*="search-results"] {
            display: flex !important;
            flex-direction: column !important;
            flex-wrap: nowrap !important;
            grid-template-columns: 1fr !important;
        }
}

@media (max-width: 767.98px) {
    header .header-actions--mobile .sa-auth-btn,
    header .header-actions--mobile .sa-cart-btn {
        width: var(--header-control-height) !important;
        padding-inline: 0 !important;
        font-size: 0 !important;
    }
}

/* Icon centering */
header .sa-auth-btn i,
header .sa-auth-btn .bi,
header .sa-cart-btn i,
header .sa-cart-btn .bi,
header .theme-toggle.theme-toggle--icon .bi,
header .mobile-hamburger .bi {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle;
}

header .header-actions--mobile .sa-auth-btn,
header .header-actions--mobile .sa-cart-btn {
    font-size: 0 !important;
}

    header .header-actions--mobile .sa-auth-btn .bi,
    header .header-actions--mobile .sa-auth-btn i,
    header .header-actions--mobile .sa-cart-btn .bi,
    header .header-actions--mobile .sa-cart-btn i {
        font-size: 1.15rem !important;
    }

/* =========================================================
               Auth/Cart panels — overflow + stacking
               ========================================================= */
header,
header .container-fluid,
header .top-menu,
header .top-menu-btn,
header .auth-col,
header .header-actions--main,
header .header-actions--mobile {
    overflow: visible !important;
}

    header .auth-col,
    header .top-menu-btn {
        position: relative;
        z-index: 10050;
    }

    header .sa-auth-wrapper,
    header .sa-cart-wrapper {
        position: relative !important;
        z-index: 10060;
    }

    /* Auth menu: RTL alignment — right edge to right edge of button */
    header .sa-auth-menu {
        position: absolute !important;
        inset-block-start: 100% !important;
        inset-inline-end: 0 !important;
        inset-inline-start: auto !important;
        z-index: 200000 !important;
        margin-block-start: 4px;
    }

    header .sa-cart-panel {
        z-index: 200000 !important;
        margin-block-start: 4px;
    }

        /*
               FIX #4: NO ::after bridge pseudo-element here.
               Desktop/Tablet hover is handled entirely by JS (with delay).
               This means NO pseudo-element can ever block clicks on panel content.
            */

        /* Touch devices: panels hidden by default, JS toggles .is-open */
        header .sa-auth-menu.is-touch-hidden,
        header .sa-cart-panel.is-touch-hidden {
            display: none !important;
        }

    header .sa-auth-menu.is-open {
        display: flex !important;
    }

    header .sa-cart-panel.is-open {
        display: block !important;
    }

/* Search overlay — covers page content below header */
#searchOverlay {
    opacity: 0;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10055; /* above header(10050), below auth/cart wrappers(10060+) */
    transition: opacity .3s ease, visibility .3s ease;
    pointer-events: none;
}

    #searchOverlay.open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


/* ── Fix: center icon in guest auth button (tablet + mobile) ── */
@media (max-width: 991.98px) {
    .header-actions--main > li > a.sa-auth-btn,
    .header-actions--mobile > li > a.sa-auth-btn {
        position: relative;
    }

        .header-actions--main > li > a.sa-auth-btn > .bi,
        .header-actions--main > li > a.sa-auth-btn > i,
        .header-actions--mobile > li > a.sa-auth-btn > .bi,
        .header-actions--mobile > li > a.sa-auth-btn > i {
            position: absolute;
            inset: 0;
            display: flex !important;
            align-items: center;
            justify-content: center;
        }

        .header-actions--main > li > a.sa-auth-btn::after,
        .header-actions--mobile > li > a.sa-auth-btn::after {
            display: none !important;
        }
}

/* =========================================================
       STICKY HEADER v2 — smooth, no feedback-loop, no jank
       ========================================================= */

/* ── Spacer: NEVER transitions ── */
.sa-header-spacer {
    height: 0;
}

/* ── Fixed state ── */
header.sa-header--fixed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 10100;
    /*     will-change: transform;
     */
}

/* ── Shadow when scrolled ── */
header.sa-header--scrolled {
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

/* ── Base header transitions ── */
header {
    transition: padding-bottom .3s ease, box-shadow .3s ease;
}

/* ── Desktop + Tablet padding when fixed ── */
@media (min-width: 768px) {
    header.sa-header--fixed {
        padding-bottom: 0 !important;
    }

        header.sa-header--fixed.sa-header--compact {
            padding-bottom: 10px !important;
        }
}

/* ── Menu-row gap variable ── */
@media (min-width: 768px) {
    header {
        --sa-menu-gap: .5rem;
    }
}

@media (min-width: 992px) {
    header {
        --sa-menu-gap: 1rem;
    }
}

/* ── Menu-row collapse / expand ── */
@media (min-width: 768px) {
    header .menu-row {
        margin-top: 0 !important;
        max-height: 700px;
        transition: max-height .3s ease;
        overflow: visible;
        will-change: max-height;
    }

        header .menu-row.sa-menu-clip {
            overflow: hidden;
        }

        header .menu-row .top-menu-menu {
            padding-top: var(--sa-menu-gap);
            transition: padding-top .3s ease;
        }

    header.sa-header--compact .menu-row {
        max-height: 0 !important;
        pointer-events: none !important;
    }

        header.sa-header--compact .menu-row .top-menu-menu {
            padding-top: 0 !important;
        }
}

/* =========================================================
       Search Clear Button
       ========================================================= */
.sa-search-box {
    position: relative;
}

    /* High specificity to override any existing rules */
    .sa-search-box > .sa-search-clear {
        position: absolute;
        left: 8px;
        top: 50%;
        transform: translateY(-50%);
        border: none;
        background: transparent;
        color: var(--sa-text-muted, #94a3b8);
        cursor: pointer;
        padding: 4px;
        display: none !important;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        width: 28px;
        height: 28px;
        transition: background .15s ease, color .15s ease;
        z-index: 5;
        line-height: 1;
    }

        .sa-search-box > .sa-search-clear:hover {
            background: var(--sa-hover-bg, rgba(0,0,0,.06));
            color: var(--sa-text-color, #334155);
        }

        .sa-search-box > .sa-search-clear .bi {
            font-size: .85rem;
            line-height: 1;
        }

        /* Show — !important overrides the hide above */
        .sa-search-box > .sa-search-clear.is-visible {
            display: inline-flex !important;
        }

.sa-search-input.has-clear-space {
    padding-left: 38px;
}
/* =========================================================
   Theme Toggle Switch (Fixed Animation)
   ========================================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 42px;
}

    .switch #themeToggleInput {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #2196f3;
    transition: background-color 0.4s;
    z-index: 0;
    overflow: hidden;
}

    .slider.round {
        border-radius: var(--sa-btn-radius);
    }

#themeToggleInput:checked + .slider {
    background-color: #000;
}

/* Sun/Moon circle */
.sun-moon {
    position: absolute;
    height: 30px;
    width:30px;
    left: 6px;
    bottom: 4px;
    background-color: yellow;
    border-radius: 50%;
    transition: transform 0.4s, background-color 0.4s;
    will-change: transform;
}

/* Smooth slide only (no spin) */
#themeToggleInput:checked + .slider .sun-moon {
    transform: translateX(26px);
    background-color: #fff;
}

/* Moon dots */
.moon-dot {
    opacity: 0;
    transition: opacity 0.4s;
    fill: gray;
}

#themeToggleInput:checked + .slider .moon-dot {
    opacity: 1;
}

#moon-dot-1 {
    left: 10px;
    top: 3px;
    position: absolute;
    width: 6px;
    height: 6px;
    z-index: 4;
}

#moon-dot-2 {
    left: 2px;
    top: 10px;
    position: absolute;
    width: 10px;
    height: 10px;
    z-index: 4;
}

#moon-dot-3 {
    left: 16px;
    top: 18px;
    position: absolute;
    width: 3px;
    height: 3px;
    z-index: 4;
}

/* Light rays (sun) */
.light-ray {
    position: absolute;
    z-index: -1;
    fill: white;
    opacity: 0;
    transition: opacity 0.4s;
}

/* Only visible in light mode */
#themeToggleInput:not(:checked) + .slider .light-ray {
    opacity: 0.1;
}

/* Explicitly hide in dark mode (fix light stick) */
#themeToggleInput:checked + .slider .light-ray {
    opacity: 0;
}

#light-ray-1 {
    left: -8px;
    top: -8px;
    width: 43px;
    height: 43px;
}

#light-ray-2 {
    left: -50%;
    top: -50%;
    width: 55px;
    height: 55px;
}

#light-ray-3 {
    left: -18px;
    top: -18px;
    width: 60px;
    height: 60px;
}

/* Clouds */
.cloud-dark,
.cloud-light {
    position: absolute;
    animation: cloud-move 6s infinite;
}

.cloud-dark {
    fill: #ccc;
    animation-delay: 1s;
}

.cloud-light {
    fill: #eee;
}

#cloud-1 {
    left: 30px;
    top: 15px;
    width: 40px;
}

#cloud-2 {
    left: 44px;
    top: 10px;
    width: 20px;
}

#cloud-3 {
    left: 18px;
    top: 24px;
    width: 30px;
}

#cloud-4 {
    left: 36px;
    top: 18px;
    width: 40px;
}

#cloud-5 {
    left: 48px;
    top: 14px;
    width: 20px;
}

#cloud-6 {
    left: 22px;
    top: 26px;
    width: 30px;
}

@keyframes cloud-move {
    0%, 100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-10px);
    }
}

/* Stars */
.stars {
    transform: translateY(-32px);
    opacity: 0;
    transition: transform 0.4s, opacity 0.4s;
}

#themeToggleInput:checked + .slider .stars {
    transform: translateY(0);
    opacity: 1;
}

.star {
    fill: white;
    position: absolute;
    transition: opacity 0.4s;
    animation: star-twinkle 2s infinite;
}

#star-1 {
    width: 20px;
    top: 2px;
    left: 3px;
    animation-delay: 0.3s;
}

#star-2 {
    width: 6px;
    top: 16px;
    left: 3px;
}

#star-3 {
    width: 12px;
    top: 20px;
    left: 10px;
    animation-delay: 0.6s;
}

#star-4 {
    width: 18px;
    top: 0px;
    left: 18px;
    animation-delay: 1.3s;
}

@keyframes star-twinkle {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

img, svg {
    height: auto;
    max-width: 100%;
    vertical-align: middle;
}

/* =========================================================
   Mobile Theme Toggle — Exact Desktop Design, Scaled
   ========================================================= */
@media (max-width: 767.98px) {
    .header-actions--mobile .theme-toggle-item {
        margin: 0 !important;
    }

        /* Switch container: scale from 60×34 to ~53×30 to fit 40px height */
        .header-actions--mobile .theme-toggle-item .switch {
            position: relative;
            display: inline-block;
            width: 53px;
            height: 38px;
        }

            .header-actions--mobile .theme-toggle-item .switch #themeToggleInputMobile {
                opacity: 0;
                width: 0;
                height: 0;
            }

        /* Slider background */
        .header-actions--mobile .theme-toggle-item .slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background-color: #2196f3;
            transition: background-color 0.4s;
            z-index: 0;
            overflow: hidden;
            border-radius: var(--sa-btn-radius);
        }

    #themeToggleInputMobile:checked + .slider {
        background-color: #000;
    }

    /* Sun/Moon circle: scale from 26px to 23px */
    .header-actions--mobile .theme-toggle-item .sun-moon {
        position: absolute;
        height: 25px;
        width: 25px;
        left: 3.5px;
        bottom: 6.5px;
        background-color: yellow;
        border-radius: 50%;
        transition: transform 0.4s, background-color 0.4s;
        will-change: transform;
    }

    /* Slide distance: 60-26-4-4=26px desktop → 53-23-3.5-3.5=23px mobile */
    #themeToggleInputMobile:checked + .slider .sun-moon {
        transform: translateX(20px);
        background-color: #fff;
    }

    /* Moon dots */
    .header-actions--mobile .moon-dot {
        opacity: 0;
        transition: opacity 0.4s;
        fill: gray;
    }

    #themeToggleInputMobile:checked + .slider .moon-dot {
        opacity: 1;
    }

    #moon-dot-1-mobile {
        left: 9px;
        top: 2.5px;
        position: absolute;
        width: 5px;
        height: 5px;
        z-index: 4;
    }

    #moon-dot-2-mobile {
        left: 1.5px;
        top: 9px;
        position: absolute;
        width: 9px;
        height: 9px;
        z-index: 4;
    }

    #moon-dot-3-mobile {
        left: 14px;
        top: 16px;
        position: absolute;
        width: 2.5px;
        height: 2.5px;
        z-index: 4;
    }

    /* Light rays (sun) */
    .header-actions--mobile .light-ray {
        position: absolute;
        z-index: -1;
        fill: white;
        opacity: 0;
        transition: opacity 0.4s;
    }

    #themeToggleInputMobile:not(:checked) + .slider .light-ray {
        opacity: 0.1;
    }

    #themeToggleInputMobile:checked + .slider .light-ray {
        opacity: 0;
    }

    #light-ray-1-mobile {
        left: -7px;
        top: -7px;
        width: 38px;
        height: 38px;
    }

    #light-ray-2-mobile {
        left: -50%;
        top: -50%;
        width: 48px;
        height: 48px;
    }

    #light-ray-3-mobile {
        left: -16px;
        top: -16px;
        width: 53px;
        height: 53px;
    }

    /* Clouds */
    .header-actions--mobile .cloud-dark,
    .header-actions--mobile .cloud-light {
        position: absolute;
        animation: cloud-move 6s infinite;
    }

    .header-actions--mobile .cloud-dark {
        fill: #ccc;
        animation-delay: 1s;
    }

    .header-actions--mobile .cloud-light {
        fill: #eee;
    }

    #cloud-1-mobile {
        left: 26px;
        top: 13px;
        width: 35px;
    }

    #cloud-2-mobile {
        left: 39px;
        top: 9px;
        width: 18px;
    }

    #cloud-3-mobile {
        left: 16px;
        top: 21px;
        width: 26px;
    }

    #cloud-4-mobile {
        left: 32px;
        top: 16px;
        width: 35px;
    }

    #cloud-5-mobile {
        left: 42px;
        top: 12px;
        width: 18px;
    }

    #cloud-6-mobile {
        left: 19px;
        top: 23px;
        width: 26px;
    }

    /* Stars */
    .header-actions--mobile .stars {
        transform: translateY(-28px);
        opacity: 0;
        transition: transform 0.4s, opacity 0.4s;
    }

    #themeToggleInputMobile:checked + .slider .stars {
        transform: translateY(0);
        opacity: 1;
    }

    .header-actions--mobile .star {
        fill: white;
        position: absolute;
        transition: opacity 0.4s;
        animation: star-twinkle 2s infinite;
    }

    #star-1-mobile {
        width: 18px;
        top: 1.5px;
        left: 2.5px;
        animation-delay: 0.3s;
    }

    #star-2-mobile {
        width: 5px;
        top: 14px;
        left: 2.5px;
    }

    #star-3-mobile {
        width: 10px;
        top: 18px;
        left: 9px;
        animation-delay: 0.6s;
    }

    #star-4-mobile {
        width: 16px;
        top: 0px;
        left: 16px;
        animation-delay: 1.3s;
    }
}

/* ── Cart panel: prevent viewport overflow on mobile/tablet ── */
@media (max-width: 991.98px) {
    header .sa-cart-panel {
        position: absolute !important;
        inset-inline-start: auto !important;
        inset-inline-end: 0 !important;
        width: min(420px, calc(100vw - 16px)) !important;
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Mobile only: full width */
@media (max-width: 575.98px) {
    header .sa-cart-panel {
        position: fixed !important;
        inset-inline-start: 10px !important;
        inset-inline-end: 10px !important;
        width: auto !important;
    }
}

#saSearchViewAllMobile,
#saSearchViewAllMobile i {
    color: var(--sa-text-third) !important;
}