/* ============================================================
   HEADER — Clean white layout
   ============================================================ */

/* ── Outer wrapper keeps everything full width ── */
.site-header {
    --logo-height: 51px;
    --header-pad-y: 18px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}

/* Shrinks once the page is scrolled so the header doesn't eat the viewport */
.site-header.is-compact {
    --logo-height: 38px;
    --header-pad-y: 10px;
}

/* ── Inner container – max width, centred ── */
.header-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: var(--header-pad-y) 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: padding .25s ease;
}

/* ── Logo ── */
/* Allowed to shrink so the wide lockup never pushes the icons off screen */
.header-logo {
    min-width: 0;
    flex: 0 1 auto;
}

.header-logo img {
    display: block !important;
    height: auto;
    width: auto;
    max-height: var(--logo-height);
    max-width: 100%;
    transition: max-height .25s ease;
}

/* ── Icon group (right side) ── */
.header-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.header-icons a,
.header-icons .search-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: none;
    color: #222;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.header-icons a:hover,
.header-icons .search-toggle:hover {
    background: #f0f0f0;
}

.header-icons a svg,
.header-icons .search-toggle svg {
    fill: #666;
    width: 26px;
    height: 26px;
}

.header-icons .search-toggle[aria-expanded="true"] {
    background: #eef2ff;
}

.header-icons .search-toggle[aria-expanded="true"] svg {
    fill: var(--primary-color, #012169);
}

/* ── Pop-out search panel ── */
.header-search-panel {
    display: none;
    border-top: 1px solid #eee;
}

.header-search-panel.is-open {
    display: block;
    animation: searchPanelDrop .18s ease-out;
}

@keyframes searchPanelDrop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.search-panel-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    box-sizing: border-box;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 8px 16px;
}

.header-search:focus-within {
    border-color: var(--primary-color, #012169);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(1,33,105,.08);
}

.header-search .search-leading-icon {
    flex-shrink: 0;
    fill: #888;
    width: 20px;
    height: 20px;
}

.header-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: var(--text-main, #222);
    font-family: inherit;
}

.header-search input::placeholder {
    color: #aaa;
}

.header-search .search-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.header-search .search-close svg {
    fill: #888;
    width: 20px;
    height: 20px;
}

.header-search .search-close:hover svg {
    fill: #222;
}

/* ── Badge counters ── */
.basket-count,
.pending-count {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    background: var(--primary-color, #012169);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    border-radius: 9px;
    padding: 0 3px;
    display: none;
}

.basket-icon,
.account-icon,
.pending-icon {
    position: relative;
}

/* ── Logged-in bar ── */
.loggedin {
    background-color: #012169;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 16px;
    color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
}

/* ── Trust / info strip ── */
.trust-strip {
    background: var(--bg-subtle, #f9fafb);
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    width: 100%;
    box-sizing: border-box;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Breadcrumb: static centred row */
.trust-breadcrumb .trust-strip-inner {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

/* Ticker tape (used when not showing a breadcrumb).
   The track holds two identical groups and slides left by exactly one
   group width (-50% of the track), so the loop looks continuous. */
.trust-ticker {
    overflow: hidden;
    padding: 10px 0;
    box-sizing: border-box;
}

.trust-ticker-track {
    display: flex;
    align-items: center;
    /* Sizes to content, so -50% is a full group rather than half a viewport */
    width: max-content;
    animation: trust-marquee 30s linear infinite;
}

.trust-ticker:hover .trust-ticker-track {
    animation-play-state: paused;
}

.trust-ticker-group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    /* Equal gap between every item, including across the loop join */
    gap: 3.5rem;
    padding-right: 3.5rem;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
    color: #6b7280;
}

.trust-item strong {
    color: #4b5563;
    font-weight: 600;
}

.trust-item a {
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
}

.trust-item a:hover {
    color: #111827;
}

/* Mono icons */
.trust-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}

.trust-icon-img {
    width: 16px;
    height: 16px;
    display: block !important;
    flex-shrink: 0;
    filter: grayscale(1) brightness(0.55);
    opacity: 0.9;
}

@keyframes trust-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── Search results dropdown ── */
.search-results-wrap {
    position: absolute;
    top: calc(100% - 8px);
    left: 24px;
    right: 24px;
    z-index: 999;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
    overflow: hidden;
}

.results-box {
    list-style: none;
    margin: 0;
    padding: 0;
}

.results-box li {
    padding: 10px 18px;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f1f1;
}

.results-box li:last-child {
    border-bottom: none;
}

.results-box li:hover {
    background: #f5f7ff;
}

/* ── Back-to-top ── */
#arrow-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    z-index: 900;
    transition: box-shadow .2s;
}

#arrow-container:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

#arrow-container svg {
    fill: #333;
    width: 24px;
    height: 24px;
}

/* ── Legacy support: keep old classes working without the blue ── */
.thecontainer {
    background-color: transparent;
    padding: 0;
}

.top-row {
    display: flex;
    align-items: center;
}

.icons {
    margin-left: auto;
}

.icons a {
    margin-left: 10px;
    color: #222;
    text-decoration: none;
    font-size: 18px;
}

.bottom-row {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* keep icon SVG fill dark in header */
.icon svg {
    fill: #222;
    vertical-align: top;
    width: 32px;
    height: 32px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .site-header {
        --logo-height: 48px;
        --header-pad-y: 12px;
    }

    .site-header.is-compact {
        --logo-height: 37px;
        --header-pad-y: 10px;
    }
}

@media (max-width: 640px) {
    .site-header {
        --logo-height: 45px;
        --header-pad-y: 10px;
    }

    .site-header.is-compact {
        --logo-height: 35px;
        --header-pad-y: 8px;
    }

    .header-inner {
        gap: 8px;
        padding: var(--header-pad-y) 12px;
    }

    .header-icons {
        gap: 0;
    }

    /* The logo already links home, so free that space up for the logo */
    .header-icons .nav-home {
        display: none;
    }

    .header-icons a,
    .header-icons .search-toggle {
        width: 40px;
        height: 40px;
    }

    .header-icons a svg,
    .header-icons .search-toggle svg {
        width: 24px;
        height: 24px;
    }

    .search-panel-inner {
        padding: 10px 12px;
    }

    .search-results-wrap {
        left: 12px;
        right: 12px;
    }

    .trust-strip {
        font-size: 0.75rem;
    }

    .trust-ticker-group {
        gap: 2.5rem;
        padding-right: 2.5rem;
    }

    .trust-breadcrumb .trust-strip-inner {
        padding: 0 12px;
    }
}

@media (max-width: 380px) {
    .header-icons a,
    .header-icons .search-toggle {
        width: 36px;
        height: 36px;
    }
}
