/* © 2026 H.W. & H. Investments Pty Ltd. All rights reserved. */
/**
 * AYIO Sales — Search Results Styles
 *
 * Styles for the search results page: search header, sidebar filters,
 * listing cards (grid and list view), pagination, and responsive layout.
 */

/* ─── Utility: inline icon alignment ─── */
.icon-inline {
    vertical-align: -2px;
    margin-right: 4px;
}

/* ─── Search Page Heading ─── */
.search-page__heading {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy, #1a2332);
    margin: 0 0 1rem;
    line-height: 1.3;
}
@media (max-width: 600px) {
    .search-page__heading { font-size: 1.35rem; }
}

/* ─── Search Page Bar (top of search page) ─── */
.search-page__bar {
    margin-bottom: 1.5rem;
}

.search-page__bar-inner {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--white, #fff);
    border: 2px solid var(--grey-200, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.search-page__bar-inner:focus-within {
    border-color: var(--gold, #f0a500);
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.12);
}

.search-page__bar-icon {
    flex-shrink: 0;
    margin-left: 16px;
    color: var(--grey-400, #9ca3af);
}

.search-page__bar-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--navy, #0f1f3d);
    background: transparent;
}

.search-page__bar-input::placeholder {
    color: var(--grey-400, #9ca3af);
}

.search-page__bar-btn {
    flex-shrink: 0;
    border-radius: 0;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-left: 1px solid var(--grey-200, #e5e7eb);
}

@media (max-width: 600px) {
    .search-page__bar-inner {
        border-radius: 10px;
    }
    .search-page__bar-input {
        padding: 12px 12px;
        font-size: 15px;
    }
    .search-page__bar-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    .search-page__bar-icon {
        margin-left: 12px;
    }
}

/* ─── Search Page Layout ─── */
.search-page {
    padding-top: 24px;
    padding-bottom: 48px;
}

.search-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    align-items: start;
}

/* ─── Results Area ─── */
.search-results {
    background: var(--gray-50, var(--grey-50, #f9fafb));
    padding: 20px;
    min-height: 400px;
}

@media (max-width: 960px) {
    .search-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── Search Results Count (sort bar uses .search-sort-bar) ─── */
/* .search-header removed — no longer present in HTML */

.search-results-count {
    font-size: 15px;
    color: var(--grey-600, #4b5563);
    margin: 4px 0 0;
    font-weight: 500;
}

.search-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
}

.search-sort select {
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--grey-700);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* ─── View Toggle ─── */
.view-toggle {
    display: flex;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e4e7ec;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.view-btn:hover {
    border-color: #f0a500;
}

.view-btn-active {
    background: #0f1f3d;
    border-color: #0f1f3d;
    color: #f0a500;
}

.view-btn svg { width: 16px; height: 16px; }

/* ─── Mobile Filter Toggle ─── */
.mobile-filter-toggle {
    display: none;
    margin-bottom: 16px;
}

/* Active filter count badge on mobile toggle */
.mobile-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 960px) {
    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        width: 100%;
        padding: 14px 16px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        background: var(--gold, #f0a500);
        color: var(--navy, #0f1f3d);
        border: none;
        border-radius: 0;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        min-height: 52px;
        -webkit-tap-highlight-color: transparent;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15);
        margin-bottom: 0;
    }

    .mobile-filter-toggle .mobile-filter-count {
        background: var(--navy, #0f1f3d);
        color: var(--gold, #f0a500);
    }

    /* Add bottom padding to page so fixed button doesn't overlap content */
    .search-page {
        padding-bottom: 80px;
    }
}

/* ─── Sidebar ─── */
.search-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    width: 280px;
    min-width: 280px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-300) transparent;
    background: var(--white, #fff);
    border-radius: 0;
    padding: 0;
    border: none;
    border-right: 1px solid var(--gray-200, var(--grey-200, #e5e7eb));
    box-shadow: none;
}

/* Overlay behind sidebar drawer — hidden by default, only visible on mobile */
.search-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-sidebar-overlay.overlay-visible {
    display: block;
    opacity: 1;
}

@media (max-width: 960px) {
    .search-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 340px;
        bottom: 0;
        z-index: 1001;
        overflow-y: auto;
        border-radius: 0;
        border: none;
        border-right: none;
        padding: 56px 0 80px;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        background: var(--white, #fff);
    }

    .search-sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    /* Filter drawer header */
    .sidebar-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 340px;
        z-index: 1002;
        background: var(--white, #fff);
        border-bottom: 1px solid var(--grey-200, #e5e7eb);
        padding: 14px 20px;
        box-sizing: border-box;
    }

    .sidebar-drawer-title {
        font-size: 17px;
        font-weight: 700;
        color: var(--navy, #0f1f3d);
    }

    .sidebar-drawer-close {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--grey-500, #6b7280);
        cursor: pointer;
        padding: 8px 12px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        border-radius: 6px;
        transition: background 0.15s, color 0.15s;
        -webkit-tap-highlight-color: transparent;
    }

    .sidebar-drawer-close:hover {
        background: var(--grey-100, #f3f4f6);
        color: var(--grey-900, #111827);
    }

    /* Mobile Apply Filters — fixed at bottom of drawer */
    .filter-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 85%;
        max-width: 340px;
        padding: 12px 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        background: var(--white, #fff);
        border-top: 1px solid var(--grey-200, #e5e7eb);
        box-sizing: border-box;
        z-index: 1002;
    }

    .filter-actions .btn-full:first-child {
        background: var(--gold, #f0a500);
        color: var(--navy, #0f1f3d);
        font-weight: 700;
        font-size: 15px;
        padding: 14px;
        border-radius: 8px;
    }

    /* Larger touch targets for filter radios/checkboxes (44px minimum) */
    .filter-radio,
    .filter-checkbox {
        padding: 10px 0;
        min-height: 44px;
    }

    /* Results area: no side padding on mobile */
    .search-results {
        padding: 12px;
    }
}

@media (min-width: 961px) {
    .sidebar-drawer-header {
        display: none;
    }

    /* Desktop: filter actions are static inside sidebar */
    .filter-actions {
        position: static;
        width: auto;
        padding: 14px 20px;
        border-top: 1px solid var(--grey-200, #e5e7eb);
        background: none;
    }
}

/* ─── Sidebar Heading + Clear All ─── */
.filter-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--gray-200, var(--grey-200, #e5e7eb));
}
.filter-form-heading {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy, #0f1f3d);
    margin: 0;
}

/* ─── Clear All Filters Link (top of sidebar, right of heading) ─── */
.clear-filters-btn {
    display: inline;
    text-align: center;
    margin-bottom: 0;
    color: var(--gold, #f0a500);
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s;
    cursor: pointer;
}
.clear-filters-btn:hover {
    color: var(--color-danger, #dc2626);
    text-decoration: underline;
}

/* ─── Filter Groups ─── */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.filter-group {
    margin-bottom: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200, var(--grey-200, #e5e7eb));
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-group > label:first-child:not(.filter-radio):not(.filter-checkbox) {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-500, #6b7280);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-browse-link {
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    color: var(--brand-primary, #2563eb);
    text-decoration: none;
    letter-spacing: normal;
}
.filter-browse-link:hover { text-decoration: underline; }

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white, #fff);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--gold, #f0a500);
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.15);
}

/* ─── Filter Row (side-by-side inputs) ─── */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-row select,
.filter-row input {
    flex: 1;
    min-width: 0;
}

.filter-sep {
    color: var(--grey-500);
    font-size: 16px;
    flex-shrink: 0;
}

/* ─── Filter Radio / Checkbox ─── */
.filter-radio,
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--grey-800, #1f2937);
    padding: 5px 0;
    margin-bottom: 4px;
    cursor: pointer;
    font-weight: 400;
}

/* Custom radio button — gold dot */
.filter-radio input[type="radio"],
.filter-checkbox input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--grey-300, #d1d5db);
    border-radius: 50%;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s;
    background: var(--white, #fff);
}

.filter-radio input[type="radio"]:checked,
.filter-checkbox input[type="radio"]:checked {
    border-color: var(--gold, #f0a500);
}

.filter-radio input[type="radio"]:checked::after,
.filter-checkbox input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold, #f0a500);
}

.filter-radio input[type="radio"]:focus-visible,
.filter-checkbox input[type="radio"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.2);
}

/* Custom checkbox — gold check */
.filter-checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--grey-300, #d1d5db);
    border-radius: 4px;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--white, #fff);
}

.filter-checkbox input[type="checkbox"]:checked {
    border-color: var(--gold, #f0a500);
    background: var(--gold, #f0a500);
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.2);
}

.filter-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--grey-500);
    background: var(--grey-100);
    padding: 1px 6px;
    border-radius: 10px;
}

/* ─── Filter Actions ─── */
.filter-actions {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-full {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 12px;
}

.filter-actions .btn-full {
    background: var(--gold, #f0a500);
    color: var(--navy, #0f1f3d);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.filter-actions .btn-full:hover {
    background: #e09600;
}

/* Card styles live in listing-card.css (single source of truth) */

/* ─── Listing Grid ─── */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: stretch;
}

/* List view mode */
.listing-grid-list {
    grid-template-columns: 1fr;
    gap: 12px;
}

.listing-grid-list .listing-card {
    border-radius: var(--radius-lg);
    height: auto;
}

.listing-grid-list .listing-card__link {
    flex-direction: row;
}

.listing-grid-list .listing-card__image {
    width: 280px;
    height: auto;
    min-height: 180px;
    flex-shrink: 0;
    aspect-ratio: auto;
    padding-bottom: 0;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.listing-grid-list .listing-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-grid-list .listing-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.listing-grid-list .listing-card__specs-full {
    display: flex;
}

.listing-grid-list .listing-card__price {
    font-size: 1.5rem;
}

@media (max-width: 600px) {
    .listing-grid-list .listing-card__link {
        flex-direction: column;
    }
    .listing-grid-list .listing-card__image {
        width: 100%;
        min-width: 100%;
        height: 0;
        min-height: 0;
        padding-bottom: 56%;
        border-radius: 8px 8px 0 0;
    }
}

/* Compact view mode — smaller cards, tighter spacing, 4 columns */
.listing-grid-compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.listing-grid-compact .listing-card {
    border-radius: 8px;
}

.listing-grid-compact .listing-card__image { height: 150px; }
.listing-grid-compact .listing-card__title { font-size: 0.8125rem; -webkit-line-clamp: 1; min-height: 1.35em; max-height: 1.35em; }
.listing-grid-compact .listing-card__price { font-size: 1rem; }
.listing-grid-compact .listing-card__body { padding: 10px 12px 8px; }

.listing-grid-compact .listing-card__specs-full {
    font-size: 0.75rem;
    gap: 4px;
}

.listing-grid-compact .listing-card__footer {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

@media (max-width: 1024px) {
    .listing-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .listing-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .listing-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .listing-grid-compact .listing-card__body {
        padding: 0.5rem;
    }
}

/* Card / badge styles live in listing-card.css (single source of truth) */

/* ─── Active Filter Pills ─── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 12px;
    background: var(--gray-100, var(--grey-100, #f3f4f6));
    color: var(--grey-800, #1f2937);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.active-filter-pill .remove-filter {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15,31,61,0.1);
    font-size: 12px;
    cursor: pointer;
    border: none;
    color: var(--navy);
    transition: background 0.15s;
}

.active-filter-pill .remove-filter:hover {
    background: rgba(15,31,61,0.2);
}

.active-filter-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: var(--grey-500, #6b7280);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.active-filter-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    text-decoration: none;
}

.active-filter-clear {
    font-size: 13px;
    color: var(--brand-accent);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.active-filter-clear:hover {
    text-decoration: underline;
}

/* ─── Empty State (no results) ─── */
.search-empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--grey-600, #4b5563);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white, #fff);
    border-radius: 12px;
    border: 1px solid var(--grey-100, #f3f4f6);
    grid-column: 1 / -1;
}

.search-empty-state svg {
    margin-bottom: 24px;
    opacity: 0.35;
    color: var(--grey-400, #9ca3af);
}

.search-empty-state h3 {
    color: var(--grey-800, #1f2937);
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
}

.search-empty-state p {
    margin: 0 0 24px;
    font-size: 15px;
    max-width: 420px;
    line-height: 1.6;
    color: var(--grey-500, #6b7280);
}

.search-empty-state .btn {
    margin-bottom: 16px;
    min-width: 160px;
}

/* Legacy .no-results support */
.no-results {
    text-align: center;
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-results-icon {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 20px;
    opacity: 0.4;
}

.no-results h2 {
    font-size: 22px;
    color: var(--navy);
    margin: 0 0 10px;
    font-weight: 700;
}

.no-results p {
    color: var(--grey-600);
    margin: 0 0 28px;
    font-size: 15px;
    max-width: 420px;
    line-height: 1.6;
}

.no-results-suggestions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 32px 0 0;
    list-style: none;
    margin: 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--grey-900);
    text-decoration: none;
    background: var(--white);
    transition: background-color 0.15s, border-color 0.15s;
}

.pagination a:hover {
    background: var(--grey-50);
    border-color: var(--grey-300);
}

.pagination .pagination-current {
    background: var(--gold, #f0a500);
    color: #fff;
    border-color: var(--gold, #f0a500);
    font-weight: 600;
}

.pagination .pagination-ellipsis {
    border: none;
    background: none;
    color: var(--grey-500);
    min-width: auto;
    padding: 0 4px;
}

.pagination .pagination-prev,
.pagination .pagination-next {
    font-weight: 600;
    border: none;
    background: none;
    color: var(--grey-700, #374151);
    gap: 4px;
}

.pagination .pagination-prev:hover,
.pagination .pagination-next:hover {
    background: none;
    color: var(--gold, #f0a500);
    border: none;
}

/* ─── Responsive: Tablet ─── */
@media (max-width: 1024px) {
    .listing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

/* ─── Responsive: Mobile ─── */
@media (max-width: 600px) {

    .listing-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .view-toggle {
        display: none;
    }

    .active-filter-pill {
        font-size: 12px;
        padding: 3px 8px;
    }

    .pagination {
        padding-top: 24px;
        gap: 2px;
    }

    .pagination a,
    .pagination span {
        min-width: 40px;
        height: 40px;
        padding: 0 6px;
        font-size: 13px;
    }

}

/* ── 375px: iPhone SE fixes ── */
@media (max-width: 375px) {
    .listing-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Search bar: compact */
    .search-page__bar-input {
        padding: 10px;
        font-size: 15px;
    }

    .search-page__bar-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Pagination: compact at 375px */
    .pagination {
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
        padding: 0 4px;
    }

    /* Hide page numbers, keep prev/next/current */
    .pagination .pagination-page:not(.pagination-current) {
        display: none;
    }

    .pagination .pagination-ellipsis {
        display: none;
    }

    /* Sort bar: compact */
    .search-sort-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    .search-sort-bar .results-count {
        font-size: 13px;
    }

    .search-sort-bar select {
        font-size: 13px;
        padding: 6px 28px 6px 8px;
    }

    /* Active filter pills: compact */
    .active-filter-pill {
        font-size: 11px;
        padding: 2px 6px;
        gap: 4px;
    }

    /* List view: stack vertically at 375px */
    .listing-grid-list .listing-card__link {
        flex-direction: column;
    }

    .listing-grid-list .listing-card__image {
        width: 100%;
        min-width: 100%;
        height: 0;
        min-height: 0;
        padding-bottom: 56%;
        border-radius: 8px 8px 0 0;
    }

    /* Filter sidebar drawer: wider on small screens */
    .search-sidebar {
        width: 92%;
        max-width: 320px;
    }

}

@media (max-width: 480px) {
    .search-page {
        padding-top: 12px;
        padding-bottom: 32px;
    }



    .search-results-count {
        font-size: 13px;
    }

    .search-sort select {
        font-size: 13px;
        padding: 5px 8px;
    }

    .search-empty-state {
        padding: 40px 16px;
    }

    .search-empty-state h3 {
        font-size: 18px;
    }

    .search-empty-state p {
        font-size: 14px;
    }

    .no-results {
        padding: 40px 16px;
    }

    .no-results h2 {
        font-size: 18px;
    }

    .no-results p {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AJAX LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════════ */

.results-loading {
    position: relative;
    pointer-events: none;
}

.results-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

.results-loading::before {
    content: '';
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border: 3px solid var(--grey-200);
    border-top-color: var(--brand-primary, #f0a500);
    border-radius: 50%;
    animation: ajax-spin 0.6s linear infinite;
    z-index: 11;
}

@keyframes ajax-spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

.ajax-loading {
    opacity: 0.4;
    transition: opacity 0.2s;
}

/* Active filter remove/clear button overrides for AJAX mode */
.active-filters .active-filter-remove {
    cursor: pointer;
}

.active-filters .active-filter-clear {
    cursor: pointer;
}

/* ─── Save Search Button ─── */
.save-search-btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.save-search-btn:hover { background: var(--grey-50); border-color: var(--grey-400); }
.save-search-btn:disabled { opacity: 0.6; cursor: default; }

/* ─── Active Filter Tags (enhanced bar) ─── */
.active-filters-bar { display:flex; flex-wrap:wrap; gap:0.5rem; align-items:center; margin-bottom:1.5rem; padding:0.75rem 1rem; background:#f0f4f8; border-radius:8px; }
.active-filters-label { font-size:0.85rem; font-weight:600; color:#4a5568; margin-right:0.25rem; }
/* .filter-tag — consolidated into premium block below (line ~1067) */
.filter-tag-remove { font-size:1rem; line-height:1; font-weight:700; }

/* ─── Map View ─── */
.search-map { border:1px solid var(--grey-200); }

.search-map-container {
    width: 100%;
    height: 500px;
    min-height: 400px;
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: var(--grey-50, #f9fafb);
}

.search-map-container.mobile-fullscreen-map {
    position: fixed;
    inset: 0;
    z-index: 999;
    height: 100vh;
    min-height: 100vh;
    border: none;
    border-radius: 0;
}

.map-back-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 8px 16px;
    background: var(--white, #fff);
    color: var(--navy, #0f1f3d);
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.map-back-btn:hover {
    background: var(--grey-50, #f9fafb);
}

@media (max-width: 768px) {
    .search-map-container {
        height: 350px;
        min-height: 300px;
    }
}

/* ─── Mobile Filter Drawer (enhanced) ─── */
.filter-drawer-toggle { display:none; padding:0.6rem 1.2rem; background:#1a365d; color:#fff; border:none; border-radius:6px; font-size:0.9rem; cursor:pointer; margin-bottom:1rem; }
.filter-drawer-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:998; }
.filter-overlay-active { display:block; }

@media (max-width: 768px) {
    .filter-drawer-toggle { display:block; }
    .active-filters-bar { padding:0.5rem 0.75rem; margin-bottom:1rem; }
    .filter-tag { font-size:0.75rem; padding:0.25rem 0.5rem; }
}

/* ─── Premium filter sidebar (legacy compat) ─── */
.search-filters, .filter-sidebar {
    background: var(--white, #fff);
    border: none;
    border-right: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* ─── Collapsible filter groups ─── */
.filter-group > label.filter-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; }
.filter-group > label.filter-toggle::after { content: '\25B2'; font-size: 0.55rem; color: #94a3b8; transition: transform 0.25s ease; margin-left: 0.5rem; }
.filter-group.filter-collapsed > label.filter-toggle::after { transform: rotate(180deg); }
.filter-group.filter-collapsed > *:not(label:first-child) { display: none !important; }

/* Active filter tags — premium (overridden: clean gray pills) */
.active-filters-bar {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}
.filter-tag {
    background: var(--white);
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    color: var(--navy);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.15s;
}
.filter-tag:hover { border-color: var(--color-danger); color: var(--color-danger); box-shadow: 0 2px 6px rgba(239,68,68,0.15); }
.filter-tag-clear { background: var(--navy); color: #fff; border-color: var(--navy); }
.filter-tag-clear:hover { background: #0f1a2e; color: #fff; border-color: #0f1a2e; }

/* ─── Sort Bar (prominent bar above results) ─── */
.search-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--white, #fff);
    border-radius: 8px;
    border: 1px solid var(--grey-200, #e5e7eb);
}

.search-sort-bar .results-count {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy, #0f1f3d);
}

.search-sort-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-sort-bar select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--grey-300);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.search-sort-bar select:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(240,165,0,0.12);
}

@media (max-width: 600px) {
    .search-sort-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .search-sort-bar-right {
        width: 100%;
        justify-content: space-between;
    }
    .search-sort-bar .view-toggle {
        display: none;
    }
}

/* ─── Sort bar (premium) ─── */
.search-sort select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(240,165,0,0.12); }

/* ─── Skeleton Loading Cards ─── */
.skeleton-card {
    background: var(--white);
    border: 1px solid var(--grey-100);
    border-radius: 16px;
    overflow: hidden;
}
.skeleton-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e4e7ec;
    border-radius: 8px;
}
.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
    background: #e4e7ec;
}
.skeleton-line--title { width: 80%; }
.skeleton-line--subtitle { width: 50%; }
.skeleton-line--price { width: 40%; height: 20px; margin-bottom: 12px; }
.skeleton-line--meta { width: 90%; height: 12px; margin-bottom: 6px; }
.skeleton-line--meta-short { width: 60%; height: 12px; margin-bottom: 0; }
.skeleton-text {
    height: 14px;
    border-radius: 4px;
    margin: 12px 16px;
}
.skeleton-text-short { width: 60%; }
.skeleton-text-price { height: 20px; width: 40%; margin-top: 8px; }
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Map Popup Styles ─── */
.map-popup { min-width: 180px; }
.map-popup__img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}
.map-popup__title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 2px;
}
.map-popup__price {
    color: var(--gold, #f0a500);
    font-weight: 600;
}
.map-popup__location {
    font-size: 0.8rem;
    color: #64748b;
}
.map-popup__link {
    font-size: 0.85rem;
}

/* ─── Active filter pill remove animation ─── */
.active-filter-pill.removing {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s;
}

/* ─── Active Filter Chips ─── */
/* .active-filters — consolidated into main block above (line ~607) */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--grey-200);
    color: var(--navy);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}
.filter-chip:hover {
    background: #d0d8e8;
    color: var(--navy);
}
.filter-chip-x {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
}
.filter-chip:hover .filter-chip-x {
    opacity: 1;
}
.filter-chip--clear {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
}
.filter-chip--clear:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* ─── Price Input $ Prefix ─── */
.price-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.price-input-wrap::before {
    content: '$';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-600);
    font-weight: 600;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.price-input-wrap input {
    padding-left: 24px;
}

/* ─── Mobile Apply Filters Button ─── */
.mobile-apply-filters {
    display: none;
}

@media (max-width: 960px) {
    .mobile-apply-filters {
        display: block;
        margin-top: 12px;
        background: var(--brand-primary, #f0a500);
        color: var(--brand-secondary, #0f1f3d);
        font-weight: 700;
        font-size: 15px;
        padding: 14px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.15s;
    }
    .mobile-apply-filters:hover {
        background: #e5a000;
    }
}

/* Card styles live in listing-card.css (single source of truth) */

/* ═══════════════════════════════════════════════════════════════════════════════
   SEARCH PAGE VISUAL FIXES — 2026-03-18
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. SIDEBAR — premium polish ── */

/* Sidebar: subtle left-edge shadow for depth separation */
.search-sidebar {
    border-right-color: var(--grey-200, #e5e7eb);
}

/* Filter group hover: subtle highlight */
.filter-group:hover {
    background: var(--grey-50, #f9fafb);
}
.filter-group {
    transition: background 0.15s ease;
}

/* Radio/checkbox labels — tighter, more clickable */
.filter-radio,
.filter-checkbox {
    border-radius: 6px;
    padding: 6px 4px;
    margin-bottom: 2px;
    transition: background 0.12s;
}
.filter-radio:hover,
.filter-checkbox:hover {
    background: var(--grey-50, #f9fafb);
}

/* Custom radio — slightly larger hit area indicator */
.filter-radio input[type="radio"]:hover,
.filter-checkbox input[type="radio"]:hover {
    border-color: var(--gold, #f0a500);
}
.filter-checkbox input[type="checkbox"]:hover {
    border-color: var(--gold, #f0a500);
}

/* Select dropdowns in sidebar: better arrow positioning */
.filter-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ── 2. PRICE & YEAR RANGE ROWS ── */

/* Ensure price/year range inputs stay on one row and don't collapse */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.filter-row select,
.filter-row input[type="number"] {
    flex: 1;
    min-width: 0;
    max-width: none;
}
.price-input-wrap input[type="number"] {
    width: 100%;
    padding-left: 22px;
}

/* ── 3. RESULTS COUNT — prominent styling ── */
.search-sort-bar .results-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy, #0f1f3d);
    letter-spacing: -0.01em;
}
.search-sort-bar .results-count::before {
    display: none;
}

/* ── 4. CARD GRID — gap set in base .listing-grid rule above ── */

/* ── 5. PAGINATION — gold active page enhancement ── */
.pagination .pagination-current {
    background: var(--gold, #f0a500);
    color: var(--navy, #0f1f3d);
    border-color: var(--gold, #f0a500);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(240, 165, 0, 0.25);
}

.pagination a {
    font-weight: 500;
}

.pagination .pagination-prev,
.pagination .pagination-next {
    font-weight: 700;
    color: var(--navy, #0f1f3d);
}
.pagination .pagination-prev:hover,
.pagination .pagination-next:hover {
    color: var(--gold, #f0a500);
}

/* ── 6. RESULTS AREA — cleaner background ── */
.search-results {
    background: var(--grey-50, #f9fafb);
    border-radius: 0;
    padding: 24px;
}

/* ── 7. LOCATION ACTIVE TAG (inside search results) ── */
.location-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--grey-100, #f3f4f6);
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--navy, #0f1f3d);
    margin-bottom: 16px;
}
.location-active-tag svg {
    color: var(--gold, #f0a500);
    flex-shrink: 0;
}
.location-active-tag .tag-radius {
    color: var(--grey-500, #6b7280);
    font-weight: 400;
}
.location-active-tag .tag-clear {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--grey-400, #9ca3af);
    cursor: pointer;
    padding: 0 0 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.location-active-tag .tag-clear:hover {
    color: #dc2626;
}

/* ── 8. LOCATION INPUT ROW (search sidebar) ── */
.location-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.location-input-row input[type="text"] {
    flex: 1;
    min-width: 0;
}
.near-me-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 6px;
    background: var(--white, #fff);
    color: var(--grey-500, #6b7280);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.near-me-btn:hover {
    border-color: var(--gold, #f0a500);
    color: var(--gold, #f0a500);
    background: rgba(240, 165, 0, 0.05);
}

/* ── 9. RADIUS PILLS ── */
.radius-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.radius-pill {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--grey-200, #e5e7eb);
    border-radius: 20px;
    background: var(--white, #fff);
    color: var(--grey-700, #374151);
    cursor: pointer;
    transition: all 0.15s;
}
.radius-pill:hover {
    border-color: var(--gold, #f0a500);
    color: var(--gold, #f0a500);
}
.radius-pill.active {
    background: var(--gold, #f0a500);
    color: var(--navy, #0f1f3d);
    border-color: var(--gold, #f0a500);
    font-weight: 700;
}

/* ── 10. AUTOCOMPLETE RESULTS ── */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white, #fff);
    border: 1px solid var(--grey-200, #e5e7eb);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
}
.autocomplete-results .autocomplete-item {
    padding: 10px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.autocomplete-results .autocomplete-item:hover {
    background: var(--grey-50, #f9fafb);
}
.location-autocomplete-wrap {
    position: relative;
}

/* ── 11. SORT BAR — tighter mobile ── */
@media (max-width: 960px) {
    .search-sort-bar {
        padding: 10px 12px;
    }
    .search-sort-bar .results-count {
        font-size: 14px;
    }
}

/* ── 12. CARD GRID — responsive gap adjustments ── */
@media (max-width: 1024px) {
    .listing-grid {
        gap: 18px;
    }
}
@media (max-width: 600px) {
    .listing-grid {
        gap: 14px;
    }
    .search-results {
        padding: 14px;
    }
}

/* ── 13. DESKTOP SIDEBAR + RESULTS spacing ── */
@media (min-width: 961px) {
    .search-layout {
        gap: 0;
    }
    .search-results {
        padding: 24px;
    }
}

/* ── 14. FILTER ACTIONS — desktop alignment fix ── */
@media (min-width: 961px) {
    .filter-actions {
        padding: 16px 20px;
        gap: 8px;
    }
    .filter-actions .btn-full:first-child {
        background: var(--gold, #f0a500);
        color: var(--navy, #0f1f3d);
        font-weight: 700;
        border: none;
        border-radius: 8px;
        padding: 12px;
        cursor: pointer;
        transition: background 0.15s;
    }
    .filter-actions .btn-full:first-child:hover {
        background: #e09600;
    }
    .filter-actions .btn-ghost {
        background: transparent;
        color: var(--grey-500, #6b7280);
        border: 1px solid var(--grey-200, #e5e7eb);
        border-radius: 8px;
        padding: 10px;
        cursor: pointer;
        font-size: 13px;
        transition: all 0.15s;
    }
    .filter-actions .btn-ghost:hover {
        border-color: var(--grey-400);
        color: var(--navy, #0f1f3d);
    }
}

/* ── 15. NO-RESULTS SUGGESTIONS ── */
.no-results-suggestions {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 0;
}

/* ── 16. MOBILE BOTTOM SAFE AREA ── */
@media (max-width: 960px) {
    .search-page {
        padding-bottom: 72px;
    }
}

