/* ================================
   Browse Listings Page Styles — v11
   ================================ */

/* ── Main Container ── */
.browse-page {
    margin-top: 110px;
    min-height: 100vh;
    background: #ffffff;
    padding: 3rem 0;
    position: relative;
}

.browse-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.8) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(248, 249, 250, 0.6) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Skeleton Loading Shimmers ── */
.skeleton {
    background: #f0f2f5;
    background: linear-gradient(110deg, #f0f2f5 8%, #f8f9fa 18%, #f0f2f5 33%);
    border-radius: 12px;
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.skeleton-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    height: 400px;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.skeleton-image {
    height: 220px;
    width: 100%;
}

.skeleton-content {
    padding: 1.25rem;
}

.skeleton-line {
    height: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }

.skeleton-title {
    height: 18px;
    margin-bottom: 12px;
    width: 90%;
    border-radius: 4px;
}

/* Carousel Section Styles */
.carousel-section {
    margin-bottom: 3.5rem;
}

.carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.carousel-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.carousel-container {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1.5rem;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
}

.carousel-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.carousel-item {
    flex: 0 0 320px;
    transition: transform 0.3s ease;
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.carousel-nav {
    display: flex;
    gap: 0.75rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(74, 144, 226, 0.2);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a90e2;
}

.nav-btn:hover {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(0);
}

.browse-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* ── Page Header ── */
.browse-header {
    margin-bottom: 2rem;
}

.breadcrumbs {
    font-size: 0.875rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.breadcrumbs a {
    color: #4a90e2;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

#pageTitle {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
}

/* ── Search & Action Bar ── */
.search-action-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.search-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    width: 20px;
    height: 20px;
    color: #666;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(229, 221, 213, 0.5);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #2C2C2C;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.search-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.mobile-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.filter-toggle-btn,
.sort-container-mobile {
    flex: 1;
    display: flex;
}

.filter-toggle-btn,
.sort-select {
    width: 100%;
    height: 3.25rem;
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(229, 221, 213, 0.5);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2C2C2C;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    position: relative;
}

.sort-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23666666' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

.filter-toggle-btn:hover,
.sort-select:hover {
    border-color: #4a90e2;
    background: #fff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.filter-icon {
    width: 18px;
    height: 18px;
    color: #666;
}

/* Filter count badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-left: 2px;
}

@media (min-width: 769px) {
    .search-action-bar {
        flex-direction: row;
        align-items: stretch;
    }

    .mobile-actions {
        width: auto;
        flex: 0 0 220px;
    }

    .filter-toggle-btn {
        display: none !important;
    }
}

/* ── Browse Content Layout ── */
.browse-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* ═══════════════════════════════
   FILTERS SIDEBAR
═══════════════════════════════ */
.filters-sidebar {
    position: relative;
}

.filters-panel {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 16px;
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: 140px;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.12);
}

/* Backdrop (mobile only) */
.filters-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(229, 221, 213, 0.3);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

.filters-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-filters-btn {
    display: none;
    background: none;
    border: none;
    color: #666;
    padding: 0.25rem;
    cursor: pointer;
    transition: color 0.3s ease;
    border-radius: 6px;
}

.close-filters-btn:hover {
    color: #ef4444;
}

.close-filters-btn svg {
    width: 22px;
    height: 22px;
}

.filters-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.filters-scroll-area {
    padding: 1.25rem 1.5rem;
}

.filters-footer-mobile {
    display: none;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(229, 221, 213, 0.3);
}

.clear-filters {
    background: none;
    border: none;
    color: #4a90e2;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: rgba(74, 144, 226, 0.08);
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(229, 221, 213, 0.25);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #555;
    margin: 0 0 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ── Search Scope Selector ── */
.scope-selector {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.scope-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1.5px solid rgba(229, 221, 213, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scope-option:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(74, 144, 226, 0.3);
    transform: translateX(4px);
}

.scope-option.active {
    background: white;
    border-color: #4a90e2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.12);
}

.scope-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(74, 144, 226, 0.05);
    border-radius: 8px;
}

.scope-option.active .scope-icon {
    background: rgba(74, 144, 226, 0.1);
}

.scope-info {
    display: flex;
    flex-direction: column;
}

.scope-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a1a;
}

.scope-desc {
    font-size: 0.75rem;
    color: #888;
}

.scope-option.active .scope-name {
    color: #4a90e2;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.2rem 0;
    line-height: 1.5;
}

.filter-checkbox:hover {
    color: #4a90e2;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.filter-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(229, 221, 213, 0.6);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Price Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-input {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(229, 221, 213, 0.6);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.price-input::placeholder {
    color: #bbb;
    font-weight: 400;
}

.price-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.price-separator {
    color: #999;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── Radius Slider ── */
.radius-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radius-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.radius-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #444;
}

.radius-label strong {
    color: #4a90e2;
}

.radius-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 5px;
    background: linear-gradient(to right, #4a90e2 0%, #4a90e2 0%, #e0e7ef 0%);
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
}

.radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
    transition: transform 0.2s;
}

.radius-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.radius-ticks {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: #aaa;
}

/* ═══════════════════════════════
   LISTINGS SECTION
═══════════════════════════════ */
.listings-section {
    min-height: 500px;
}

/* Toolbar */
.listings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.results-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
}

.results-count strong {
    color: #1a1a1a;
}

/* Save Search Button - Luxury Aesthetic */
.save-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1.5px solid rgba(74, 144, 226, 0.25);
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.save-search-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

.save-search-btn:hover {
    background: #f8fbff;
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.save-search-btn:active {
    transform: translateY(0);
}

/* Saved Searches Dropdown */
.saved-searches-wrapper {
    position: relative;
    display: flex;
}

.saved-searches-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.875rem;
    background: rgba(74, 144, 226, 0.08);
    border: 1.5px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.25s ease;
}

.saved-searches-btn svg {
    width: 14px;
    height: 14px;
}

.saved-searches-btn:hover {
    background: rgba(74, 144, 226, 0.15);
}

.saved-count-badge {
    background: #4a90e2;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.saved-searches-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 250px;
    background: white;
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
    animation: dropdownAppear 0.2s ease;
}

.saved-searches-dropdown.open {
    display: block;
}

@keyframes dropdownAppear {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saved-searches-list {
    padding: 0.5rem;
}

.saved-searches-empty {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #999;
}

.saved-search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    transition: background 0.2s;
}

.saved-search-item:hover {
    background: rgba(74, 144, 226, 0.05);
}

.saved-search-name {
    flex: 1;
    background: none;
    border: none;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-search-name:hover {
    color: #4a90e2;
}

.saved-search-delete {
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    color: #bbb;
    transition: color 0.2s;
    flex-shrink: 0;
}

.saved-search-delete:hover {
    color: #ef4444;
}

.saved-search-delete svg {
    width: 14px;
    height: 14px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(229, 221, 213, 0.5);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn svg {
    width: 18px;
    height: 18px;
    color: #888;
}

.view-btn:hover {
    border-color: #4a90e2;
}

.view-btn.active {
    background: #4a90e2;
    border-color: #4a90e2;
}

.view-btn.active svg {
    color: white;
}

/* ── Active Filter Chips ── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    background: rgba(74, 144, 226, 0.08);
    border: 1.5px solid rgba(74, 144, 226, 0.25);
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #4a90e2;
    animation: chipAppear 0.2s ease;
}

@keyframes chipAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.filter-chip button {
    background: none;
    border: none;
    color: #4a90e2;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.filter-chip button:hover {
    opacity: 1;
}

.filter-chip button svg {
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════
   FEATURED SECTION
═══════════════════════════════ */
.featured-section {
    margin-bottom: 2.5rem;
}

.featured-section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.featured-section-icon {
    font-size: 1.25rem;
}

.featured-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* ── Featured Row — Horizontal Scrollable Strip (Option A) ── */
.featured-row {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.25rem 0.25rem 1.25rem;
    scrollbar-width: none;
    border-bottom: 2px solid rgba(245, 158, 11, 0.15);
    margin-bottom: 1.25rem;
}
.featured-row::-webkit-scrollbar { display: none; }
.featured-row .listing-card {
    flex: 0 0 300px;
    width: 300px;
}

/* ═══════════════════════════════
   LISTINGS GRID
═══════════════════════════════ */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.listings-grid.list-view {
    grid-template-columns: 1fr;
}

/* ═══════════════════════════════
   LISTING CARD
═══════════════════════════════ */
@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.listing-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(229, 221, 213, 0.4);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    animation: cardAppear 0.4s ease both;
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.13);
    border-color: rgba(74, 144, 226, 0.5);
}

/* Featured card — gold shimmer */
.listing-card.featured-card {
    border: 2px solid transparent;
    background:
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #f59e0b, #f97316, #eab308) border-box;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

.listing-card.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(245, 158, 11, 0.25);
}

/* ── Image Wrapper ── */
.listing-image-wrap {
    position: relative;
    overflow: hidden;
}

.listing-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: linear-gradient(135deg, #E8DDD3, #F2EBE3);
    transition: transform 0.5s ease, opacity 0.15s ease;
}

.listing-card:hover .listing-image {
    transform: scale(1.06);
}

/* ── Badges ── */
.listing-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
}

.badge {
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(6px);
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.badge-new {
    background: rgba(74, 144, 226, 0.9);
    color: white;
}

.badge-urgent {
    background: linear-gradient(135deg, #ef4444, #ff4757);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.badge-bumped {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* ── Condition Badge ── */
.condition-badge {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    z-index: 2;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ── Quick View Button ── */
.quick-view-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.88) 0%, transparent 100%);
    color: white;
    border: none;
    padding: 1.5rem 1rem 0.625rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    z-index: 3;
}

.quick-view-btn svg {
    width: 16px;
    height: 16px;
}

.listing-card:hover .quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

/* ── Favorite Button ── */
.listing-card-favorite-btn {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(229, 221, 213, 0.3);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 4;
}

.listing-card-favorite-btn:hover {
    background: white;
    transform: scale(1.12);
    border-color: #ff4757;
}

.listing-card-favorite-btn svg {
    width: 18px;
    height: 18px;
    color: #999;
    transition: all 0.3s ease;
}

.listing-card-favorite-btn.favorited {
    background: rgba(255, 71, 87, 0.1);
    border-color: #ff4757;
}

.listing-card-favorite-btn.favorited svg {
    color: #ff4757;
    fill: #ff4757;
    stroke: #ff4757;
}

.listing-card-favorite-btn:hover svg {
    color: #ff4757;
}

/* ── Image Gallery Arrows ── */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-prev {
    left: 0.5rem;
}

.gallery-next {
    right: 2.75rem;
}

.listing-card:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

/* ── Gallery Dots ── */
.gallery-dots {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s;
}

.listing-card:hover .gallery-dots {
    opacity: 1;
}

.gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
    cursor: pointer;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ── Card Info ── */
.listing-info {
    padding: 1.125rem;
}

.listing-category {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2F5D3A;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.375rem;
}

.listing-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111;
    margin: 0 0 0.375rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-price {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2F5D3A;
    margin: 0.5rem 0;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    color: #555;
    margin-bottom: 0.625rem;
    flex-wrap: wrap;
}

.listing-location svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.location-distance {
    color: #2F5D3A;
    font-weight: 600;
}

.listing-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.625rem;
    border-top: 1px solid rgba(229, 221, 213, 0.3);
}

.listing-seller {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.seller-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.seller-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #555;
    font-weight: 500;
}

.verified-badge {
    color: #4a90e2;
}

.verified-badge svg {
    width: 13px;
    height: 13px;
}

.listing-time {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #aaa;
}

/* ── List View (Refined & Balanced) ── */
.listings-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.listings-grid.list-view .listing-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 210px; /* Fix: min-height so long content never clips */
}

/* Ensure images cover correctly within the fixed height */
.listings-grid.list-view .listing-image-wrap {
    height: 230px; /* Fixed — prevents portrait photos from stretching card */
    overflow: hidden;
}

.listings-grid.list-view .listing-image {
    width: 100%;
    height: 230px;
    object-fit: cover;
}

.listings-grid.list-view .listing-info {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
    gap: 0.15rem;
}

/* Description snippet — hidden in grid, visible in list view */
.listing-description-snippet {
    display: none;
}
.listings-grid.list-view .listing-description-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.45;
    margin: 0.1rem 0 0.25rem;
    max-width: 560px;
}

/* Quick View: always-visible inline button in list mode */
.listings-grid.list-view .quick-view-btn {
    position: static;
    opacity: 1;
    transform: none;
    background: rgba(74, 144, 226, 0.08);
    color: #4a90e2;
    border: 1.5px solid rgba(74, 144, 226, 0.25);
    border-radius: 8px;
    padding: 0.3rem 0.85rem;
    font-size: 0.78rem;
    align-self: flex-start;
    margin-top: 0.35rem;
    width: auto;
    left: unset; right: unset; bottom: unset;
    transition: background 0.2s, color 0.2s;
}
.listings-grid.list-view .quick-view-btn:hover {
    background: #4a90e2;
    color: #fff;
}

/* Push meta row to bottom */
.listings-grid.list-view .listing-meta {
    margin-top: auto;
    padding-top: 0.6rem;
}

.listings-grid.list-view .listing-title {
    font-size: 1.15rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.listings-grid.list-view .listing-price {
    margin: 0.1rem 0;
}

/* Mobile Adjustments for List View */
@media (max-width: 768px) {
    .listings-grid.list-view .listing-card {
        grid-template-columns: 140px 1fr;
        height: 150px;
    }
    
    .listings-grid.list-view .listing-info {
        padding: 0.75rem 1rem;
        gap: 0.25rem;
    }

    .listings-grid.list-view .listing-title {
        font-size: 0.95rem;
    }
    
    .listings-grid.list-view .listing-price {
        font-size: 1.1rem;
    }

    .listings-grid.list-view .listing-category {
        font-size: 0.65rem;
        margin-bottom: 0.15rem;
    }

    .listings-grid.list-view .listing-meta {
        padding-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    /* On very small screens, list view behaves like grid for space efficiency */
    .listings-grid.list-view .listing-card {
        grid-template-columns: 1fr;
        height: auto;
    }
    .listings-grid.list-view .listing-image {
        height: 180px;
    }
}

/* ═══════════════════════════════
   LOAD MORE
═══════════════════════════════ */
.load-more-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0 1rem;
}

.load-more-sentinel {
    height: 1px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: white;
    border: 2px solid rgba(74, 144, 226, 0.4);
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #4a90e2;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.1);
}

.load-more-btn svg {
    width: 18px;
    height: 18px;
}

.load-more-btn:hover {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.25);
}

/* ═══════════════════════════════
   LOADING & EMPTY STATES
═══════════════════════════════ */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(74, 144, 226, 0.1);
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #888;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    border: 1px dashed rgba(74, 144, 226, 0.2);
    margin: 2rem 0;
}

.empty-icon {
    width: 80px;
    height: 80px;
    color: rgba(74, 144, 226, 0.3);
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(74, 144, 226, 0.1);
}

.empty-state h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #2C2C2C;
    margin: 0 0 1rem;
}

.empty-state p {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    color: #666;
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.empty-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #4a90e2, #2F5D3A);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn.btn-primary.btn-full {
    display: block;
    width: 100%;
    text-align: center;
}

/* ═══════════════════════════════
   QUICK VIEW MODAL
═══════════════════════════════ */
.quick-view-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-view-overlay.active {
    opacity: 1;
}

.quick-view-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.quick-view-overlay.active .quick-view-modal {
    transform: scale(1);
}

.quick-view-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.quick-view-close:hover {
    background: #ef4444;
    color: white;
}

.quick-view-close svg {
    width: 18px;
    height: 18px;
}

.quick-view-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: auto;
    max-height: 90vh;
}

/* QV Gallery */
.qv-gallery {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    position: relative;
}

.qv-image-wrap {
    position: relative;
    flex: 1;
    min-height: 300px;
    overflow: hidden;
}

.qv-main-image {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

.qv-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #333;
}

.qv-prev {
    left: 0.75rem;
}

.qv-next {
    right: 0.75rem;
}

.qv-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.qv-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0.5rem;
}

.qv-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.qv-dot.active {
    background: #4a90e2;
    transform: scale(1.25);
}

.qv-thumbnails {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.75rem;
    overflow-x: auto;
}

.qv-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.qv-thumb.active {
    border-color: #4a90e2;
}

.qv-thumb:hover {
    opacity: 0.85;
}

/* QV Info panel */
.qv-info {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.qv-category {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: #2F5D3A;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.qv-title {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

.qv-price {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2F5D3A;
}

.qv-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qv-condition-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.qv-location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #555;
}

.qv-location svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.qv-distance {
    color: #2F5D3A;
    font-weight: 600;
}

.qv-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.qv-seller {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.qv-seller-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.qv-seller-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.qv-seller-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
}

.qv-seller-meta {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #888;
}

.qv-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.qv-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    min-width: 140px;
}

.qv-btn-primary {
    background: linear-gradient(135deg, #4a90e2, #2e70c8);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.qv-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.qv-btn-secondary {
    background: white;
    color: #4a90e2;
    border: 2px solid rgba(74, 144, 226, 0.4);
}

.qv-btn-secondary:hover {
    background: rgba(74, 144, 226, 0.06);
    border-color: #4a90e2;
}

/* Quick Contact AI Row in Quick View */
.qv-quick-contact {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.qv-btn-whatsapp {
    flex: 1;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white !important;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.qv-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.25);
}

.qv-btn-sms {
    flex: 1;
    background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
    color: white !important;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.qv-btn-sms:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.qv-whatsapp-icon, .qv-sms-icon {
    width: 18px;
    height: 18px;
}

@keyframes qv-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.qv-shake {
    animation: qv-shake 0.3s ease-in-out;
}

/* ═══════════════════════════════
   SAVE SEARCH MODAL
═══════════════════════════════ */
.save-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.save-search-overlay.active {
    opacity: 1;
}

.save-search-modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.save-search-overlay.active .save-search-modal {
    transform: scale(1);
}

.save-search-modal h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.save-search-modal p {
    font-size: 0.875rem;
    color: #777;
    margin: 0 0 1.25rem;
}

.save-search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    margin-bottom: 1.25rem;
}

.save-search-input:focus {
    border-color: #4a90e2;
}

.save-search-actions {
    display: flex;
    gap: 0.75rem;
}

/* ═══════════════════════════════
   MOBILE RESPONSIVE
═══════════════════════════════ */
/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE — authoritative block
   All listing card mobile styles live here.
   browse-listings.css loads BEFORE mobile-fix.css so we
   use !important on image heights to guarantee they win.
═══════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .browse-content {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    /* ── Page shell ── */
    .browse-page {
        margin-top: 120px;
        padding: 1.25rem 0;
    }

    .browse-container {
        padding: 0 0.875rem;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* Single column layout: filters go into slide-out drawer */
    .browse-content {
        grid-template-columns: 1fr;
    }

    /* ── Mobile sidebar overlay ── */
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(320px, 90vw);
        height: 100%;
        z-index: 11000;
        transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .filters-sidebar.active {
        left: 0;
    }

    .filters-sidebar.active .filters-backdrop {
        display: block;
        opacity: 1;
        position: fixed;
        left: min(320px, 90vw);
        width: calc(100vw - min(320px, 90vw));
        right: 0;
        top: 0;
        bottom: 0;
    }

    .filters-panel {
        height: 100%;
        border-radius: 0;
        border: none;
        border-right: 1px solid rgba(74, 144, 226, 0.2);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: sticky;
        top: 0;
    }

    .filters-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding-top: 2rem;
    }

    .close-filters-btn    { display: flex; }
    .filters-footer-mobile { display: block; }

    /* ── Toolbar ── */
    .listings-toolbar {
        padding: 1rem 0.25rem;
        gap: 1rem;
    }

    .results-info {
        flex: 1;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.25rem;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    /* ══════════════════════════════════════════
       LISTINGS GRID — exactly 2 columns always
    ══════════════════════════════════════════ */
    .listings-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);   /* always exactly 2 */
        gap: 0.75rem;
    }

    /* ── Card shell: MUST be constrained to grid cell ── */
    .listing-card {
        min-width: 0;       /* critical: stops card expanding beyond 1fr */
        width: 100%;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    /* ── Image: fixed height, full width, always cropped ── */
    .listing-image {
        height: 140px !important; /* !important: beats mobile-fix.css img rules */
        width: 100% !important;
        object-fit: cover !important;
    }

    /* ── Card body: compact luxury padding ── */
    .listing-info {
        padding: 0.625rem 0.625rem 0.5rem;
    }

    /* Hide category chip — saves space, keeps card clean */
    .listing-category {
        display: none;
    }

    /* Title: 2 lines, compact size */
    .listing-title {
        font-size: 0.8rem;
        font-weight: 600;
        line-height: 1.35;
        margin: 0 0 0.3rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Price: bold, legible, not too large */
    .listing-price {
        font-size: 1rem;
        font-weight: 700;
        margin: 0.2rem 0;
    }

    /* Location: small, 1 line */
    .listing-location {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-wrap: nowrap;
    }

    /* ── Protect Card Interiors from Stretching ── */
    .listing-card *,
    .listing-info *,
    .listing-meta * {
        box-sizing: border-box;
        max-width: 100%; /* Never let any inner child stretch parent */
    }

    /* Meta row: avatar + flex name + badge */
    .listing-meta {
        padding-top: 0.35rem;
        gap: 0.25rem;
    }

    .listing-seller {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .seller-avatar {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    .seller-name {
        font-size: 0.68rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1; /* Allow name to shrink before pushing badge */
    }

    /* ── LUXURY MOBILE TRUST BADGES ── */
    /* Targets injected verification spans with high specificity */
    .listing-seller span[title*="Verified"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 3px !important;       /* Tight circular profile */
        width: 20px !important;
        height: 20px !important;
        min-width: 20px !important;
        border-radius: 50% !important;
        font-size: 0px !important;     /* Fully hides the long text */
        margin-left: 2px !important;
        flex-shrink: 0 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
    }

    /* Re-inject ONLY the clean icon for mobile */
    .listing-seller span[title*="Identity"]::before {
        content: "🛡️";
        font-size: 0.75rem;
    }
    .listing-seller span[title*="Phone"]::before {
        content: "📱";
        font-size: 0.75rem;
    }

    /* Hide timestamp — too cramped */
    .listing-time { display: none; }

    /* Featured row stays scrollable carousel */
    .featured-row .listing-card {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
    }

    .featured-row .listing-image {
        height: 180px !important;
    }

    /* Quick view: full screen on mobile */
    .quick-view-body  { grid-template-columns: 1fr; }
    .qv-gallery       { min-height: 240px; }
    .qv-info          { padding: 1.25rem; }
    .qv-title         { font-size: 1.25rem; }
    .qv-price         { font-size: 1.5rem; }
}

/* ── Extra-small phones (<= 400px) ── */
@media (max-width: 400px) {
    .browse-container {
        padding: 0 0.6rem;
    }

    .listings-grid {
        gap: 0.5rem;
    }

    .listing-image {
        height: 120px !important;
    }

    .listing-info {
        padding: 0.5rem;
    }

    .listing-title {
        font-size: 0.75rem;
    }

    .listing-price {
        font-size: 0.9rem;
    }

    .results-info {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .results-count {
        font-size: 0.75rem;
        color: #888;
    }

    .save-search-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.72rem;
    }

    .qv-actions { flex-direction: column; }
    .qv-btn     { min-width: unset; }
}




/* -- Status Badges -- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: 0.5rem;
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.badge-urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.badge-bumped {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.badge-new {
    background: #4a90e2;
    color: white;
}

.badge-price-drop {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

/* Featured Card Glow */
.featured-card {
    border: 2px solid #f59e0b !important;
    background: linear-gradient(to bottom, #fffcf0, #ffffff) !important;
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.15) !important;
}


/* Vehicle pill on listing card */
.vehicle-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #4338ca;
    background: rgba(99,102,241,0.1);
    border-radius: 20px;
    padding: 2px 8px;
    margin: 3px 0 0 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
