/* ==========================================================================
   Site Header Pro v1.0.0
   ALL rules scoped to #shp-header for maximum specificity.
   Explicit resets on every element to prevent WP/Elementor theme bleed.
   ========================================================================== */

:root {
    --shp-bg: rgba(255, 255, 255, 0.75);
    --shp-text: #111827;
    --shp-accent: #030213;
    --shp-blur: 20px;
    --shp-max-width: 1140px;
}

/* ---------- Full reset for all header descendants ---------- */
/* Excludes .shp-minicart-wrap and its children so the
   Custom Mini Cart plugin's own styles are never touched. */

#shp-header,
#shp-header *:not(.shp-minicart-wrap):not(.shp-minicart-wrap *),
#shp-header *:not(.shp-minicart-wrap):not(.shp-minicart-wrap *)::before,
#shp-header *:not(.shp-minicart-wrap):not(.shp-minicart-wrap *)::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    font: inherit;
    vertical-align: baseline;
    text-decoration: none;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-transform: none;
    letter-spacing: 0;
    float: none;
    clear: none;
    min-height: 0;
    min-width: 0;
    box-shadow: none;
    outline: none;
    list-style: none;
    background: transparent;
}

#shp-header img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Header shell ---------- */

#shp-header {
    position: relative;
    z-index: 9999;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--shp-bg) !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    border-radius: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--shp-text);
    float: none !important;
    clear: both !important;
    overflow: visible !important;
}

#shp-header.shp-sticky {
    position: sticky;
    top: 0;
}

/* Glassmorphism: use near-opaque background instead of backdrop-filter.
   backdrop-filter creates a new containing block per CSS spec, which
   traps any position:fixed children (like the mini-cart slide-out).
   rgba(255,255,255,0.97) is visually identical but avoids the issue. */
#shp-header.shp-glass {
    background-color: rgba(255, 255, 255, 0.97) !important;
}

#shp-header.shp-scrolled {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06),
                0 1px 2px -1px rgba(0, 0, 0, 0.06) !important;
}

.admin-bar #shp-header.shp-sticky {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar #shp-header.shp-sticky {
        top: 46px;
    }
}

/* ---------- Inner container ---------- */

#shp-header .shp-inner {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    height: 120px;
    padding: 0 20px !important;
    overflow: visible !important;
    transition: height 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
    #shp-header .shp-inner {
        height: 100px;
        padding: 0 12px !important;
    }

    #shp-header .shp-zone--right {
        gap: 4px;
    }

    #shp-header .shp-brand__name {
        font-size: 22px !important;
    }
}

#shp-header.shp-scrolled .shp-inner {
    height: 100px;
}

@media (max-width: 767px) {
    #shp-header.shp-scrolled .shp-inner {
        height: 80px;
    }
}

/* ---------- Three-zone layout (CSS Grid: 1fr auto 1fr) ---------- */

#shp-header .shp-zone {
    display: flex !important;
    align-items: center;
    min-width: 0;
}

#shp-header .shp-zone--left {
    justify-content: flex-start;
}

#shp-header .shp-zone--center {
    justify-content: center;
}

#shp-header .shp-zone--right {
    justify-content: flex-end;
    gap: 16px;
}

/* ---------- Brand ---------- */

#shp-header .shp-brand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: var(--shp-text) !important;
}

#shp-header .shp-brand:hover,
#shp-header .shp-brand:focus,
#shp-header .shp-brand:visited {
    text-decoration: none !important;
    color: var(--shp-text) !important;
}

#shp-header .shp-brand__logo {
    display: block;
    max-height: 44px;
    width: auto;
}

#shp-header .shp-brand__name {
    font-size: 32px !important;
    font-weight: 700 !important;
    letter-spacing: -0.025em !important;
    line-height: 1 !important;
    color: #111827 !important;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

@media (max-width: 767px) {
    #shp-header .shp-brand__name {
        font-size: 26px !important;
    }
}

/* ---------- Desktop search bar ---------- */

#shp-header .shp-search {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
    padding: 10px 18px !important;
    width: 280px;
    height: auto;
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-search:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

#shp-header .shp-search:focus-within {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

@media (max-width: 767px) {
    #shp-header .shp-search {
        display: none !important;
    }
}

#shp-header .shp-search__icon {
    flex-shrink: 0;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    color: #6b7280;
    display: block;
}

#shp-header .shp-search__input,
#shp-header .shp-search__input[type="text"],
#shp-header .shp-overlay__search .shp-search__input,
#shp-header .shp-overlay__search .shp-search__input[type="text"] {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #111827 !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 1.5 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

#shp-header .shp-search__input:focus,
#shp-header .shp-search__input[type="text"]:focus {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#shp-header .shp-search__input::placeholder {
    color: #6b7280 !important;
    opacity: 1;
}

#shp-header .shp-search__input::-webkit-search-cancel-button,
#shp-header .shp-search__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

/* ---------- Icon button (mobile search) ---------- */

#shp-header .shp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    margin-left: -8px;
    border: none !important;
    border-radius: 9999px !important;
    background: transparent !important;
    color: #1f2937;
    cursor: pointer;
    line-height: 0;
    -webkit-appearance: none;
    appearance: none;
    transition-property: color, background-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-icon-btn:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05) !important;
}

#shp-header .shp-icon-btn svg {
    display: block;
    width: 22px !important;
    height: 22px !important;
}

/* ---------- Desktop navigation ---------- */

#shp-header .shp-nav__list {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

#shp-header .shp-nav__list li {
    position: relative;
}

#shp-header .shp-nav__list li a {
    display: block;
    padding: 6px 14px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: var(--shp-text) !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    white-space: nowrap;
    position: relative;
    transition-property: color, background-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-nav__list li a:hover,
#shp-header .shp-nav__list li a:focus,
#shp-header .shp-nav__list li a:visited {
    text-decoration: none !important;
    color: var(--shp-text) !important;
}

#shp-header .shp-nav__list li a::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    background: var(--shp-accent) !important;
    border-radius: 1px !important;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-nav__list li a:hover::after,
#shp-header .shp-nav__list li.current-menu-item > a::after {
    transform: scaleX(1);
}

#shp-header .shp-nav__list li a:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

#shp-header .shp-nav__list li .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    padding: 8px 0 !important;
    margin: 4px 0 0 !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 150ms, transform 150ms, visibility 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

#shp-header .shp-nav__list li:hover > .sub-menu,
#shp-header .shp-nav__list li.shp-dropdown-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#shp-header .shp-nav__list li .sub-menu li a {
    padding: 8px 16px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    border-radius: 0 !important;
}

#shp-header .shp-nav__list li .sub-menu li a::after {
    display: none;
}

#shp-header .shp-nav__list li .sub-menu li a:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

#shp-header .shp-nav__list li .sub-menu li .sub-menu {
    top: 0;
    left: 100%;
    margin: 0 0 0 4px !important;
}

#shp-header .shp-nav__list li.menu-item-has-children > a {
    padding-right: 26px !important;
}

#shp-header .shp-nav__list li.menu-item-has-children > a::before {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    border-bottom: none;
    opacity: 0.45;
}

/* ---------- Hamburger ---------- */

#shp-header .shp-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    margin-right: -8px;
    border: none !important;
    background: transparent !important;
    cursor: pointer;
    border-radius: 9999px !important;
    gap: 5px;
    -webkit-appearance: none;
    appearance: none;
    transition-property: background-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-hamburger:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

#shp-header .shp-hamburger__line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--shp-text) !important;
    border-radius: 1px !important;
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
                opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-hamburger.shp-active .shp-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#shp-header .shp-hamburger.shp-active .shp-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#shp-header .shp-hamburger.shp-active .shp-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile overlay ---------- */

#shp-header .shp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.98) !important;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 250ms ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#shp-header .shp-overlay.shp-open {
    opacity: 1;
    visibility: visible;
}

#shp-header .shp-overlay__body {
    padding: 136px 20px 40px !important;
    max-width: var(--shp-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.admin-bar #shp-header .shp-overlay__body {
    padding-top: 168px !important;
}

@media (max-width: 767px) {
    #shp-header .shp-overlay__body {
        padding: 116px 16px 40px !important;
    }

    .admin-bar #shp-header .shp-overlay__body {
        padding-top: 162px !important;
    }
}

#shp-header .shp-overlay__search {
    display: flex !important;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.04) !important;
    border: 1px solid transparent !important;
    border-radius: 9999px !important;
    padding: 12px 16px !important;
    transition-property: background-color, border-color, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-overlay__search:focus-within {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

#shp-header .shp-overlay__search .shp-search__input {
    font-size: 16px !important;
}

#shp-header .shp-overlay__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#shp-header .shp-overlay__list li a {
    display: block;
    padding: 12px 16px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: var(--shp-text) !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-overlay__list li a:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    text-decoration: none !important;
}

#shp-header .shp-overlay__list li.current-menu-item > a {
    color: var(--shp-accent) !important;
    font-weight: 600 !important;
}

#shp-header .shp-overlay__list .sub-menu {
    padding: 0 0 0 16px !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms ease;
}

#shp-header .shp-overlay__list li.shp-dropdown-open > .sub-menu {
    max-height: 500px;
}

#shp-header .shp-overlay__list .sub-menu li a {
    font-size: 15px !important;
    font-weight: 400 !important;
    padding: 10px 16px !important;
    color: #6b7280 !important;
}

#shp-header .shp-overlay__list .sub-menu li a:hover {
    color: var(--shp-text) !important;
}

#shp-header .shp-overlay__list .menu-item-has-children > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

#shp-header .shp-overlay__list .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
    border-bottom: none;
    opacity: 0.4;
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

#shp-header .shp-overlay__list .menu-item-has-children.shp-dropdown-open > a::after {
    transform: rotate(180deg);
}

/* ---------- Responsive visibility ---------- */

#shp-header .shp-desktop-only {
    display: flex !important;
}

#shp-header .shp-mobile-only {
    display: none !important;
}

@media (max-width: 767px) {
    #shp-header .shp-desktop-only {
        display: none !important;
    }

    #shp-header .shp-mobile-only {
        display: inline-flex !important;
    }

    #shp-header .shp-hamburger {
        display: flex !important;
    }
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) and (min-width: 768px) {
    #shp-header .shp-search {
        width: 220px;
    }

    #shp-header .shp-nav__list li a {
        padding: 6px 10px !important;
        font-size: 14px !important;
    }
}

/* ---------- Focus ring ---------- */

#shp-header *:focus-visible {
    outline: 2px solid var(--shp-accent) !important;
    outline-offset: 2px;
}

/* ---------- Neutralize theme body spacing ---------- */
/* Many themes add padding-top on body for their own header.
   When our header is active, zero it out. */

body.shp-active-header {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.shp-active-header.admin-bar {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Common theme header wrappers — hide them when our header runs */
body.shp-active-header > .site-header:not(#shp-header),
body.shp-active-header > header:not(#shp-header),
body.shp-active-header > .masthead:not(#shp-header),
body.shp-active-header > .header-wrapper:not(#shp-header),
body.shp-active-header > div > .site-header:not(#shp-header),
body.shp-active-header > div > header:not(#shp-header),
body.shp-active-header > div > .masthead:not(#shp-header) {
    display: none !important;
}



/* ---------- Mini-cart container (Custom Mini Cart plugin) ---------- */
/* The global reset above excludes .shp-minicart-wrap and its children,
   so the Custom Mini Cart plugin's own styles apply untouched.
   IMPORTANT: No position/z-index/transform here — those create a
   stacking context that traps position:fixed children (panel/overlay). */

#shp-header .shp-minicart-wrap {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    line-height: normal;
}

/* Ensure mini-cart is always visible, including on mobile */
@media (max-width: 767px) {
    #shp-header .shp-minicart-wrap {
        display: flex !important;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }
}

/* ---------- Live search results dropdown ---------- */

#shp-header .shp-search,
#shp-header .shp-overlay__search {
    position: relative;
}

#shp-header .shp-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.06) !important;
    z-index: 9999;
    padding: 6px !important;
}

#shp-header .shp-search__results[hidden] {
    display: none !important;
}

#shp-header .shp-overlay__search .shp-search__results {
    position: relative;
    top: auto;
    width: 100%;
    margin-top: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
}

#shp-header .shp-search__item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    color: #111827 !important;
    transition: background-color 120ms ease;
}

#shp-header .shp-search__item:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    text-decoration: none !important;
}

#shp-header .shp-search__thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px !important;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6 !important;
    border: none !important;
}

#shp-header .shp-search__thumb--empty {
    display: block;
}

#shp-header .shp-search__item-body {
    display: flex !important;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

#shp-header .shp-search__item-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #111827 !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#shp-header .shp-search__item-price {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #030213 !important;
    line-height: 1.3 !important;
}

#shp-header .shp-search__item-type {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
    line-height: 1.3 !important;
    text-transform: capitalize;
}

#shp-header .shp-search__empty {
    padding: 20px 16px !important;
    text-align: center;
    font-size: 14px !important;
    color: #6b7280 !important;
}

/* ---------- Mobile search expansion ---------- */

@media (max-width: 767px) {
    #shp-header .shp-search.shp-search--mobile-open {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100% !important;
        border-radius: 0 !important;
        padding: 12px 16px !important;
        background: #ffffff !important;
        border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        z-index: 9999;
    }

    #shp-header .shp-search.shp-search--mobile-open .shp-search__results {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100% !important;
        border-radius: 0 0 12px 12px !important;
        max-height: 60vh;
    }
}
