/* Search page — styles adapted from collection-listing-page */

.search-page {
    font-family: "sofia-pro", sans-serif;
}

/* ── Page header ─────────────────────────────────────────────────── */

.search-page h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a324e;
    margin: 24px 0 4px;
    text-transform: none;
    font-family: "sofia-pro", sans-serif;
}

.search-page .result-count {
    color: #7392b5;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

/* ── Shell grid ──────────────────────────────────────────────────── */

.search-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px;
    align-items: flex-start;
}

/* No results means no sidebar, so give the empty state the full width and let it
   centre itself instead of sitting in the narrow results column. */
.search-shell--empty {
    grid-template-columns: minmax(0, 1fr);
}

/* ── Filter sidebar ──────────────────────────────────────────────── */

.filter-sidebar {
    padding-right: 14px;
    border-right: none;
    position: relative;
    z-index: 3;
}

.filter-sidebar .filterTitle {
    color: #1a324e;
    border-bottom: solid 2px #dddddd;
    border-right: none;
    float: none;
    height: auto;
    padding: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 8px;
    text-transform: none;
}

.filter-sidebar .filter-sidebar-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.filter-sidebar .filter-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.filter-sidebar .filter-title-label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
}

.filter-sidebar .filterCount {
    font-size: 0.875rem;
    font-weight: 400;
}

.filter-sidebar .sidebar-clear-all {
    font-size: 1rem;
    line-height: 1.2;
}

.filter-sidebar .filter-sections {
    margin-top: 0;
}

.filter-sidebar .filter-section {
    border-bottom: solid 1px #dddddd;
}

.filter-sidebar .filter-section-toggle {
    width: 100%;
    background: transparent;
    border: none;
    color: #000;
    box-shadow: none;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 400;
    font-family: "sofia-pro", sans-serif;
    text-align: left;
    text-transform: none;
    position: relative;
    cursor: pointer;
}

.filter-sidebar .filter-section-toggle::after {
    content: '';
    border-bottom: solid 2px #000;
    height: 4px;
    width: 12px;
    position: absolute;
    right: 0;
    top: 47%;
    transform: translateY(-50%);
    flex-shrink: 0;
}

.filter-sidebar .filter-section-toggle.collapsed::before {
    content: '';
    border-left: solid 2px #000;
    height: 12px;
    width: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}

.filter-sidebar .filter-section-body {
    display: none;
    padding: 0 0 10px;
}

.filter-sidebar .filter-section.is-open .filter-section-body {
    display: block;
}

.filter-sidebar .filter-section-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.filter-sidebar .filter-section-body li {
    margin: 0 0 6px;
}

.filter-sidebar .filter-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #1f1f1f;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 400;
    margin: 0;
}

.filter-sidebar .filter-option-label.is-selected {
    font-weight: 600;
}

.filter-sidebar .filter-option-label input[type="checkbox"] {
    margin: 0;
    accent-color: #3c96cb;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

.filter-sidebar .no-filters-selected {
    display: none;
}

.filter-sidebar .clear-all-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: #7392b5;
    text-decoration: none;
}

.filter-sidebar .clear-all-link:hover {
    text-decoration: underline;
}

/* ── Toolbar (sort + count) ──────────────────────────────────────── */

.search-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: #555;
}

.search-toolbar select {
    font-size: 0.875rem;
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: "sofia-pro", sans-serif;
}

.search-toolbar .toolbar-selects {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Product grid ────────────────────────────────────────────────── */

.search-products .productList {
    margin-left: -12px;
    margin-right: -12px;
}

.search-products .productBlock {
    padding: 12px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 0;
}

.search-products .productBlock .icons {
    position: absolute;
    right: 20px;
    top: 16px;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* The bordered box. Carries the card chrome that used to live on the <a>, so the main link
   and the swatch links can both sit inside it as siblings. */
.search-products .productBlock .product-card {
    position: relative;
    background: transparent;
    display: flex;
    flex: 1;
    flex-flow: column;
    min-height: 200px;
    padding: 6px 8px 12px;
    border: solid 1px #e7e9ec;
    box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.1);
}

.search-products .productBlock .product-card-main {
    position: relative;
    display: flex;
    flex: 1;
    flex-flow: column;
    color: black;
    text-decoration: none;
}

.search-products .productBlock .product-card::before {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: "";
    background: rgba(252, 186, 64, 0.3);
    z-index: 1;
}

.search-products .productBlock .product-card::after {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    content: "";
    background: #fff;
    z-index: 1;
    transition: all 0.2s ease;
}

.search-products .productBlock .product-card:hover {
    text-decoration: none;
    box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.1);
    border-color: rgba(252, 186, 64, 0.3);
}

.search-products .productBlock .product-card:hover::after {
    top: 3px;
    left: 3px;
    width: calc(100% - 6px);
    height: calc(100% - 6px);
}

.search-products .productBlock .product-card-main img {
    max-width: 145px;
    width: auto;
    height: auto;
    position: relative;
    z-index: 500;
    margin: 3px auto 10px;
}

.search-products .productBlock .product-card-main > div:first-of-type {
    position: relative;
    z-index: 500;
    font-size: 1rem;
    font-weight: 600;
    color: black;
    margin-bottom: 4px;
}

.search-products .productBlock .product-card-main div {
    text-align: center;
    font-size: 0.875rem;
    position: relative;
    z-index: 500;
}

.search-products .productBlock .product-card-main div:last-child {
    font-size: 1rem;
    font-weight: 600;
    color: #1f1f1f;
}

/* ── Metal colour swatches ───────────────────────────────────────── */
/* 2021.css carries "main .row.productList .productBlock a" - specificity (0,3,2) - which
   styles EVERY anchor in a product block as though it were the card itself: flex:1, border,
   shadow, and ::before/::after overlay panels. (The collection listing has the same problem
   via an "#category ..." variant of the rule.)
   The .search-page prefix here takes these to (0,4,1), which outranks it. Drop that prefix
   and the swatches silently stretch into full-width bars again. */

.search-page .search-products .productBlock .product-swatches {
    /* z-index clears the card's ::after hover overlay (z-index 1), the same trick the
       card's own text uses. */
    position: relative;
    z-index: 500;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
}

.search-page .search-products .productBlock a.product-swatch {
    display: inline-block;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    padding: 0;
    min-height: 0;
    border-radius: 50%;
    /* No inset ring - at 16px it eats a quarter of the radius and the dots read as donuts. */
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow: none;
    transition: transform .12s ease, box-shadow .12s ease;
}

.search-page .search-products .productBlock a.product-swatch:hover,
.search-page .search-products .productBlock a.product-swatch:focus-visible {
    transform: scale(1.18);
    box-shadow: 0 0 0 2px #215ea4;
    outline: none;
}

/* The main card link is an <a> too, so it inherits the same card chrome from 2021.css and
   ends up drawing a second border inside .product-card. Opt both anchors out.

   The :hover variant is listed separately and is not redundant: 2021.css also has
   "main ... .productBlock a:hover { box-shadow: ... }" at (0,4,2), which outranks the
   plain selector below at (0,4,1). Without the :hover form the inner link grows its own
   glow on hover and the card appears to have a second box inside it. */
.search-page .search-products .productBlock a.product-card-main,
.search-page .search-products .productBlock a.product-card-main:hover {
    border: 0;
    box-shadow: none;
    padding-bottom: 0;
}

.search-page .search-products .productBlock a.product-card-main::before,
.search-page .search-products .productBlock a.product-card-main::after,
.search-page .search-products .productBlock a.product-swatch::before,
.search-page .search-products .productBlock a.product-swatch::after {
    display: none;
    content: none;
}

/* ── Pagination ──────────────────────────────────────────────────── */

.search-pagination {
    margin-top: 22px;
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.search-pagination a {
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #3485ba;
    min-width: 38px;
    padding: 6px 10px;
    border-radius: 0;
    margin-left: -1px;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-block;
    text-align: center;
}

.search-pagination a:first-child {
    margin-left: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.search-pagination a:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.search-pagination a.is-active {
    color: #fff;
    background-color: #3485ba;
    border-color: #3485ba;
}

.search-pagination a:hover:not(.is-active) {
    color: #215ea4;
    background-color: rgba(50, 122, 175, 0.3);
    border-color: #dee2e6;
}

/* Button variant (used by collection listing JS-driven pagination) */
.search-pagination button {
    border: 1px solid #dee2e6;
    background-color: #fff;
    color: #3485ba;
    min-width: 38px;
    padding: 6px 10px;
    border-radius: 0;
    margin-left: -1px;
    font-size: 0.875rem;
    font-family: "sofia-pro", sans-serif;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    line-height: 1.4;
}

.search-pagination button:first-child {
    margin-left: 0;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.search-pagination button:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.search-pagination button.is-active {
    color: #fff;
    background-color: #3485ba;
    border-color: #3485ba;
}

.search-pagination button:hover:not([disabled]):not(.is-active) {
    color: #215ea4;
    background-color: rgba(50, 122, 175, 0.3);
    border-color: #dee2e6;
}

.search-pagination button[disabled] {
    background: #f8f9fa;
    color: #adb5bd;
    cursor: default;
}

@media (max-width: 767px) {
    .search-pagination {
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

/* ── Active filter chips ─────────────────────────────────────────── */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a324e;
    color: #fff;
    border-radius: 100px;
    padding: 5px 10px 5px 13px;
    font-size: 13px;
    font-family: "sofia-pro", sans-serif;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .15s ease;
}

.filter-chip:hover {
    background: #3485ba;
    color: #fff;
    text-decoration: none;
}

.filter-chip span {
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
}

.filter-chip-clear {
    background: transparent;
    color: #555;
    border: 1px solid #c8cdd3;
    padding: 4px 10px 4px 13px;
}

.filter-chip-clear:hover {
    background: #f0f2f4;
    color: #333;
    border-color: #999;
}

/* ── Mobile filter toolbar ───────────────────────────────────────── */

.mobile-filter-toolbar {
    display: none;
    align-items: center;
    gap: 10px;
}

.mobile-results-count {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    color: #555;
    white-space: nowrap;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: "sofia-pro", sans-serif;
    color: #1f1f1f;
    cursor: pointer;
    line-height: 1.25;
}

.filter-count-badge {
    display: inline-block;
    background: #1a324e;
    color: #fff;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    line-height: 1.5;
    min-width: 20px;
    text-align: center;
}

.filter-count-badge[data-count="0"] {
    display: none;
}

.mobile-sort-select {
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: #fff;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.9375rem;
    font-family: "sofia-pro", sans-serif;
    color: #1f1f1f;
    line-height: 1.25;
    cursor: pointer;
}

/* ── Filter drawer / bottom sheet ────────────────────────────────── */

.filter-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4990;
    background: rgba(16, 24, 40, 0.45);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

.filter-drag-handle {
    display: none;
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 14px;
}

.filter-mobile-footer {
    display: none;
}

.filter-close-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #1f1f1f;
    cursor: pointer;
    padding: 0 2px;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 991px) {
    body.filter-no-scroll {
        overflow: hidden;
    }

    .mobile-filter-toolbar {
        display: flex;
        position: sticky;
        top: 100px; /* below fixed site header */
        background: #fff;
        z-index: 200;
        padding: 8px 0;
        border-bottom: 1px solid #eeeff1;
        margin-bottom: 12px;
    }

    .search-shell {
        display: block;
    }

    .filter-sidebar .filterTitle {
        border-bottom: 1px solid #d8dfe8;
        padding: 10px 0 12px;
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .filter-sidebar .filter-section {
        border-bottom: 1px solid #d8dfe8;
    }

    /* Desktop toolbar hidden on mobile — controls are in the mobile toolbar */
    .search-toolbar {
        display: none;
    }

    /* Bottom-sheet drawer */
    .filter-drawer {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-height: 88dvh;
        border-radius: 20px 20px 0 0;
        padding: 14px 18px 0 !important;
        transform: translateY(110%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        overflow-y: auto;
        z-index: 5000;
        border: none !important;
        box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.14);
        background: #fff;
    }

    .filter-panel-open .filter-drawer {
        transform: translateY(0);
    }

    .filter-panel-open .filter-backdrop {
        display: block;
    }

    .filter-drag-handle {
        display: block;
    }

    .filter-close-btn {
        display: block;
    }

    .filter-mobile-footer {
        display: block;
        position: sticky;
        bottom: 0;
        background: #fff;
        border-top: 1px solid #e5e7eb;
        padding: 12px 0 calc(14px + env(safe-area-inset-bottom));
        margin-top: 8px;
    }

    .filter-apply-btn {
        display: block;
        width: 100%;
        padding: 13px 14px;
        background: #1a324e;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 1rem;
        font-weight: 600;
        font-family: "sofia-pro", sans-serif;
        cursor: pointer;
        line-height: 1.2;
    }

    .filter-apply-btn:hover {
        background: #14273d;
    }

    .filter-clear-btn {
        display: block;
        width: 100%;
        padding: 9px 4px 2px;
        background: transparent;
        border: none;
        font-size: 0.95rem;
        font-weight: 500;
        font-family: "sofia-pro", sans-serif;
        color: #444;
        text-align: center;
        cursor: pointer;
        line-height: 1.3;
    }

    .filter-clear-btn[disabled] {
        color: #aab0b9;
        cursor: default;
    }
}

/* ── Corrected terms + empty results ─────────────────────────────── */

.search-page .search-corrected {
    color: #5b6b7c;
    font-size: 0.95rem;
    margin: 0 0 18px;
}

.search-page .search-corrected strong { color: #1a324e; }

.search-page .search-empty {
    max-width: 560px;
    margin: 8px auto 56px;
    padding: 40px 24px;
    text-align: center;
    color: #5b6b7c;
}

.search-page .search-empty-icon {
    width: 44px;
    height: 44px;
    stroke: #c3ccd7;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    margin-bottom: 18px;
}

.search-page .search-empty-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a324e;
    margin: 0 0 8px;
    text-transform: none;
    line-height: 1.3;
}

.search-page .search-empty-lede {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.search-page .search-empty-cta {
    display: inline-block;
    background: #1a324e;
    color: #fff;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background .2s ease;
}

.search-page .search-empty-cta:hover { background: #215ea4; color: #fff; }

/* Did you mean - a real list, not chips: the result count is the point, and it needs room */
.search-page .search-suggestions {
    margin: 28px 0 0;
    text-align: left;
}

.search-page .search-suggestions h3 {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8ba0b4;
    margin: 0 0 10px;
    text-align: center;
}

.search-page .search-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e7ebf0;
}

.search-page .search-suggestions li { border-bottom: 1px solid #e7ebf0; }

.search-page .search-suggestions a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 6px;
    text-decoration: none;
    color: #1a324e;
    transition: background .15s ease, padding-left .15s ease;
}

.search-page .search-suggestions a:hover {
    background: #f6f8fa;
    padding-left: 12px;
}

.search-page .search-suggestions .term {
    font-weight: 600;
    font-size: 1rem;
}

.search-page .search-suggestions .count {
    font-size: 0.85rem;
    color: #8ba0b4;
    white-space: nowrap;
}

.search-page .search-empty-browse { margin-top: 32px; }

.search-page .search-empty-browse > span {
    display: block;
    font-size: 0.8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8ba0b4;
    margin-bottom: 12px;
}

.search-page .search-empty-browse ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.search-page .search-empty-browse a {
    display: inline-block;
    border: 1px solid #d8dfe8;
    border-radius: 30px;
    padding: 7px 16px;
    font-size: 0.875rem;
    color: #1a324e;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease;
}

.search-page .search-empty-browse a:hover { border-color: #215ea4; color: #215ea4; }

@media (max-width: 575px) {
    .search-page .search-empty { padding: 28px 12px; }
    .search-page .search-suggestions a { padding: 12px 4px; }
}