/* Marketplace header (SPA2Z) — 4-row layout */
:root {
    --sh-teal: #0b5d57;
    --sh-teal-dark: #073b37;
    --sh-teal-light: #eef4f3;
    --sh-green: #3ddc84;
    --sh-border: #dde3e3;
    --sh-ink: #1c2528;
    --sh-muted: #445654;
    --sh-top-text: #dcefed;
    --sh-verified-bg: #dcf3e6;
    --sh-verified-text: #11643a;
    --sh-max: var(--site-max, 1360px);
    --sh-gutter: var(--site-gutter, 40px);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-chrome--marketplace {
    position: relative;
    top: auto;
    z-index: 1000;
    font-family: Inter, system-ui, sans-serif;
    color: var(--sh-ink);
}

.site-chrome--marketplace a {
    text-decoration: none;
    color: inherit;
}

.site-header--v2 {
    background: #fff;
    position: relative;
    top: auto;
    box-shadow: none;
    border-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.sh-inner {
    width: 100%;
    max-width: var(--sh-max);
    margin: 0 auto;
}

/* —— Row 1 —— */
.sh-top {
    background: var(--sh-teal-dark);
    color: var(--sh-top-text);
    font-size: 12px;
    line-height: 1.4;
    padding: 7px var(--sh-gutter);
}

.sh-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sh-top a {
    color: var(--sh-top-text);
}

.sh-top a:hover {
    text-decoration: underline;
}

.sh-top-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.sh-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sh-green);
    display: inline-block;
    flex-shrink: 0;
}

/* —— Sticky rows 2 + 3 —— */
.sh-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
}

.sh-main {
    background: #fff;
    border-bottom: 1px solid var(--sh-border);
    padding: 12px var(--sh-gutter);
}

.sh-main-inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sh-brand {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.sh-brand-text {
    font-size: 19px;
    font-weight: 700;
    color: var(--sh-teal);
    white-space: nowrap;
}

.sh-brand-img {
    display: block;
    height: 36px;
    width: auto;
    max-width: 180px;
}

.sh-search {
    flex: 1;
    min-width: 0;
    position: relative;
}

.sh-search-bar {
    display: flex;
    align-items: stretch;
    height: 42px;
    border: 2px solid var(--sh-teal);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.sh-search-cat {
    width: 150px;
    flex-shrink: 0;
    border: 0;
    border-right: 1px solid var(--sh-border);
    background-color: var(--sh-teal-light);
    padding: 0 28px 0 12px;
    font-size: 13px;
    color: var(--sh-ink);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23445654' d='M1.2 1.3 6 6.1l4.8-4.8 1.1 1.1L6 8.3.1 2.4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    font-family: inherit;
}

.sh-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    padding: 0 14px;
    font-size: 13px;
    background: #fff;
    font-family: inherit;
    color: var(--sh-ink);
}

.sh-search-input::placeholder {
    color: #8a9a98;
}

.sh-search-btn {
    flex-shrink: 0;
    border: 0;
    background: var(--sh-teal);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 0 26px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sh-search-btn:hover {
    background: var(--sh-teal-dark);
}

.sh-post {
    flex-shrink: 0;
    border: 0;
    background: none;
    padding: 0;
    color: var(--sh-teal);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
}

.sh-post:hover {
    text-decoration: underline;
}

.sh-mobile-actions {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.sh-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sh-teal);
    border: 0;
    background: none;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
}

.sh-icon-btn:hover,
.sh-icon-btn[aria-expanded="true"] {
    background: var(--sh-teal-light);
}

.sh-icon-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* Suggestions */
.sh-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--sh-border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(7, 59, 55, 0.12);
    padding: 8px 0;
    z-index: 120;
    max-height: 320px;
    overflow-y: auto;
}

.sh-suggestions.is-open {
    display: block;
}

.sh-sug-label {
    padding: 8px 14px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sh-muted);
}

.sh-sug-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--sh-ink);
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
}

.sh-sug-item span {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--sh-muted);
    font-weight: 400;
}

.sh-sug-item:hover,
.sh-sug-item:focus {
    background: var(--sh-teal-light);
    color: var(--sh-teal);
    outline: none;
}

/* —— Row 3 —— */
.sh-cat {
    background: #fff;
    border-bottom: 1px solid var(--sh-border);
    padding: 0 var(--sh-gutter);
}

.sh-cat-list {
    display: flex;
    align-items: stretch;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh-cat-link {
    display: inline-flex;
    align-items: center;
    padding: 11px 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--sh-ink);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.sh-cat-link:hover,
.sh-cat-link.is-active {
    color: var(--sh-teal);
    border-bottom-color: var(--sh-teal);
}

.sh-cat-mobile-extra {
    display: none;
}

/* —— Row 4 —— */
.sh-company {
    background: #fff;
    border-bottom: 1px solid var(--sh-border);
    font-size: 13px;
    color: var(--sh-muted);
    padding: 10px var(--sh-gutter);
}

.sh-company-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.sh-company-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    min-width: 0;
}

.sh-company-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--sh-ink);
    white-space: nowrap;
}

.sh-verified {
    display: inline-flex;
    align-items: center;
    background: var(--sh-verified-bg);
    color: var(--sh-verified-text);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.3;
}

.sh-company-meta {
    white-space: nowrap;
}

.sh-catalogue {
    flex-shrink: 0;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1.5px solid var(--sh-teal);
    border-radius: 6px;
    background: #fff;
    color: var(--sh-teal);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.sh-catalogue:hover {
    background: var(--sh-teal);
    color: #fff;
}

.sh-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 59, 55, 0.35);
    z-index: 90;
}

.sh-backdrop.is-open {
    display: block;
}

/* Neutralise old chrome scroll styles when marketplace header is active */
.site-chrome--marketplace.is-scrolled .sh-top,
.site-chrome--marketplace.is-scrolled header.site-header {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border-bottom-color: transparent;
    background: #fff;
}

body.open_nav .site-chrome--marketplace {
    z-index: 1102;
}

/* —— Tablet —— */
@media (max-width: 1024px) and (min-width: 768px) {
    .sh-main {
        padding: 10px var(--sh-gutter);
    }

    .sh-main-inner {
        gap: 14px;
    }

    .sh-search-cat {
        width: 128px;
        padding: 0 26px 0 10px;
        font-size: 12px;
        background-position: right 10px center;
    }

    .sh-search-btn {
        padding: 0 16px;
        font-size: 13px;
    }

    .sh-cat {
        padding: 0 var(--sh-gutter);
    }

    .sh-cat-list {
        gap: 16px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .sh-cat-list::-webkit-scrollbar {
        display: none;
    }

    .sh-cat-link {
        flex-shrink: 0;
        font-size: 12px;
        padding: 10px 0;
    }

    .sh-company {
        padding: 10px var(--sh-gutter);
    }

    .sh-company-name {
        font-size: 14px;
    }
}

/* —— Mobile —— */
@media (max-width: 767px) {
    .sh-top {
        display: none;
    }

    .sh-main {
        padding: 10px var(--sh-gutter);
    }

    .sh-main-inner {
        gap: 12px;
        position: relative;
    }

    .sh-company {
        padding: 10px var(--sh-gutter);
    }

    .sh-brand-text {
        font-size: 15px;
        max-width: calc(100vw - 120px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sh-brand-img {
        height: 32px;
        max-width: calc(100vw - 120px);
    }

    .sh-main-inner > .sh-post {
        display: none;
    }

    .sh-main-inner {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .sh-brand {
        margin-right: auto;
    }

    .sh-search {
        display: block;
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        position: relative;
        z-index: 120;
    }

    .sh-search.is-mobile-open {
        display: block;
        position: relative;
        left: auto;
        right: auto;
        top: auto;
    }

    .sh-search-bar {
        height: 40px;
    }

    .sh-search-cat {
        width: 112px;
        padding: 0 24px 0 8px;
        font-size: 12px;
        background-position: right 8px center;
    }

    .sh-search-input {
        padding: 0 10px;
        font-size: 13px;
    }

    .sh-search-btn {
        padding: 0 14px;
        font-size: 13px;
    }

    .sh-mobile-actions {
        display: inline-flex;
    }

    #shSearchToggle {
        display: none;
    }

    .sh-cat {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 86vw);
        padding: 72px 0 24px;
        border-bottom: 0;
        border-left: 1px solid var(--sh-border);
        box-shadow: -8px 0 24px rgba(7, 59, 55, 0.12);
        transform: translateX(100%);
        transition: transform 0.22s ease;
        z-index: 110;
        overflow-y: auto;
        background: #fff;
    }

    .sh-cat.is-open {
        transform: translateX(0);
    }

    .sh-cat > .sh-inner {
        padding: 0 20px;
    }

    .sh-cat-list {
        flex-direction: column;
        gap: 0;
    }

    .sh-cat-link {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--sh-border);
        margin-bottom: 0;
    }

    .sh-cat-link.is-active,
    .sh-cat-link:hover {
        border-bottom-color: var(--sh-border);
        box-shadow: inset 3px 0 0 var(--sh-teal);
        padding-left: 10px;
    }

    .sh-cat-mobile-extra {
        display: block;
        margin-top: 24px;
        padding-top: 8px;
        border-top: 1px solid var(--sh-border);
    }

    .sh-cat-mobile-extra .sh-post,
    .sh-cat-mobile-extra .sh-catalogue {
        display: flex;
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }

    .sh-cat-mobile-extra .sh-post {
        padding: 12px 0;
        border-bottom: 1px solid var(--sh-border);
        border-radius: 0;
    }

    .sh-company-inner {
        gap: 10px;
    }

    .sh-company-name,
    .sh-company-meta,
    .sh-company .sh-catalogue {
        display: none;
    }

    .sh-company-left {
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-chrome--marketplace *,
    .site-chrome--marketplace *::before,
    .site-chrome--marketplace *::after {
        transition: none !important;
    }
}
