:root {
    --whispart-header-height: 82px;
    --whispart-header-ink: #111;
    --whispart-header-bg: #FFFFFF;
    --whispart-header-shadow: 0 8px 24px rgba(0, 0, 0, 0.045);
    --whispart-header-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --whispart-header-serif: "Cormorant Garamond", Georgia, serif;
    --whispart-header-icon-size: 20px;
    --whispart-header-icon-stroke: 1.15;
}

#shopline-section-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

#shopline-section-header.menu-open {
    z-index: 1000;
}

.header {
    position: relative;
    color: var(--whispart-header-ink);
    background: transparent;
}

.header a:not(.button),
.header a:not(.button):hover {
    color: inherit;
    text-decoration: none;
}

.header summary {
    list-style: none;
}

.header summary::-webkit-details-marker {
    display: none;
}

.header__full_width {
    max-width: 100%;
}

.whispart-topbar {
    min-height: var(--whispart-header-height);
}

.whispart-topbar.has-bottom-line {
    border-bottom: 1px solid rgba(17, 17, 17, 0.06);
}

.whispart-topbar .header__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    height: var(--whispart-header-height);
    min-height: var(--whispart-header-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 30px;
    padding-left: clamp(64px, 4.5vw, 86px);
    padding-right: clamp(64px, 4.5vw, 86px);
    color: var(--whispart-header-ink);
    font-family: var(--whispart-header-sans);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}

.whispart-topbar .header__container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--whispart-header-bg);
    box-shadow: var(--whispart-header-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header__brand {
    grid-column: 1;
    justify-self: start;
    font-family: var(--whispart-header-serif);
    font-size: 24px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.header__nav {
    grid-column: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 24px;
    color: #111;
}

.header__nav-link {
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: normal;
    text-transform: capitalize;
    transition: color 0.12s ease, opacity 0.12s ease;
}

.header a.header__nav-link:not(.button):hover,
.header a.header__nav-link:not(.button):focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.menu-item--highlight {
    color: var(--header-highlight-text-color, #111);
}

.header__icons {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 26px;
    color: #111;
}

.header__icon-link,
.header__icon-button,
.search-modal__submit-button,
.search-modal__close-button {
    position: relative;
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    min-width: var(--whispart-header-icon-size);
    min-height: var(--whispart-header-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}

.header__icon,
.header__icon-link .icon,
.header__icon-link svg,
.header__icon-button .icon,
.header__icon-button svg {
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    max-width: var(--whispart-header-icon-size);
    max-height: var(--whispart-header-icon-size);
    display: block;
    fill: none;
    color: currentColor;
    stroke: currentColor;
    stroke-width: var(--whispart-header-icon-stroke);
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
}

.header__icon path,
.header__icon circle,
.header__icon ellipse,
.header__icon line,
.header__icon polyline,
.header__icon polygon,
.header__icon-link path,
.header__icon-link circle,
.header__icon-link ellipse,
.header__icon-link line,
.header__icon-link polyline,
.header__icon-link polygon,
.header__icon-button path,
.header__icon-button circle,
.header__icon-button ellipse,
.header__icon-button line,
.header__icon-button polyline,
.header__icon-button polygon {
    stroke: currentColor;
    stroke-width: var(--whispart-header-icon-stroke);
    stroke-linecap: round;
    stroke-linejoin: round;
}

#cart-icon-bubble {
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    min-width: var(--whispart-header-icon-size);
    min-height: var(--whispart-header-icon-size);
}

#cart-icon-bubble-wrapper {
    position: relative;
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#cart-icon-bubble-wrapper .icon,
#cart-icon-bubble-wrapper svg {
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    display: block;
}

.header__cart-point {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 13px;
    height: 13px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 500;
    line-height: 1;
}

/* Search modal */
.header__search,
.header__search>details,
.header__search>details>summary {
    width: var(--whispart-header-icon-size);
    height: var(--whispart-header-icon-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header__search>details>.modal__content {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    align-items: start;
    background: transparent;
}

.header__search .modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
}

.search-modal__content {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 32px));
    margin: 72px auto 0;
    padding: 18px;
    background: #fff;
    color: #111;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
}

.search-modal__form {
    position: relative;
    padding-right: 44px;
}

.search-modal__field {
    position: relative;
}

.search-modal__input {
    width: 100%;
    min-height: 48px;
    padding: 0 54px 0 16px;
    border: 1px solid rgba(17, 17, 17, 0.16);
    border-radius: 0;
    background: #fff;
    color: #111;
    font-family: var(--whispart-header-sans);
}

.search-modal__field-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(17, 17, 17, 0.44);
    pointer-events: none;
}

.search-modal__input:focus+.search-modal__field-label,
.search-modal__input:not(:placeholder-shown)+.search-modal__field-label {
    opacity: 0;
}

.search-modal__submit-button,
.search-modal__close-button {
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.search-modal__submit-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 48px;
}

.search-modal__close-button {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 28px;
    height: 28px;
}

.predictive-search {
    width: 100%;
    background: #fff;
}

.predictive-search__results:empty,
.predictive-search__loading-state:empty {
    display: none;
}

.header__localization form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header__localization .dropdown-menu__button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

@media screen and (max-width: 959px) {
    :root {
        --whispart-header-height: 76px;
        --whispart-header-icon-size: 22px;
    }

    .whispart-topbar {
        min-height: var(--whispart-header-height);
    }

    .whispart-topbar .header__container {
        height: var(--whispart-header-height);
        min-height: var(--whispart-header-height);
        display: flex;
        justify-content: space-between;
        padding-left: 20px;
        padding-right: 20px;
    }

    .header__brand {
        justify-self: start;
        font-size: 22px;
        transform: translateX(15px);
    }

    .header__icons {
        justify-self: end;
        gap: 20px;
    }

    .header__icons .header__icon-link,
    .header__icons .header__icon-button,
    .header__icons .header__search,
    .header__icons .header__search>details,
    .header__icons .header__search>details>summary,
    .header__icons #cart-icon-bubble,
    .header__icons #cart-icon-bubble-wrapper,
    .header__icons .header__icon,
    .header__icons .icon,
    .header__icons svg {
        width: var(--whispart-header-icon-size) !important;
        height: var(--whispart-header-icon-size) !important;
        min-width: var(--whispart-header-icon-size) !important;
        min-height: var(--whispart-header-icon-size) !important;
        max-width: var(--whispart-header-icon-size) !important;
        max-height: var(--whispart-header-icon-size) !important;
    }

    .header__icons .header__icon,
    .header__icons svg {
        stroke-width: var(--whispart-header-icon-stroke) !important;
    }

    .header__nav {
        display: none;
    }

    .search-modal__content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: calc(env(safe-area-inset-top, 0px) + 8px) 12px 8px;
    }

    .search-modal__form {
        padding-right: 44px;
    }

    .search-modal__close-button {
        top: calc(env(safe-area-inset-top, 0px) + 16px);
        right: 12px;
    }
}

@media screen and (max-width: 430px) {
    .whispart-topbar .header__container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .header__icons {
        gap: 20px;
    }
}

body[data-template="product"],
body.pdp-optimized {
    padding-top: 0 !important;
}

body[data-template="product"] #shopline-section-header,
body[data-template="product"] #shopline-section-header .header,
body[data-template="product"] #shopline-section-header .whispart-topbar,
body.pdp-optimized #shopline-section-header,
body.pdp-optimized #shopline-section-header .header,
body.pdp-optimized #shopline-section-header .whispart-topbar {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body[data-template="product"] #shopline-section-header .whispart-topbar .header__container::before,
body.pdp-optimized #shopline-section-header .whispart-topbar .header__container::before {
    background: rgba(255, 255, 255, var(--ws-header-scroll-opacity, 0)) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, calc(var(--ws-header-scroll-opacity, 0) * 0.045)) !important;
}

body[data-template="product"] #shopline-section-header .header__brand,
body[data-template="product"] #shopline-section-header .header__nav,
body[data-template="product"] #shopline-section-header .header__nav-link,
body[data-template="product"] #shopline-section-header .header__icons,
body[data-template="product"] #shopline-section-header .header__icon-link,
body[data-template="product"] #shopline-section-header .header__icon-button,
body[data-template="product"] #shopline-section-header .header__icon-button *,
body[data-template="product"] #shopline-section-header summary,
body[data-template="product"] #shopline-section-header summary *,
body[data-template="product"] #shopline-section-header button,
body[data-template="product"] #shopline-section-header button *,
body.pdp-optimized #shopline-section-header .header__brand,
body.pdp-optimized #shopline-section-header .header__nav,
body.pdp-optimized #shopline-section-header .header__nav-link,
body.pdp-optimized #shopline-section-header .header__icons,
body.pdp-optimized #shopline-section-header .header__icon-link,
body.pdp-optimized #shopline-section-header .header__icon-button,
body.pdp-optimized #shopline-section-header .header__icon-button *,
body.pdp-optimized #shopline-section-header summary,
body.pdp-optimized #shopline-section-header summary *,
body.pdp-optimized #shopline-section-header button,
body.pdp-optimized #shopline-section-header button * {
    color: color-mix(in srgb, #fff calc((1 - var(--ws-header-scroll-opacity, 0)) * 100%), #111 calc(var(--ws-header-scroll-opacity, 0) * 100%)) !important;
}

body[data-template="product"] #shopline-section-header .header a.header__nav-link:not(.button):hover,
body[data-template="product"] #shopline-section-header .header a.header__nav-link:not(.button):focus-visible,
body.pdp-optimized #shopline-section-header .header a.header__nav-link:not(.button):hover,
body.pdp-optimized #shopline-section-header .header a.header__nav-link:not(.button):focus-visible {
    /* 颜色由 theme.html 的 color: inherit 统一接管 */
}

/* PDP 购物车数字徽章同步过渡 */
body[data-template="product"] .header__cart-point,
body.pdp-optimized .header__cart-point {
    background: color-mix(in srgb, #fff calc((1 - var(--ws-header-scroll-opacity, 0)) * 100%), #111 calc(var(--ws-header-scroll-opacity, 0) * 100%)) !important;
    color: color-mix(in srgb, #111 calc((1 - var(--ws-header-scroll-opacity, 0)) * 100%), #fff calc(var(--ws-header-scroll-opacity, 0) * 100%)) !important;
}

body[data-template="product"] #shopline-section-header .search-modal__content,
body[data-template="product"] #shopline-section-header .search-modal__content *,
body.pdp-optimized #shopline-section-header .search-modal__content,
body.pdp-optimized #shopline-section-header .search-modal__content * {
    color: #111 !important;
}

@media screen and (max-width: 959px) {

    #shopline-section-header .header__icons .header__icon-link,
    #shopline-section-header .header__icons .header__icon-button,
    #shopline-section-header .header__icons .header__search,
    #shopline-section-header .header__icons .header__search>details,
    #shopline-section-header .header__icons .header__search>details>summary,
    #shopline-section-header .header__icons #cart-icon-bubble,
    #shopline-section-header .header__icons #cart-icon-bubble-wrapper,
    #shopline-section-header .header__icons .header__icon,
    #shopline-section-header .header__icons .icon,
    #shopline-section-header .header__icons svg {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        max-width: 22px !important;
        max-height: 22px !important;
    }

    #shopline-section-header .header__icons .header__icon,
    #shopline-section-header .header__icons svg {
        stroke-width: 1.15 !important;
    }

    #shopline-section-header .header__brand,
    #shopline-section-header .header__heading,
    #shopline-section-header .header__heading-link,
    #shopline-section-header .header__heading-logo,
    #shopline-section-header .header__heading-logo--transparent {
        translate: 15px 0 !important;
    }

    #shopline-section-header .whispart-topbar,
    #shopline-section-header .header,
    #shopline-section-header .header__container {
        height: 76px !important;
        min-height: 76px !important;
        max-height: 76px !important;
    }
}