/* Header-only overrides, loaded after existing responsive and Customizer CSS. */
.starline-single-search-toggle,
.header-account-search-row { display: none; }
.header-main-wrap,
.starline-top-strip { transition: max-height .32s ease, opacity .24s ease, transform .32s ease, padding .32s ease, margin .32s ease; }
.site-header .header-main-wrap { max-height: 220px; }
.starline-top-strip { max-height: 100px; }
body.starline-ghorer-announcement-hidden .starline-top-strip {
    max-height: 0 !important; min-height: 0 !important; overflow: hidden !important;
    opacity: 0 !important; transform: translateY(-100%) !important; pointer-events: none !important;
    padding-top: 0 !important; padding-bottom: 0 !important; margin: 0 !important; border: 0 !important;
}
@media (min-width: 992px) {
    body.starline-ghorer-search-row-hidden .site-header .header-main-wrap {
        max-height: 0 !important; min-height: 0 !important; overflow: hidden !important;
        opacity: 0 !important; transform: translateY(-12px); pointer-events: none !important;
        padding-top: 0 !important; padding-bottom: 0 !important; margin: 0 !important; border: 0 !important;
    }
}
@media (max-width: 991px) {
    .site-header .header-search {
        transition: max-height .32s ease, opacity .24s ease, transform .32s ease, padding .32s ease, margin .32s ease;
        max-height: 120px;
    }
    body.starline-ghorer-search-row-hidden .site-header .header-search {
        max-height: 0 !important; min-height: 0 !important; overflow: hidden !important;
        opacity: 0 !important; transform: translateY(-10px); pointer-events: none !important;
        padding-top: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    .header-main-wrap, .starline-top-strip, .site-header .header-search { transition: none !important; }
}
body.starline-header-logo-off .site-header .site-branding { display: none !important; }
@media (min-width: 992px) {
    body.starline-header-logo-desktop-off .site-header .site-branding,
    body.starline-header-navigation-desktop-off .site-header .desktop-navigation-menu { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991px) {
    body.starline-header-logo-tablet-off .site-header .site-branding { display: none !important; }
}
@media (max-width: 767px) {
    body.starline-header-logo-mobile-off .site-header .site-branding,
    body.starline-mobile-menu-drawer-off .site-header .menu-toggle,
    body.starline-mobile-menu-drawer-off .starline-mobile-nav-overlay,
    body.starline-mobile-menu-drawer-off #site-navigation.primary-navigation { display: none !important; }
}
body.starline-header-layout-controls .site-header .header-account-link {
    font-size: var(--sl-account-font-size, 14px) !important;
    font-weight: var(--sl-account-weight, 600) !important;
}
.starline-single-search-toggle svg { width: 24px; height: 24px; }
@media (max-width: 991px) {
    body .site-header .header-account-search-row,
    body .site-header .starline-single-search-toggle,
    body .site-header .starline-single-search-only { display: none !important; }
    body.starline-header-logo-off:not(.starline-mobile-header-modern) .site-header .header-main { grid-template-columns: minmax(0, 1fr) !important; }
    body.starline-header-logo-off .site-header .header-actions { justify-self: end; }
}
@media (min-width: 992px) {
    body.starline-header-layout-controls .site-header .header-main {
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap;
    }
    body.starline-header-layout-controls .site-header .site-branding { flex: 0 0 auto; }
    body.starline-header-layout-controls .site-header .header-search {
        flex: 1 1 0%; min-width: 0; max-width: var(--sl-search-max);
        margin-inline: auto;
    }
    body.starline-header-layout-controls .site-header .header-actions {
        flex: 0 0 auto; margin-left: auto; position: relative;
    }
    body.starline-header-layout-controls .site-header .header-navigation {
        display: flex !important; align-items: stretch;
    }
    body.starline-header-layout-controls .site-header .header-category-menu {
        flex: 0 0 var(--sl-category-width); width: var(--sl-category-width) !important;
    }
    body.starline-header-layout-controls .site-header .primary-navigation {
        flex: 1 1 0%; min-width: 0; max-width: none;
        justify-self: stretch; margin: 0 !important; padding: 0 !important;
    }
    /* Fill the desktop nav so alignment has available horizontal space.
       Scope to desktop and the top-level list to preserve mobile and submenus. */
    body.starline-header-layout-controls .site-header .primary-navigation > .desktop-navigation-menu {
        flex: 1 1 100%; width: 100% !important; min-width: 0; max-width: none !important;
        align-self: stretch; justify-self: stretch; box-sizing: border-box;
    }
    body.starline-header-layout-controls .site-header .primary-navigation > .desktop-navigation-menu > .primary-menu {
        display: flex !important; flex-wrap: wrap; justify-content: var(--sl-menu-align, flex-start) !important;
        gap: 0 var(--sl-menu-gap) !important; margin: 0 !important;
        padding: 0 !important; width: 100% !important; max-width: none !important;
        box-sizing: border-box;
    }
    body.starline-header-layout-controls .site-header .primary-navigation > .desktop-navigation-menu > .primary-menu > li {
        flex: 0 0 auto; width: auto; margin: 0 !important;
    }
    body.starline-header-layout-controls .site-header .header-account-search-row {
        display: inline-flex; align-items: center; justify-content: center;
        gap: 6px; white-space: nowrap; background: transparent !important;
        color: var(--sl-main-account-color) !important;
        padding: 0 !important; min-height: 40px;
    }
    body.starline-header-layout-controls .site-header .header-account-search-row .header-account-icon {
        color: inherit !important;
    }
    body.starline-header-layout-controls .site-header .header-account-search-row:hover {
        color: var(--sl-main-account-hover) !important;
    }
    body.starline-header-layout-controls .site-header .header-track-order { order: 1; }
    body.starline-header-layout-controls .site-header .header-account-search-row { order: 99; }
    body.starline-header-layout-controls .site-header .header-cart-link { order: 2; }
    body.starline-header-layout-controls .site-header .header-actions .header-action-svg,
    body.starline-header-layout-controls .site-header .header-actions .header-action-svg svg {
        width: var(--sl-action-icon) !important; height: var(--sl-action-icon) !important;
        flex-shrink: 0;
    }
    body.starline-account-position-search .site-header .header-account-desktop,
    body.starline-account-position-single .site-header .header-account-desktop { display: none !important; }
    body.starline-account-position-navigation .site-header .header-account-search-row { display: none !important; }
    /* Single row keeps the original navigation node for the mobile drawer JS. */
    body.starline-header-single-row .site-header .starline-header-rows {
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center; gap: 0; position: relative;
        width: 100%; max-width: var(--sl-header-width); margin-inline: auto;
        padding: 8px 16px 8px var(--sl-single-left-gap, 0px); box-sizing: border-box;
        min-height: var(--sl-single-height, 68px); background: var(--sl-single-bg, #fff);
    }
    body.starline-header-single-row .site-header .header-main-wrap,
    body.starline-header-single-row .site-header .header-main,
    body.starline-header-single-row .site-header .main-navigation-wrap,
    body.starline-header-single-row .site-header .header-navigation { display: contents !important; }
    body.starline-header-single-row .site-header .site-branding { grid-column: 1; grid-row: 1; width:var(--sl-single-logo-width) !important; height:var(--sl-single-logo-height) !important; margin-left: 0 !important; padding-left: 0 !important; margin-right: var(--sl-single-logo-gap, 0px) !important; }
    body.starline-header-single-row .site-header .site-branding .custom-logo-link,
    body.starline-header-single-row .site-header .site-branding img { width:100% !important; height:100% !important; max-width:100% !important; max-height:100% !important; object-fit:contain !important; }
    body.starline-header-single-row .site-header .primary-navigation { grid-column: 2; grid-row: 1; }
    body.starline-header-single-row .site-header .header-actions { grid-column: 3; grid-row: 1; margin-left: 20px; gap: var(--sl-single-action-gap, 18px) !important; }
    body.starline-header-single-row.starline-header-logo-off .site-header .starline-header-rows { grid-template-columns: minmax(0,1fr) auto; }
    body.starline-header-single-row.starline-header-logo-off .site-header .primary-navigation { grid-column: 1; }
    body.starline-header-single-row.starline-header-logo-off .site-header .header-actions { grid-column: 2; }
    body.starline-header-single-row .site-header .header-category-menu,
    body.starline-header-single-row .site-header .header-account-desktop,
    body.starline-header-single-row.starline-header-single-account-off .site-header .header-account-search-row { display: none !important; }
    body.starline-header-single-row.starline-header-single-track-off .site-header .header-track-order,
    body.starline-header-single-row.starline-header-single-cart-off .site-header .header-cart-link,
    body.starline-header-single-row.starline-header-single-track-text-off .site-header .header-track-order > span:not(.header-track-order-icon),
    body.starline-header-single-row.starline-header-single-cart-text-off .site-header .header-cart-text,
    body.starline-header-single-row.starline-header-single-cart-count-off .site-header .header-cart-count { display: none !important; }
    body.starline-header-single-row .site-header .primary-menu > li > a { color: var(--sl-single-menu) !important; font-size:var(--sl-single-menu-size) !important; font-weight:var(--sl-single-menu-weight) !important; }
    body.starline-header-single-row .site-header .primary-menu > li > a:hover { color: var(--sl-single-menu-hover) !important; background:transparent !important; }
    body.starline-header-single-row .site-header .primary-menu > li > a { min-height: 44px; }
    /* Active desktop page: clean underline instead of the old solid box. */
    body.starline-header-single-row .site-header .primary-menu > li.current-menu-item > a,
    body.starline-header-single-row .site-header .primary-menu > li.current-menu-ancestor > a,
    body.starline-header-single-row .site-header .primary-menu > li.current_page_item > a,
    body.starline-header-single-row .site-header .primary-menu > li.current_page_ancestor > a {
        position:relative; color:var(--sl-single-active-text) !important;
        background:transparent !important; box-shadow:none !important;
    }
    body.starline-header-single-row.starline-active-style-box .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a,
    body.starline-header-single-row.starline-active-style-both .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a {
        min-height:var(--sl-single-active-box-height,42px) !important;
        height:var(--sl-single-active-box-height,42px) !important;
        padding-inline:var(--sl-single-active-box-padding,14px) !important;
        border-radius:var(--sl-single-active-box-radius,4px) !important;
        background:var(--sl-single-active-box-bg,#202020) !important;
    }
    body.starline-header-single-row .site-header .primary-menu > li.current-menu-item > a::before,
    body.starline-header-single-row .site-header .primary-menu > li.current-menu-ancestor > a::before,
    body.starline-header-single-row .site-header .primary-menu > li.current_page_item > a::before,
    body.starline-header-single-row .site-header .primary-menu > li.current_page_ancestor > a::before {
        content:""; position:absolute; left:50%; bottom:var(--sl-single-active-line-bottom,2px);
        width:var(--sl-single-active-line-width,70%); height:var(--sl-single-active-line-height,3px);
        border-radius:999px; background:var(--sl-single-active-line,#386fd1);
        transform:translateX(-50%); pointer-events:none;
    }
    body.starline-header-single-row.starline-active-style-box .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a::before,
    body.starline-header-single-row.starline-active-style-text .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a::before,
    body.starline-header-single-row.starline-active-style-none .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a::before { display:none !important; }
    body.starline-header-single-row.starline-active-style-underline .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a,
    body.starline-header-single-row.starline-active-style-text .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a { color:var(--sl-single-menu-hover) !important; }
    body.starline-header-single-row.starline-active-style-none .site-header .primary-menu > li:is(.current-menu-item,.current-menu-ancestor,.current_page_item,.current_page_ancestor) > a { color:var(--sl-single-menu) !important; background:transparent !important; }
    /* Add a chevron only to top-level menu items that actually own a submenu. */
    body.starline-header-single-row .site-header .primary-menu > li.menu-item-has-children > a { gap:7px; }
    body.starline-header-single-row .site-header .primary-menu > li.menu-item-has-children > a::after {
        content:""; display:inline-block; flex:0 0 auto;
        width:var(--sl-single-dropdown-size,7px); height:var(--sl-single-dropdown-size,7px);
        border-right:2px solid var(--sl-single-dropdown-color,#171717);
        border-bottom:2px solid var(--sl-single-dropdown-color,#171717);
        transform:rotate(45deg) translateY(-2px); transform-origin:center;
        transition:transform .18s ease; box-sizing:border-box;
    }
    body.starline-header-single-row .site-header .primary-menu > li.menu-item-has-children:hover > a::after,
    body.starline-header-single-row .site-header .primary-menu > li.menu-item-has-children:focus-within > a::after {
        transform:rotate(225deg) translate(-1px,-1px);
    }
    body.starline-header-single-row.starline-header-single-dropdown-icon-off .site-header .primary-menu > li.menu-item-has-children > a::after { display:none !important; }
    body.starline-header-single-row .site-header .starline-single-search-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 42px; height: 42px; border: 0; border-radius: 4px;
        background: transparent; color: var(--sl-single-search); cursor: pointer;
    }
    body.starline-header-single-row .site-header .starline-single-search-toggle:hover { color: var(--sl-single-search-hover); }
    body.starline-header-single-row .site-header .header-track-order { display:inline-flex !important; color:var(--sl-single-track) !important; }
    body.starline-header-single-row .site-header .header-track-order:hover { color:var(--sl-single-track-hover) !important; }
    body.starline-header-single-row .site-header .header-cart-link { display:inline-flex !important; color:var(--sl-single-cart) !important; }
    body.starline-header-single-row .site-header .header-cart-link:hover { color:var(--sl-single-cart-hover) !important; }
    body.starline-header-single-row .site-header .header-account-search-row { color:var(--sl-single-account) !important; }
    body.starline-header-single-row .site-header .header-account-search-row:hover { color:var(--sl-single-account-hover) !important; }
    body.starline-header-single-row .site-header .header-actions .header-action-svg,
    body.starline-header-single-row .site-header .header-actions .header-action-svg svg,
    body.starline-header-single-row .site-header .starline-single-search-toggle svg { width:var(--sl-single-icon) !important; height:var(--sl-single-icon) !important; }
    body.starline-header-single-row .site-header .header-search {
        display: none !important; position: absolute; top: 100%; right: 16px;
        width: min(480px, calc(100% - 32px)); max-width: none;
        padding: 12px; background: #fff; box-shadow: 0 5px 20px #0002;
        z-index: 2000; box-sizing: border-box;
    }
    body.starline-header-single-row .site-header .header-search.is-open { display: block !important; }
    body.starline-header-single-row .site-header .header-search.starline-search-disabled { display: none !important; }
    .starline-single-search-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
}
@media (min-width: 992px) and (max-width: 1199px) {
    body.starline-header-layout-controls .site-header .header-category-menu {
        flex-basis: var(--sl-category-laptop); width: var(--sl-category-laptop) !important;
    }
}
