/* ============================================================
   search.css — Properties search page (BomaLand)
   Layout: sticky left filter sidebar + scrollable results
   Card visuals reuse .featured-list-card (from base.css)
   ============================================================ */

/* ── Page grid ───────────────────────────────────────────── */
.search-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 1.5rem;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}
@media (max-width: 991.98px) {
    .search-layout { grid-template-columns: 1fr; padding: 0 .75rem; }
}

/* ── Sidebar (sticky, self-scrolling, sticky-footer Apply) ─── */
.search-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 96px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* scroll lives in the body, not the whole card */
}
.search-sidebar__body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.3rem;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.search-sidebar__body::-webkit-scrollbar { width: 6px; }
.search-sidebar__body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 6px; }
.search-sidebar__body::-webkit-scrollbar-track { background: transparent; }

.search-sidebar__footer {
    flex: 0 0 auto;
    padding: .9rem 1rem;
    border-top: 1px solid #eee;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
}

.sidebar-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.filter-group { margin-bottom: 1.2rem; }
.filter-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #666;
    margin-bottom: .45rem;
    display: block;
}

.pill-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-btn {
    border: 1.5px solid #ddd;
    border-radius: 20px;
    padding: .28rem .75rem;
    font-size: .8rem;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.pill-btn:hover {
    border-color: var(--primary-gold, #c9a84c);
    color: var(--primary-gold, #c9a84c);
}
.pill-btn.active {
    background: var(--primary-gold, #c9a84c);
    border-color: var(--primary-gold, #c9a84c);
    color: #fff;
    font-weight: 600;
}

.check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem;
}
.check-chip {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    cursor: pointer;
    padding: .3rem .4rem;
    border-radius: 6px;
    transition: background .12s;
}
.check-chip:hover { background: #f5f5f5; }
.check-chip input {
    accent-color: var(--primary-gold, #c9a84c);
    width: 14px;
    height: 14px;
}

.filter-select {
    width: 100%;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: .45rem .7rem;
    font-size: .85rem;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23666' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
}
.filter-select:focus { outline: none; border-color: var(--primary-gold, #c9a84c); }

.price-row { display: flex; align-items: center; gap: .5rem; }
.price-input {
    flex: 1;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: .4rem .6rem;
    font-size: .82rem;
    width: 0;
    min-width: 0;
}
.price-input:focus { outline: none; border-color: var(--primary-gold, #c9a84c); }

.amenity-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}
.amenity-scroll::-webkit-scrollbar { width: 4px; }
.amenity-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.btn-apply-filters {
    width: 100%;
    padding: .6rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    background: var(--primary-gold, #c9a84c);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}
.btn-apply-filters:hover { opacity: .92; transform: translateY(-1px); }
.btn-clear-filters {
    width: 100%;
    margin-top: .45rem;
    padding: .42rem;
    border-radius: 8px;
    font-size: .8rem;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    color: #555;
}

/* ── Results area ────────────────────────────────────────── */
.search-results-area { min-height: 60vh; }
.results-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .7rem;
    margin-bottom: 1.2rem;
}
.results-count { font-weight: 600; font-size: .95rem; color: #444; }
.sort-select {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: .35rem .7rem;
    font-size: .83rem;
    background: #fff;
    cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--primary-gold, #c9a84c); }

/* Search grid uses CSS grid; .featured-list-card from base.css supplies the look. */
.prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}

/* Sponsored variant of the property_card status-badge (top-left has the listing-type badge) */
.featured-list-card .status-badge--sponsored {
    position: absolute;
    top: 10px;
    right: 60px; /* clear of heart/dropdown button */
    left: auto;  /* override base .status-badge left:10px to prevent full-width stretch */
    width: fit-content;
    z-index: 5;
    background: linear-gradient(135deg, var(--primary-gold, #c9a84c), #e0b84d);
    color: #fff;
    padding: .3rem .5rem;
    font-size: 13px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    line-height: 1;
}

/* ── Active filter chips strip ───────────────────────────── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .9rem;
    min-height: 0;
}
.af-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fff3cd;
    border: 1px solid #f0c040;
    border-radius: 20px;
    padding: .2rem .65rem;
    font-size: .78rem;
    font-weight: 500;
    color: #7a5c00;
}
.af-chip button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    line-height: 1;
    padding: 0;
    color: #9a7400;
}

/* ── Pagination ──────────────────────────────────────────── */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .35rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* All page buttons: fixed square size */
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .6rem;
    border: 1.5px solid #e4e4e4;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 500;
    background: #fff;
    cursor: pointer;
    color: #555;
    text-decoration: none;
    transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* Prev / Next get a pill shape */
.pg-btn:first-child,
.pg-btn:last-child {
    padding: 0 1rem;
    border-radius: 20px;
    font-size: .82rem;
    letter-spacing: .01em;
}

.pg-btn:hover:not(:disabled):not(.active) {
    border-color: var(--primary-gold, #c9a84c);
    color: var(--primary-gold, #c9a84c);
    background: #fffdf5;
    box-shadow: 0 2px 8px rgba(201,168,76,.15);
}

.pg-btn.active {
    background: var(--primary-gold, #c9a84c);
    border-color: var(--primary-gold, #c9a84c);
    color: #fff;
    font-weight: 700;
    cursor: default;
    box-shadow: 0 3px 10px rgba(201,168,76,.35);
}

/* Ellipsis dots */
.pg-btn[style*="pointer-events:none"] {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: #bbb;
    font-size: 1rem;
    letter-spacing: .1em;
    min-width: 24px;
}

.pg-btn:disabled {
    opacity: .38;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #aaa;
    grid-column: 1 / -1;
}
.empty-state > i { font-size: 3.5rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: #777; margin-bottom: .4rem; }

/* ── Skeleton loader (used on filter changes) ───────────── */
.sp-skeleton {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    min-height: 320px;
}
.sk-block {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sp-shimmer 1.4s infinite;
    border-radius: 4px;
}
@keyframes sp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Mobile filter drawer ────────────────────────────────── */
.filter-toggle-btn {
    display: none;
    width: 100%;
    margin-bottom: 1rem;
    padding: .55rem 1rem;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.sidebar-mobile-hdr {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: .7rem;
}
.sidebar-close-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
}

@media (max-width: 991.98px) {
    .filter-toggle-btn { display: flex; }
    .search-sidebar {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1050;
        border-radius: 0;
        max-height: 100vh;
        top: 0;
    }
    .search-sidebar.open { display: flex; }
    .sidebar-mobile-hdr { display: flex; }
}

/* ── Page heading ────────────────────────────────────────── */
.search-page-hdr {
    max-width: 1400px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
}
.search-page-hdr h1 { font-weight: 700; font-size: 1.5rem; margin-bottom: .25rem; }
.search-page-hdr p { color: #6c757d; font-size: .88rem; margin: 0; }

/* ── Infinite Scroll Sentinel ────────────────────────────── */
.infinite-scroll-sentinel {
    width: 100%;
    min-height: 120px;
    padding-top: 3rem;
    padding-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.infinite-scroll-loader {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.spinner-bubble {
    width: 36px;
    height: 36px;
    border: 3px dashed var(--primary-gold, #c9a84c);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin-pulse 1s linear infinite;
    display: inline-block;
}

@keyframes spin-pulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

.infinite-scroll-retry p {
    font-weight: 500;
}

.infinite-scroll-end-message p {
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.6;
}
