.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    min-height: 72px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-name {
    font-weight: 700;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.main-nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.main-nav a:hover {
    color: var(--black);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--white);
}

.header-button.primary {
    background: var(--black);
    border-color: var(--black);
    color: var(--white);
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.mobile-menu-toggle:hover {
    background: var(--soft);
    border-color: var(--gold);
}

.mobile-menu-toggle:focus-visible,
.mobile-nav-close:focus-visible,
.mobile-nav-link:focus-visible {
    outline: 3px solid rgba(182, 154, 104, 0.28);
    outline-offset: 2px;
}

.mobile-menu-toggle-line {
    display: block;
    width: 19px;
    height: 2px;
    margin: 2px 0;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease;
}

.mobile-nav {
    display: none;
}

.mobile-nav-backdrop {
    display: none;
}

.mobile-nav-header,
.mobile-nav-divider,
.mobile-nav-links,
.mobile-nav-brand,
.mobile-nav-close,
.mobile-nav-link {
    display: none;
}

@media (max-width: 760px) {
    .header-inner {
        min-height: 64px;
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-search {
        order: 4;
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .main-nav {
        display: none;
    }

    .header-actions {
        order: 2;
        margin-left: auto;
        gap: 6px;
    }

    .header-actions .header-button {
        min-height: 38px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .header-actions .header-button:not(.primary):not(:last-child),
    .header-actions .header-logout-form {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        order: 3;
    }

    .mobile-nav {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1001;
        display: flex;
        flex-direction: column;
        width: min(88vw, 380px);
        height: 100dvh;
        padding: 0 18px 22px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--white);
        border-left: 1px solid var(--border);
        box-shadow: -18px 0 50px rgba(17, 17, 17, 0.16);
        transform: translateX(105%);
        visibility: hidden;
        transition:
            transform 0.22s ease,
            visibility 0.22s ease;
    }

    .mobile-nav.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .mobile-nav[hidden],
    .mobile-nav-backdrop[hidden] {
        display: none;
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        min-height: 78px;
        padding: 12px 2px;
    }

    .mobile-nav-brand {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 11px;
    }

    .mobile-nav-brand img {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        object-fit: contain;
    }

    .mobile-nav-brand div {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 2px;
    }

    .mobile-nav-brand strong {
        overflow: hidden;
        color: var(--black);
        font-size: 16px;
        font-weight: 800;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-brand span {
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 38px;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--white);
        color: var(--black);
        font-size: 27px;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-nav-close:hover {
        background: var(--soft);
        border-color: var(--gold);
    }

    .mobile-nav-divider {
        display: block;
        height: 1px;
        margin: 0 -18px 12px;
        background: var(--border);
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        min-height: 50px;
        padding: 10px 11px;
        gap: 12px;
        border: 1px solid transparent;
        border-radius: 11px;
        color: var(--black);
        background: transparent;
        font-size: 14px;
        font-weight: 650;
        transition:
            background 0.16s ease,
            border-color 0.16s ease,
            transform 0.16s ease;
    }

    .mobile-nav-link:hover {
        border-color: var(--border);
        background: var(--soft);
    }

    .mobile-nav-link:active {
        transform: scale(0.985);
    }

    .mobile-nav-link-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        border-radius: 9px;
        background: var(--soft);
        color: var(--gold);
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
    }

    .mobile-nav-link-label {
        flex: 1 1 auto;
        min-width: 0;
    }

    .mobile-nav-link-arrow {
        flex: 0 0 auto;
        color: var(--muted);
        font-size: 16px;
        transition: transform 0.16s ease;
    }

    .mobile-nav-link:hover .mobile-nav-link-arrow {
        transform: translateX(3px);
        color: var(--black);
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        background: rgba(17, 17, 17, 0.42);
        opacity: 0;
        visibility: hidden;
        transition:
            opacity 0.22s ease,
            visibility 0.22s ease;
    }

    .mobile-nav-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .brand-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-actions .header-button {
        font-size: 12px;
        min-height: 36px;
    }

    .mobile-nav {
        width: min(91vw, 360px);
    }

    .mobile-nav-link {
        min-height: 52px;
    }
}

/* ============================================================
   CUSTOMER LIVE PRODUCT SEARCH
   ============================================================ */

.customer-search {
    position: relative;
    min-width: 0;
}

.header-search {
    flex: 1 1 360px;
    max-width: 430px;
    margin-left: auto;
}

.customer-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    overflow: hidden;
}

.customer-search-icon {
    flex: 0 0 auto;
    margin-left: 12px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
}

.customer-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--black);
    font: inherit;
    font-size: 14px;
}

.customer-search-input::placeholder {
    color: var(--muted);
}

.customer-search-input:focus {
    outline: 0;
}

.customer-search-form:focus-within {
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.customer-search-clear {
    flex: 0 0 auto;
    min-height: 34px;
    margin-right: 4px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--white);
    color: var(--black);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.customer-search-clear:hover {
    background: var(--surface);
}

.customer-search-submit {
    flex: 0 0 auto;
    min-height: 34px;
    margin-right: 4px;
    padding: 7px 12px;
    border: 0;
    border-radius: 7px;
    background: var(--black);
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.customer-search-results {
    position: absolute;
    z-index: 100;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(520px, 70vh);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.customer-search-results[hidden] {
    display: none;
}

.customer-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--black);
    text-decoration: none;
}

.customer-search-result:last-of-type {
    border-bottom: 0;
}

.customer-search-result:hover {
    background: var(--soft);
}

.customer-search-result-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--soft);
}

.customer-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.customer-search-result-placeholder {
    padding: 4px;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
}

.customer-search-result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.customer-search-result-info strong {
    overflow: hidden;
    color: var(--black);
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-search-result-info small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-search-result-price {
    color: var(--black);
    font-size: 12px;
    font-weight: 700;
}

.customer-search-view-all {
    display: block;
    padding: 12px;
    color: var(--black);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    background: var(--soft);
}

.customer-search-view-all:hover {
    text-decoration: underline;
}

.customer-search-empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}


/* Global search result sections */
.customer-search-section {
    border-bottom: 1px solid var(--border);
}

.customer-search-section:last-child {
    border-bottom: 0;
}

.customer-search-section-title {
    padding: 10px 12px 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--soft);
}

.customer-search-section-list {
    display: flex;
    flex-direction: column;
}

.customer-search-category-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--black);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.customer-search-category-result:last-child {
    border-bottom: 0;
}

.customer-search-category-result:hover {
    background: var(--soft);
}

.customer-search-category-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--soft);
}

.customer-search-category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.customer-search-category-placeholder {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.customer-search-category-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

.customer-search-category-info strong {
    overflow: hidden;
    color: var(--black);
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-search-category-info small {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-search-category-info span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .customer-search-category-result {
        gap: 9px;
        padding: 9px 10px;
    }

    .customer-search-category-image {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }
}

/* Header layout with live search */
.header-inner > .header-search {
    order: 2;
}

.header-inner > .main-nav {
    order: 3;
}

.header-inner > .mobile-nav {
    order: 4;
}

.header-inner > .header-actions {
    order: 5;
}

@media (max-width: 1050px) {
    .header-inner {
        gap: 12px;
    }

    .header-search {
        flex-basis: 280px;
        max-width: 340px;
    }

    .main-nav {
        gap: 14px;
    }
}

@media (max-width: 760px) {
    .header-inner {
        align-items: center;
    }

    .header-search {
        order: 3 !important;
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .header-inner > .main-nav {
        order: 2;
    }

    .header-inner > .mobile-nav {
        order: 4;
    }

    .header-inner > .header-actions {
        order: 2;
    }

    .customer-search-form {
        min-height: 40px;
    }

    .customer-search-input {
        height: 38px;
    }

    .customer-search-results {
        position: absolute;
        left: 0;
        right: 0;
        max-height: 60vh;
    }
}

@media (max-width: 480px) {
    .header-search {
        flex-basis: 100%;
    }

    .customer-search-submit {
        padding: 7px 10px;
        font-size: 11px;
    }

    .customer-search-clear {
        padding: 7px 9px;
        font-size: 11px;
    }


    .customer-search-result {
        gap: 9px;
        padding: 9px 10px;
    }

    .customer-search-result-image {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }
}

/* ============================================================
   MOBILE HEADER — FINAL LAYOUT
   Top: Logo + Website Name + Menu
   Middle: Search
   Bottom: Home / Products / Categories
   ============================================================ */

@media (max-width: 760px) {

    /* --------------------------------------------------------
       TOP ROW
       -------------------------------------------------------- */

    .site-header .header-inner {
        align-items: center;
    }

    .site-header .brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 8px;
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .site-header .brand-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-header .mobile-menu-toggle {
        order: 2;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        margin-left: auto;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 10px;
        background: #fff;
        color: inherit;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .site-header .mobile-menu-toggle span {
        display: block;
        width: 19px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /*
     * Account / Cart / Wishlist / Login / Register / Logout
     * are available inside the hamburger drawer.
     */
    .site-header .header-actions {
        display: none;
    }

    /* --------------------------------------------------------
       SEARCH ROW
       -------------------------------------------------------- */

    .site-header .header-search {
        order: 3 !important;
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }

    /* --------------------------------------------------------
       BOTTOM HEADER NAVIGATION
       Home / Products / Categories remain here
       -------------------------------------------------------- */

    .site-header .main-nav {
        order: 4;
        display: flex;
        flex: 1 1 100%;
        width: 100%;
        margin: 10px 0 0;
        padding: 7px 0 0;
        border-top: 1px solid var(--border-color, #e5e7eb);
        gap: 6px;
        justify-content: space-between;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-header .main-nav::-webkit-scrollbar {
        display: none;
    }

    .site-header .main-nav a {
        flex: 1 0 auto;
        min-width: 0;
        padding: 8px 12px;
        border-radius: 9px;
        text-align: center;
        white-space: nowrap;
        font-size: 13px;
        font-weight: 700;
    }

    .site-header .main-nav a:hover,
    .site-header .main-nav a:focus-visible {
        background: rgba(0, 0, 0, 0.05);
    }

    /* --------------------------------------------------------
       MOBILE DRAWER ACCOUNT SECTION
       -------------------------------------------------------- */

    .mobile-nav-section-divider {
        height: 1px;
        margin: 8px 0;
        background: var(--border-color, #e5e7eb);
    }

    .mobile-nav-account-links {
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-logout-form {
        margin: 0;
        padding: 0;
    }

    .mobile-nav-account-link {
        width: 100%;
        border: 0;
        background: transparent;
        text-align: left;
        font: inherit;
        cursor: pointer;
    }
}

@media (max-width: 480px) {

    .site-header .mobile-menu-toggle {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .site-header .main-nav {
        gap: 4px;
        padding-top: 6px;
    }

    .site-header .main-nav a {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* ============================================================
   MOBILE HEADER — COMPACT SPACING
   ============================================================ */

@media (max-width: 760px) {
    .site-header .header-inner {
        gap: 6px;
    }

    .site-header .header-search {
        margin-top: 2px;
    }

    .site-header .main-nav {
        margin-top: 2px;
        padding-top: 4px;
    }

    .site-header .main-nav a {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .site-header .header-inner {
        gap: 4px;
    }

    .site-header .header-search {
        margin-top: 1px;
    }

    .site-header .main-nav {
        margin-top: 1px;
        padding-top: 3px;
    }

    .site-header .main-nav a {
        padding-top: 5px;
        padding-bottom: 5px;
    }
}
