/* Header after the Studio Modular pattern: logo, a translucent menu pill in the center, and actions on the right.
   Once the page scrolls, the logo and side buttons fade away and only the pill (and the bag) stay pinned. */
html { scroll-padding-top: 110px; }
.site-header { position: sticky; top: 0; z-index: 30; background: transparent; border: 0; pointer-events: none; }
.header-bar { display: flex; align-items: center; gap: 20px; padding: 22px 4vw; }
.header-bar > *, .header-actions > * { pointer-events: auto; }
.header-fade { transition: opacity .3s ease, transform .3s ease, visibility .3s; }
.site-header.is-scrolled .header-fade { opacity: 0; visibility: hidden; transform: translateY(-14px); pointer-events: none; }

.product-navigation { position: relative; margin-inline: auto; }
.category-nav { position: relative; display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; background: #ffffffcc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 #1414190a, 0 10px 30px -18px #14141933; transition: box-shadow .3s ease; }
.site-header.is-scrolled .category-nav { box-shadow: 0 1px 0 #1414190f, 0 16px 34px -16px #14141940; }
.nav-disclosure { display: flex; }
.category-link, .nav-trigger { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 12px 18px; background: transparent; color: var(--ink); font-size: 13px; line-height: 1.4; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.category-link:hover, .nav-trigger:hover { background: var(--raise); color: var(--ink); }
.category-link.active, .nav-trigger.active, .nav-trigger[aria-expanded="true"] { background: var(--ink); color: var(--white); }
.category-link.active .icon, .nav-trigger.active .icon, .nav-trigger[aria-expanded="true"] .icon { color: inherit; }
.nav-trigger > .icon { width: 13px; height: 13px; transition: transform .15s; color: var(--muted); }
.nav-trigger[aria-expanded="true"] > .icon { transform: rotate(180deg); }
.category-link > .icon { width: 14px; height: 14px; color: var(--mag); }

.mega-menu { position: absolute; top: calc(100% + 12px); left: 50%; width: min(1080px, 92vw); transform: translateX(-50%); border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 30px 60px -30px #14141940; z-index: 20; }
.mega-inner { display: grid; grid-template-columns: .9fr 1fr 1fr 1.7fr; gap: 32px; padding: 32px 36px 34px; }
.mega-group + .mega-group { margin-top: 26px; }
.mega-group h2 { font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: 0; margin: 0 0 10px; }
.mega-group ul { list-style: none; margin: 0; padding: 0; }
.mega-group li + li { margin-top: 8px; }
.mega-group a { display: inline-block; color: var(--muted); font-size: 13px; line-height: 1.55; text-underline-offset: 4px; }
.mega-group a:hover { color: var(--mag); text-decoration: underline; }
.mega-feature-image { display: block; border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.mega-feature-image .product-art { aspect-ratio: 2.25; border-radius: 14px; }
.mega-feature .eyebrow { color: var(--cobalt); font-size: 8px; letter-spacing: 1.5px; margin: 0 0 9px; }
.mega-feature h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.6px; margin: 0 0 10px; }
.mega-feature p { font-size: 12px; line-height: 1.7; max-width: 370px; margin-bottom: 17px; }
.mega-feature .text-link { font-size: 12px; color: var(--mag); }
.mega-feature .text-link > .icon { width: 16px; height: 16px; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .icon-button, .account-link, .bag-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 46px; min-width: 46px; padding: 0 12px; border-radius: 999px; background: #ffffffcc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink); font-size: 12px; }
.header-actions .icon-button:hover, .account-link:hover, .bag-link:hover { background: var(--white); }
.bag-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 10px; font-weight: 600; }
.studio-link { font-size: 12px; font-weight: 600; color: var(--mag); padding: 0 6px; }
.header-search { position: relative; }
.header-search summary { list-style: none; cursor: pointer; }
.header-search summary::-webkit-details-marker { display: none; }
.header-actions .header-search[open] summary { background: var(--ink); color: var(--white); }
.header-search-form { position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, 86vw); padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); box-shadow: 0 24px 48px -24px #14141940; }
.header-search-form input[type="search"] { margin: 0; padding: 12px 48px 12px 18px; border: 0; border-radius: 999px; background: var(--raise); font-size: 13px; }
.header-search-form button { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.header-cta { display: inline-flex; align-items: center; gap: 0; height: 46px; padding-left: 22px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 13px; font-weight: 600; white-space: nowrap; }
.header-cta-arrow { display: grid; place-items: center; width: 46px; height: 46px; margin-left: 16px; border-radius: 50%; background: var(--soft-blue); color: var(--ink); transition: transform .2s ease; }
.header-cta:hover .header-cta-arrow { transform: translateX(3px); }
.site-header .menu-toggle { display: none; }

@media (max-width: 1659px) {
    .nav-how { display: none; }
}
@media (max-width: 1499px) {
    .category-link, .nav-trigger { padding: 11px 14px; font-size: 12px; }
    .header-cta-arrow { display: none; }
    .header-cta { padding: 0 20px; }
}
@media (max-width: 1399px) {
    .header-bar { padding: 18px 3vw; }
    .header-cta { display: none; }
    .site-header .brand-mark { width: 40px; height: 31px; }
    .site-header .brand-name strong { font-size: 20px; }
}

@media (max-width: 1180px) {
    .header-bar { justify-content: space-between; padding: 16px 20px; }
    .site-header .menu-toggle { display: inline-flex; }
    .header-cta { display: none; }
    .product-navigation { display: none; position: absolute; top: calc(100% - 4px); left: 16px; right: 16px; max-height: min(78vh, 760px); overflow-y: auto; overscroll-behavior: contain; padding: 10px 18px 14px; border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: 0 30px 60px -30px #14141959; }
    .product-navigation.is-open { display: block; }
    .category-nav { display: block; padding: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
    .site-header.is-scrolled .category-nav { box-shadow: none; }
    .nav-disclosure { display: block; border-bottom: 1px solid var(--line); }
    .category-link, .nav-trigger { justify-content: space-between; width: 100%; padding: 16px 4px; border-radius: 0; font-size: 14px; text-align: left; }
    .category-link:hover, .nav-trigger:hover { background: none; color: var(--mag); }
    .category-link.active, .nav-trigger.active, .nav-trigger[aria-expanded="true"] { background: none; color: var(--mag); }
    .nav-trigger > .icon { width: 16px; height: 16px; }
    .nav-how { display: flex; }
    .mega-menu { position: static; width: auto; transform: none; border: 0; border-radius: 16px; box-shadow: none; background: var(--raise); margin-bottom: 14px; }
    .mega-inner { padding: 22px; grid-template-columns: 1fr 1fr; gap: 25px 22px; }
    .mega-feature { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 22px; }
    .mega-feature-image { display: none; }
    .mega-feature p { max-width: none; }
    .mega-group a { padding: 4px 0; }
    .mega-group li + li { margin-top: 4px; }
    .mega-group + .mega-group { margin-top: 22px; }
    /* On small screens the logo leaves on scroll, while bag and menu stay pinned as pills. */
    .site-header.is-scrolled .header-actions .header-fade { display: none; }
}

@media (max-width: 450px) {
    .header-bar { padding: 14px 16px; gap: 8px; }
    .header-actions { gap: 4px; }
    .header-actions .icon-button, .account-link, .bag-link { height: 38px; min-width: 38px; padding: 0 8px; }
    .site-header .brand-mark { width: 32px; height: 25px; }
    .site-header .brand-name strong { font-size: 18px; }
    .site-header .brand-name small { font-size: 6px; letter-spacing: .2px; }
    .mega-inner { padding: 20px 17px; gap: 25px 15px; }
    .mega-group h2, .mega-group a { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-trigger > .icon, .header-fade, .header-cta-arrow { transition: none; }
}
