/* Shopix-inspired storefront header */
:root {
    --promo-banner-height: 2.5rem;
    --offers-sheet-top: var(--promo-banner-height);
    --storefront-container-max: 1600px;
    --storefront-container-padding-x: 1rem;
}

@media (min-width: 768px) {
    :root {
        --storefront-container-padding-x: 1.5rem;
    }
}

html:not(.promo-dismissed) #site-header {
    top: var(--promo-banner-height);
}

html.promo-dismissed #site-header {
    top: 0;
}

html.promo-dismissed {
    --offers-sheet-top: 0px;
}

.promo-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    height: var(--promo-banner-height);
    background: #0a0a0a;
    color: #fff;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}

.promo-banner__inner {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding-right: 2.5rem;
}

.promo-banner__viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.promo-banner__track {
    --promo-marquee-shift: 50%;
    --promo-marquee-duration: 28s;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 1.75rem;
    width: max-content;
    animation: promo-banner-scroll var(--promo-marquee-duration) linear infinite;
    will-change: transform;
}

.promo-banner__track:hover {
    animation-play-state: paused;
}

.promo-banner__message {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.promo-banner__star {
    flex-shrink: 0;
    font-size: 0.625rem;
    line-height: 1;
    opacity: 0.95;
}

.promo-banner__star--1 {
    color: #a855f7;
}

.promo-banner__star--2 {
    color: #84cc16;
}

.promo-banner__star--3 {
    color: #fb7185;
}

.promo-banner__star--4 {
    color: #facc15;
}

.promo-banner__dismiss {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: rgb(255 255 255 / 0.75);
    transform: translateY(-50%);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.promo-banner__dismiss:hover {
    background: rgb(255 255 255 / 0.1);
    color: #fff;
}

@keyframes promo-banner-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(calc(-1 * var(--promo-marquee-shift)), 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .promo-banner__track {
        --promo-marquee-duration: 90s;
    }
}

#site-header {
    background: #fff;
    box-shadow: 0 1px 0 rgb(15 23 42 / 0.06);
}

.sf-topbar {
    display: none;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
    font-size: 0.8125rem;
    color: #475569;
}

@media (min-width: 1024px) {
    .sf-topbar {
        display: block;
    }
}

.sf-topbar__inner {
    max-width: var(--storefront-container-max);
    margin: 0 auto;
    padding: 0.5rem var(--storefront-container-padding-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sf-topbar__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
}

.sf-topbar__links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.sf-topbar__links a:hover {
    color: #0f172a;
}

.sf-topbar__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sf-topbar__locale {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #64748b;
}

.sf-topbar__social {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.sf-topbar__social a {
    color: #64748b;
    transition: color 0.15s ease;
}

.sf-topbar__social a:hover {
    color: #0f172a;
}

.sf-header__inner {
    max-width: var(--storefront-container-max);
    margin: 0 auto;
    padding: 0.75rem var(--storefront-container-padding-x);
}

@media (min-width: 1024px) {
    .sf-header__inner {
        padding-top: 0.875rem;
        padding-bottom: 0.875rem;
    }
}

.sf-header__desktop {
    display: none;
    align-items: center;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .sf-header__desktop {
        display: flex;
    }
}

.sf-logo {
    --sf-logo-slot: 3.25rem;
    --sf-logo-visual: 4.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    flex-shrink: 0;
    height: var(--sf-logo-slot);
    overflow: visible;
    text-decoration: none;
    color: #0f172a;
}

.sf-logo__img {
    display: block;
    height: var(--sf-logo-visual);
    width: auto;
    max-width: none;
    object-fit: contain;
    margin-block: calc((var(--sf-logo-slot) - var(--sf-logo-visual)) / 2);
}

.sf-header__desktop .sf-logo {
    --sf-logo-slot: 4rem;
    --sf-logo-visual: 5.75rem;
}

@media (min-width: 1280px) {
    .sf-header__desktop .sf-logo {
        --sf-logo-slot: 4.5rem;
        --sf-logo-visual: 6.25rem;
    }
}

.sf-primary-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.sf-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    border-radius: 9999px;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sf-nav-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.sf-nav-item.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

.sf-nav-item__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1;
}

.sf-nav-item__icon i {
    font-size: 0.875rem;
}

.sf-nav-item:hover .sf-nav-item__icon,
.sf-nav-item.is-active .sf-nav-item__icon {
    color: #475569;
}

.sf-nav-chevron {
    font-size: 0.625rem !important;
    color: #94a3b8 !important;
}

.sf-header__search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 28rem;
    margin-left: auto;
}

.sf-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #fff;
    padding: 0.375rem 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sf-search-form:focus-within {
    border-color: #cbd5e1;
    box-shadow: 0 0 0 3px rgb(15 23 42 / 0.06);
}

.sf-search-form i {
    color: #94a3b8;
    font-size: 0.875rem;
}

.sf-search-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    outline: none;
    color: #0f172a;
}

.sf-search-form input::placeholder {
    color: #94a3b8;
}

.sf-header__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sf-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
}

.sf-cart-btn__icon {
    display: block;
    font-size: 1.125rem;
    line-height: 1;
    color: #334155;
}

.sf-cart-btn__badge,
.sf-cart-btn [data-cart-count] {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    display: inline-flex;
    min-width: 1.125rem;
    height: 1.125rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #ef4444;
    padding: 0 0.3rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    pointer-events: none;
}

.sf-icon-btn {
    position: relative;
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #334155;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.sf-icon-btn:hover {
    background: #f8fafc;
}

.sf-icon-badge {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    display: inline-flex;
    min-width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #ef4444;
    padding: 0 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.sf-avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.sf-avatar-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.sf-avatar-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgb(175 62 62 / 0.45);
}

.sf-profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sf-profile-trigger__avatar {
    pointer-events: none;
}

.sf-profile-trigger__chevron {
    font-size: 0.625rem;
    color: #64748b;
    transition: transform 0.15s ease, color 0.15s ease;
}

.profile-menu-toggle[aria-expanded="true"] .sf-profile-trigger__avatar {
    border-color: rgb(175 62 62 / 0.4);
    box-shadow: 0 0 0 2px rgb(175 62 62 / 0.12);
}

.profile-menu-toggle[aria-expanded="true"] .sf-profile-trigger__chevron {
    color: #af3e3e;
    transform: rotate(180deg);
}

.sf-avatar-btn img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* Shadcn-style account dropdown */
.profile-menu-dropdown {
    position: absolute;
    left: 50%;
    right: auto;
    top: calc(100% + 0.5rem);
    z-index: 50;
    min-width: 14rem;
    padding: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    box-shadow:
        0 4px 6px -1px rgb(15 23 42 / 0.08),
        0 10px 15px -3px rgb(15 23 42 / 0.08);
    transform-origin: top center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.96) translateY(-4px);
    transition:
        visibility 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-menu-dropdown.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1) translateY(0);
}

.profile-menu-dropdown__label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.5rem 0.5rem 0.375rem;
}

.profile-menu-dropdown__label-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1rem;
}

.profile-menu-dropdown__label-text {
    min-width: 0;
    flex: 1;
}

.profile-menu-dropdown__name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: #0f172a;
}

.profile-menu-dropdown__email {
    margin: 0.125rem 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1.25;
    color: #64748b;
}

.profile-menu-dropdown__separator {
    margin: 0.25rem -0.25rem;
    height: 1px;
    background: #e2e8f0;
}

.profile-menu-dropdown__group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.profile-menu-dropdown__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: #334155;
    text-decoration: none;
    text-align: left;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.profile-menu-dropdown__item:hover,
.profile-menu-dropdown__item:focus-visible {
    outline: none;
    background: #f1f5f9;
    color: #0f172a;
}

.profile-menu-dropdown__item--destructive {
    color: #dc2626;
}

.profile-menu-dropdown__item--destructive:hover,
.profile-menu-dropdown__item--destructive:focus-visible {
    background: #fef2f2;
    color: #b91c1c;
}

.profile-menu-dropdown__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    font-size: 0.875rem;
    color: #64748b;
}

.profile-menu-dropdown__item--destructive .profile-menu-dropdown__icon {
    color: #ef4444;
}

.sf-header {
    position: relative;
    overflow: visible;
}

.sf-mega-wrap {
    position: relative;
}

.sf-mega {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 60;
    width: 48rem;
    max-width: calc(100vw - 2rem);
    min-width: 34rem;
    padding: 0.35rem 0 0.5rem;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sf-mega.sf-mega--visible {
    opacity: 1;
    transform: translateY(0);
}

.sf-mega.sf-mega--visible .sf-mega__inner {
    pointer-events: auto;
    padding-top: 0.25rem;
    margin-top: -0.25rem;
}

.sf-mega.hidden {
    display: none;
}

.sf-mega.hidden.sf-mega--visible {
    display: block;
}

.sf-mega__inner {
    margin: 0;
}

.sf-mega__panel--flyout {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #fff;
    box-shadow: 0 12px 32px rgb(15 23 42 / 0.12);
    overflow: hidden;
}

.sf-mega__parents {
    display: flex;
    flex-direction: column;
    flex: 0 0 18rem;
    width: 18rem;
    padding: 0.65rem 0;
    border-right: 1px solid #e2e8f0;
    background: #fff;
}

.sf-mega__parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    margin: 0 0.35rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sf-mega__parent span {
    min-width: 0;
}

.sf-mega__parent-chevron {
    flex-shrink: 0;
    font-size: 0.6875rem;
    color: #94a3b8;
}

.sf-mega__parent:hover,
.sf-mega__parent.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

.sf-mega__parent.is-active .sf-mega__parent-chevron {
    color: #64748b;
}

.sf-mega__children {
    position: relative;
    flex: 1 1 auto;
    min-width: 22rem;
    max-height: min(75vh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.65rem 0;
    background: #fff;
}

.sf-mega__children-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.125rem;
    padding: 0 1.15rem 0.65rem;
}

.sf-mega__children-panel.is-active {
    display: flex;
}

.sf-mega__child-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.75rem;
    row-gap: 0.125rem;
    align-items: start;
}

.sf-mega__children-panel--cols.is-active {
    flex-direction: column;
}

.sf-mega__child-link {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.45;
    color: #334155;
    text-decoration: none;
    transition: color 0.12s ease;
}

.sf-mega__child-link:hover {
    color: #0f172a;
}

.sf-mega__child-link--all {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.875rem;
    font-weight: 600;
    color: #af3e3e;
}

.sf-mega__child-link--all:hover {
    color: #9c3434;
}

.sf-mega-wrap.is-open .sf-nav-item--mega {
    background: #fef2f2;
    color: #0f172a;
}

.sf-mega-wrap.is-open .sf-nav-item--mega .sf-nav-chevron {
    color: #af3e3e;
}

.sf-mega-wrap.is-open .sf-nav-item--mega .sf-nav-item__icon {
    color: #475569;
}

@media (prefers-reduced-motion: reduce) {
    .sf-mega {
        transition: none;
    }

}

/* Mobile header row */
.sf-header__mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .sf-header__mobile {
        display: none;
    }
}

.sf-header__mobile .sf-logo {
    --sf-logo-slot: 3.5rem;
    --sf-logo-visual: 4.75rem;
}

.sf-mobile-search {
    padding: 0.5rem 0 0.75rem;
}

@media (min-width: 1024px) {
    .sf-mobile-search {
        display: none;
    }
}

.sf-mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sf-mobile-nav-link:hover {
    background: #f8fafc;
    color: #0f172a;
}

.sf-mobile-nav-link__icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    color: #64748b;
    font-size: 0.875rem;
}

.sf-mobile-nav-link:hover .sf-mobile-nav-link__icon {
    color: #475569;
}
