/* Keep the storefront header on one responsive layout, independent of catalog styles. */
.store-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 5px 18px rgba(57, 49, 39, .07);
}

.store-header-main {
    display: grid;
    grid-template-columns: 220px minmax(200px, 520px) auto;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    min-height: 108px;
    padding-block: 20px;
}

.store-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
}

.store-brand img {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 180 / 47;
    object-fit: contain;
}

.store-brand > span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: .2px;
}

.store-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-left: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f9f7f3;
}

.store-search > .icon {
    width: 18px;
    color: var(--muted);
}

.store-search input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 10px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
}

.store-search:focus-within {
    outline: 2px solid var(--brand-dark);
    outline-offset: 2px;
}

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

.store-search button,
.store-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--brown);
}

.store-search button:hover { background: var(--soft); }

.store-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.store-bag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 14px;
    white-space: nowrap;
}

.store-account {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: var(--ink);
    font-size: 14px;
    white-space: nowrap;
}

.store-account .icon { width: 20px; height: 20px; }
.store-account:hover { color: var(--brand-dark); }
.store-bag:hover { color: var(--brand-dark); }
.store-bag .cart-count { flex-shrink: 0; }
.store-menu-toggle { display: none; border: 1px solid var(--line); }
.store-menu-close { display: none; }
.store-menu-toggle[aria-expanded="true"] { background: var(--soft); border-color: var(--brown); }
.store-menu-toggle[aria-expanded="true"] .store-menu-open { display: none; }
.store-menu-toggle[aria-expanded="true"] .store-menu-close { display: block; }

.store-nav { border-top: 1px solid var(--line); }

.store-nav-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.8vw, 28px);
    margin-bottom: 0;
    padding: 0;
    list-style: none;
}

.store-nav-links > li { min-width: 0; }

.store-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 54px;
    padding-block: 15px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.store-nav-link:hover,
.store-nav-link.active { color: var(--brand-dark); }

.store-nav-link.active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: var(--brand);
    content: '';
}

.store-nav-contact { margin-left: auto; }
.store-nav-contact .icon { width: 16px; height: 16px; }

@media (min-width: 992px) {
    .store-nav.collapse,
    .store-nav.collapsing {
        display: block !important;
        height: auto !important;
        overflow: visible;
        transition: none;
    }
}

@media (max-width: 991.98px) {
    .store-header-main {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px 16px;
        min-height: 0;
        padding-block: 14px;
    }

    .store-brand > span { display: none; }
    .store-search { grid-column: 1 / -1; grid-row: 2; }
    .store-search input { font-size: 16px; }
    .store-header-actions { grid-column: 2; grid-row: 1; }
    .store-menu-toggle { display: inline-flex; }

    .store-nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 4px 12px;
        padding-block: 12px;
    }

    .store-nav.show,
    .store-nav.collapsing {
        max-height: calc(100vh - 126px);
        overflow-y: auto;
    }

    .store-nav-link {
        height: 100%;
        min-height: 46px;
        padding: 11px 12px;
        border-radius: 4px;
        white-space: normal;
    }

    .store-nav-link:hover,
    .store-nav-link.active { background: var(--soft); }
    .store-nav-link.active { box-shadow: inset 3px 0 var(--brand); }
    .store-nav-link.active::after { display: none; }
    .store-nav-contact { margin-left: 0; }
}

@media (max-width: 575.98px) {
    .store-brand img { width: 160px; }
    .store-account > span,
    .store-bag-label { display: none; }
    .store-header-actions { gap: 10px; }
    .store-nav-links { gap: 4px; }
    .store-nav-link { padding-inline: 10px; }
}

@media (max-width: 359.98px) {
    .store-brand img { width: 130px; }
    .store-header-main { column-gap: 10px; }
    .store-header-actions { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .store-nav.collapsing { transition: none; }
}
