/* Global header */

.store-site-header {
    --store-header-row-height: 68px;
    --store-header-control-size: 40px;
    --store-header-search-height: 40px;
    --store-header-menu-link-height: 38px;
    --store-header-logo-inset: 6px;
    --store-header-brand-width: clamp(140px, 16vw, 210px);
    --store-header-brand-gap: var(--store-space-8);
    position: sticky;
    top: 0;
    z-index: 90;
    box-sizing: border-box;
    /* Full-bleed top bar: flex parents (common with Elementor/Astra) often use align-items:center,
       which shrinks direct children to content width — without this the bar can sit “in the middle”. */
    align-self: stretch;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    border-bottom: 1px solid var(--store-color-border);
    background: var(--store-color-white);
    box-shadow: var(--store-shadow-panel);
    min-height: var(--store-header-row-height);
}

body.admin-bar .store-site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .store-site-header {
        top: 46px;
    }
}

.store-site-header__inner {
    width: var(--store-content-max-width);
    max-width: var(--store-content-max-width);
    margin: 0 auto;
    padding: var(--store-space-1) var(--store-space-8);
}

.store-site-header__row {
    display: grid;
    grid-template-columns: var(--store-header-brand-width) minmax(0, 1fr) auto auto;
    min-height: var(--store-header-row-height);
    align-items: center;
    gap: var(--store-space-8);
}

.store-site-header__brand,
.store-site-header__search,
.store-site-header__menu-panel {
    min-width: 0;
}

.store-site-header__brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: var(--store-header-brand-width);
    height: var(--store-header-row-height);
    min-width: var(--store-header-brand-width);
    max-width: var(--store-header-brand-width);
    min-height: var(--store-header-row-height);
    max-height: var(--store-header-row-height);
}

.store-site-header__brand .custom-logo-link,
.store-site-header__brand .store-site-header__brand-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    line-height: 0;
    text-decoration: none;
}

.store-site-header__brand .custom-logo {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(var(--store-header-row-height) - var(--store-header-logo-inset));
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    aspect-ratio: auto;
}

.store-site-header__logo-image {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(var(--store-header-row-height) - var(--store-header-logo-inset));
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    aspect-ratio: auto;
}

.store-site-header__logo-image--mobile {
    display: none;
}

.store-site-header__brand-icon {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(var(--store-header-row-height) - var(--store-header-logo-inset));
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    aspect-ratio: auto;
}

.store-site-header__brand-link--text {
    color: var(--store-color-text-strong);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.store-site-header__search-form,
.store-site-header__search-live,
.store-site-header__search .store-global-search-form {
    width: 100%;
    max-width: none;
}

.store-site-header__search--desktop {
    justify-self: center;
    width: min(100%, 420px);
    min-width: min(280px, 100%);
}

.store-site-header .store-global-search-input {
    min-height: var(--store-header-search-height);
    border-radius: 14px;
    border-color: var(--store-color-border);
    background: var(--store-color-surface);
    color: var(--store-color-text);
}

.store-site-header .store-global-search-input:focus,
.store-site-header .store-global-search-input:focus-visible {
    outline: none !important;
    border-color: var(--store-search-focus-border);
    box-shadow: var(--store-search-focus-ring);
}

.store-site-header .store-global-search-submit {
    min-width: 96px;
    min-height: var(--store-header-search-height);
    border-radius: 14px;
    padding: 0 var(--store-space-8);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.store-site-header .store-global-search-live-panel {
    top: calc(100% + var(--store-space-3));
    left: 0;
    width: 100%;
    min-width: 320px;
    max-width: none;
}

.store-site-header__menu-panel {
    display: flex;
    justify-content: flex-start;
    width: max-content;
    overflow: visible;
}

.store-site-header__nav {
    width: auto;
    overflow: visible;
}

.store-site-header__menu,
.store-site-header__menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.store-site-header__menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--store-space-2);
    flex-wrap: wrap;
}

.store-site-header__menu>li {
    position: relative;
}

.store-site-header__menu>li.menu-item-has-children:hover,
.store-site-header__menu>li.menu-item-has-children:focus-within {
    z-index: 60;
}

.store-site-header__menu a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--store-header-menu-link-height);
    padding: 0 var(--store-space-6);
    border-radius: var(--store-radius-pill);
    color: var(--store-color-text);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        transform var(--store-transition-fast),
        background-color var(--store-transition-fast),
        color var(--store-transition-fast),
        box-shadow var(--store-transition-fast);
}

.store-site-header__menu a:hover,
.store-site-header__menu a:focus-visible {
    color: var(--store-color-primary);
    background: var(--store-color-surface-soft);
    box-shadow: var(--store-shadow-control);
    outline: none;
}

.store-site-header__menu .current-menu-item>a,
.store-site-header__menu .current-menu-parent>a,
.store-site-header__menu .current_page_item>a,
.store-site-header__menu .current_page_parent>a {
    color: var(--store-color-white);
    background: linear-gradient(135deg, var(--store-color-primary) 0%, var(--store-color-primary-strong) 100%);
    box-shadow: var(--store-shadow-button);
}

.store-site-header__menu li ul {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    flex-direction: column;
    min-width: 220px;
    padding: var(--store-space-4);
    border: 1px solid var(--store-color-border-strong);
    border-radius: var(--store-radius-panel);
    background-color: var(--store-color-white);
    box-shadow: var(--store-shadow-panel);
    z-index: 70;
}

.store-site-header__menu>li.menu-item-has-children>ul {
    padding-top: calc(var(--store-space-4) + var(--store-space-3));
    background-clip: padding-box;
}

.store-site-header__menu>li.menu-item-has-children>ul::before {
    content: "";
    position: absolute;
    top: 0;
    left: -12px;
    right: -12px;
    height: calc(var(--store-space-3) + var(--store-space-4));
}

@media (min-width: 1081px) {
    .store-site-header__menu li:hover>ul,
    .store-site-header__menu li:focus-within>ul {
        display: flex;
    }
}

.store-site-header__menu li ul a {
    justify-content: flex-start;
    min-height: 40px;
    border-radius: 12px;
}

.store-site-header__menu li.menu-item-has-children>a {
    justify-content: space-between;
    gap: var(--store-space-3);
}

.store-site-header__menu li.menu-item-has-children>a::after {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.72;
}

.store-site-header__menu li ul li.menu-item-has-children>a::after {
    transform: rotate(-45deg) translateX(-1px);
}

.store-site-header__menu li ul li {
    position: relative;
}

.store-site-header__menu li ul li.menu-item-has-children:hover,
.store-site-header__menu li ul li.menu-item-has-children:focus-within {
    z-index: 80;
}

.store-site-header__menu li ul li.menu-item-has-children>ul {
    top: 0;
    left: 100%;
    padding-left: calc(var(--store-space-4) + var(--store-space-2));
    background-clip: padding-box;
    z-index: 90;
}

.store-site-header__menu li ul li.menu-item-has-children>ul::before {
    content: "";
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    width: calc(var(--store-space-2) + var(--store-space-4));
}

@media (min-width: 1081px) {
    .store-site-header__menu li ul li.menu-item-has-children:hover>ul,
    .store-site-header__menu li ul li.menu-item-has-children:focus-within>ul {
        display: flex;
    }
}

.store-site-header__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--store-space-4);
}

.store-site-header__theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.store-site-header__theme-toggle .wp-dark-mode-switch,
.store-site-header__theme-toggle .darkmode-switch,
.store-site-header__theme-toggle .wp-dark-mode-switcher {
    margin: 0;
}

.store-site-header__feedback-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--store-radius-pill, 999px);
    text-decoration: none;
    transition:
        transform var(--store-transition-fast),
        box-shadow var(--store-transition-fast),
        background-color var(--store-transition-fast),
        color var(--store-transition-fast),
        border-color var(--store-transition-fast);
}

.store-site-header__feedback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.store-site-header__feedback-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.store-site-header__menu > li.menu-item-feedback > a.store-site-header__feedback-link {
    gap: 8px;
    min-height: var(--store-header-control-size);
    padding: 0 14px;
    border: 1px solid var(--store-color-primary-pale);
    background: var(--store-color-primary-faint);
    color: var(--store-color-primary);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: var(--store-shadow-pill);
}

.store-site-header__menu > li.menu-item-feedback > a.store-site-header__feedback-link:hover,
.store-site-header__menu > li.menu-item-feedback > a.store-site-header__feedback-link:focus-visible {
    color: var(--store-color-primary-strong);
    background: var(--store-color-surface-soft);
    transform: translateY(-1px);
    box-shadow: var(--store-shadow-button);
    outline: none;
}

.store-site-header__menu > li.menu-item-feedback.current-menu-item > a.store-site-header__feedback-link,
.store-site-header__menu > li.menu-item-feedback.current_page_item > a.store-site-header__feedback-link,
.store-site-header__menu > li.menu-item-feedback > a.store-site-header__feedback-link.is-current {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: var(--store-shadow-button, 0 10px 22px rgba(37, 99, 235, 0.24));
}

.store-site-header__feedback-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--store-radius-pill, 999px);
    background: #ef4444;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.store-site-header__menu > li.menu-item-feedback > a.store-site-header__feedback-link.is-current .store-site-header__feedback-badge {
    background: #ffffff;
    color: #1d4ed8;
}

.store-site-header__toggle,
.store-site-header__cart .store-side-cart-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--store-header-control-size);
    min-width: var(--store-header-control-size);
    height: var(--store-header-control-size);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--store-color-primary);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transition:
        background-color var(--store-transition-fast),
        border-color var(--store-transition-fast),
        box-shadow var(--store-transition-fast);
}

.store-site-header__toggle {
    display: none;
    cursor: pointer;
}

.store-site-header__toggle:hover,
.store-site-header__cart .store-side-cart-trigger:hover {
    background: transparent;
    box-shadow: none;
}

.store-site-header__toggle:focus-visible,
.store-site-header__cart .store-side-cart-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--store-color-primary-faint);
}

.store-site-header__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.store-site-header__toggle-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: currentColor;
    opacity: 1;
    visibility: visible;
}

.store-site-header__cart .store-side-cart-trigger {
    gap: 0;
}

.store-site-header__cart .store-side-cart-trigger-count {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    height: 20px;
    padding: 0px 0px 0px 2px;
    font-size: 0.72rem;
    line-height: 1;
    box-shadow: 0 8px 14px rgba(225, 45, 54, 0.2);
}

.store-site-header__search-panel {
    display: none;
    position: relative;
    z-index: 1;
}

.store-site-header__menu-panel {
    position: relative;
    z-index: 1;
}

/* Global search */

.store-global-search {
    display: flex;
    flex-direction: column;
    gap: var(--store-space-8);
}

.store-global-search-live {
    position: relative;
    width: 100%;
}

.store-global-search-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--store-space-8);
    flex-wrap: wrap;
}

.store-global-search-heading-group {
    display: flex;
    flex-direction: column;
    gap: var(--store-space-2);
}

.store-global-search-title {
    margin: 0;
    color: var(--store-color-title);
    font-size: 1.4rem;
    line-height: 1.2;
}

.store-global-search-summary,
.store-global-search-message {
    margin: 0;
    color: var(--store-color-text-muted);
    line-height: 1.5;
}

.store-global-search-form {
    display: flex;
    align-items: stretch;
    gap: var(--store-space-3);
    width: 100%;
    max-width: 520px;
}

.store-global-search-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 46px;
    padding: 0 var(--store-space-5);
    border: 1px solid var(--store-color-border);
    border-radius: 14px;
    background: var(--store-color-white);
    color: var(--store-color-text);
    box-shadow: none;
}

.store-global-search-input::placeholder {
    color: var(--store-color-text-muted);
}

.store-global-search-input:focus,
.store-global-search-input:focus-visible {
    border-color: var(--store-search-focus-border);
    box-shadow: var(--store-search-focus-ring);
}

.store-global-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 var(--store-space-6);
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform var(--store-transition-fast),
        box-shadow var(--store-transition-fast);
}

.store-global-search-submit:hover {
    transform: translateY(-1px);
}

.store-global-search-submit:focus-visible {
    outline: none;
}

.store-global-search-grid {
    width: 100%;
}

.store-global-search-pagination-wrap {
    margin-top: var(--store-space-2);
}

.store-global-search-live-panel {
    position: absolute;
    top: calc(100% + var(--store-space-3));
    left: 0;
    z-index: 70;
    width: min(560px, 100vw - 24px);
    border: 1px solid var(--store-color-border-strong);
    border-radius: 20px;
    background: var(--store-color-white);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.store-global-search-live-results {
    max-height: min(72vh, 560px);
    overflow-y: auto;
}

.store-global-search-preview {
    display: flex;
    flex-direction: column;
}

.store-global-search-preview-summary,
.store-global-search-preview-message {
    margin: 0;
    padding: var(--store-space-5) var(--store-space-6);
    color: var(--store-color-text-muted);
    line-height: 1.45;
}

.store-global-search-preview-summary {
    border-bottom: 1px solid var(--store-color-border-strong);
    font-size: 0.92rem;
}

.store-global-search-preview-list {
    display: flex;
    flex-direction: column;
}

.store-global-search-preview-footer {
    padding: var(--store-space-4) var(--store-space-6) var(--store-space-6);
    border-top: 1px solid var(--store-color-border-strong);
    background: var(--store-color-white);
}

.store-global-search-preview-view-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 0 var(--store-space-6);
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    transition:
        transform var(--store-transition-fast),
        box-shadow var(--store-transition-fast);
}

.store-global-search-preview-view-all:hover {
    transform: translateY(-1px);
}

.store-global-search-preview-item {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: var(--store-space-5);
    padding: var(--store-space-5) var(--store-space-6);
    color: inherit;
    text-decoration: none;
    transition: background-color var(--store-transition-fast);
}

.store-global-search-preview-item+.store-global-search-preview-item {
    border-top: 1px solid var(--store-color-border-strong);
}

.store-global-search-preview-item:hover {
    background: var(--store-color-surface-soft);
}

.store-global-search-preview-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    padding: var(--store-space-2);
    border-radius: 16px;
    background: var(--store-color-white);
    border: 1px solid var(--store-color-border-soft);
}

.store-global-search-preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.store-global-search-preview-body {
    display: flex;
    flex-direction: column;
    gap: var(--store-space-2);
    min-width: 0;
}

.store-global-search-preview-title {
    color: var(--store-color-title);
    font-size: 0.94rem;
    line-height: 1.45;
    overflow-wrap: break-word;
}

.store-global-search-preview-price,
.store-global-search-preview-price .price {
    color: var(--store-color-price);
    font-size: 0.9rem;
    line-height: 1.35;
    font-weight: 500;
}

.store-global-search-preview-price ins {
    text-decoration: none;
}

/* Dark mode (WP Dark Mode) */

html[data-store-theme="dark"] .store-site-header,
html[data-store-theme="dark"] .store-site-header {
    border-bottom-color: var(--store-color-border);
    background: var(--store-color-surface);
    box-shadow: var(--store-shadow-panel);
    color: var(--store-color-text);
}

html[data-store-theme="dark"] .store-promo-banner,
html[data-store-theme="dark"] .store-promo-banner {
    border-color: var(--store-color-border);
    background: var(--store-color-surface);
    color: var(--store-color-text);
}
