/* ═══════════════════════════════════════════════════════════════
   CasaPrimes — Property Search CSS
   App-like responsive design
   Font: Outfit (loaded via _Layout)
═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --or: #F26522;
    --or-d: #d9531a;
    --or-pale: #fff4ee;
    --or-glow: rgba(242,101,34,.15);
    --text: #1a1208;
    --muted: #7a6e65;
    --border: #e8ddd4;
    --cream: #fdf8f4;
    --white: #fff;
    --navy: #1a2744;
    --green: #16a34a;
    --green-pale: #f0fdf4;
    --radius: 12px;
    --sidebar-w: 260px;
    --topbar-h: 58px;
    --mobnav-h: 60px;
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text);
    background: var(--cream);
    overflow-x: hidden
}

/* ════════════════════════════════════════
   PAGE LAYOUT
════════════════════════════════════════ */
.ps-wrap {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--topbar-h));
}

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.ps-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--white);
    border-right: 1px solid var(--border);
    height: calc(100vh - var(--topbar-h));
    position: sticky;
    top: var(--topbar-h);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

    .ps-sidebar::-webkit-scrollbar {
        width: 3px
    }

    .ps-sidebar::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px
    }

    /* Sidebar form scrollable area */
    .ps-sidebar form {
        flex: 1;
        padding: 0 14px 24px;
        overflow-y: auto;
        scrollbar-width: none;
    }

        .ps-sidebar form::-webkit-scrollbar {
            display: none
        }

/* ── Sidebar header ── */
.sb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 12px;
    border-bottom: 1.5px solid #F3F4F6;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 2;
    flex-shrink: 0;
}

.sb-head-title {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.sb-head-reset {
    font-size: .72rem;
    color: var(--or);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    transition: background .15s;
}

    .sb-head-reset:hover {
        background: var(--or-pale)
    }

.sb-mob-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #9CA3AF;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all .15s;
}

    .sb-mob-close:hover {
        background: #F3F4F6;
        color: var(--text)
    }

/* ── Section ── */
.sb-sec {
    margin: 16px 0 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #F3F4F6;
}

    .sb-sec:last-of-type {
        border-bottom: none
    }

.sb-sec-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.sb-sec-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6B7280;
}

.sb-sec-clear {
    font-size: .68rem;
    color: var(--or);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

/* ── BHK pills ── */
.bhk-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px
}

.bhk-pill {
    padding: 5px 11px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: .73rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

    .bhk-pill input[type=checkbox] {
        display: none
    }

    .bhk-pill:hover {
        border-color: var(--or);
        color: var(--or)
    }

    .bhk-pill.sel {
        background: var(--or);
        border-color: var(--or);
        color: #fff
    }

/* ── Checkboxes ── */
.cb-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.cb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
    transition: color .15s;
}

    .cb-item input {
        width: 15px;
        height: 15px;
        accent-color: var(--or);
        cursor: pointer;
        flex-shrink: 0;
    }

    .cb-item:hover {
        color: var(--or)
    }

/* ── Dropdowns (size/etc) ── */
.sb-select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .8rem;
    color: #374151;
    background: #fafaf8;
    outline: none;
    cursor: pointer;
    margin-bottom: 7px;
    font-family: 'Outfit', sans-serif;
}

    .sb-select:focus {
        border-color: var(--or)
    }

.sb-select-label {
    font-size: .66rem;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

/* ════════════════════════════════════════
   BUDGET DUAL RANGE SLIDER
════════════════════════════════════════ */
.budget-slider-wrap {
    padding: 6px 2px 4px
}

.slider-track-wrap {
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    margin: 0 4px;
}

.slider-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    pointer-events: none;
}

.slider-range {
    position: absolute;
    height: 4px;
    background: linear-gradient(90deg, var(--or), #FF8A50);
    border-radius: 2px;
    pointer-events: none;
    transition: left .05s, width .05s;
}

.budget-slider-wrap input[type=range] {
    position: absolute;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    height: 4px;
    pointer-events: none;
    outline: none;
}

    .budget-slider-wrap input[type=range]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--white);
        border: 2.5px solid var(--or);
        box-shadow: 0 2px 8px rgba(242,101,34,.3);
        pointer-events: all;
        cursor: grab;
        transition: transform .15s, box-shadow .15s;
    }

        .budget-slider-wrap input[type=range]::-webkit-slider-thumb:hover {
            transform: scale(1.2);
            box-shadow: 0 3px 14px rgba(242,101,34,.45);
        }

        .budget-slider-wrap input[type=range]::-webkit-slider-thumb:active {
            cursor: grabbing
        }

    .budget-slider-wrap input[type=range]::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: var(--white);
        border: 2.5px solid var(--or);
        box-shadow: 0 2px 8px rgba(242,101,34,.3);
        pointer-events: all;
        cursor: grab;
    }

.budget-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 4px;
}

.budget-tick {
    font-size: .58rem;
    color: #D1D5DB;
    font-weight: 500
}

.budget-inputs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-end
}

.budget-inp-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.budget-inp-label {
    font-size: .64rem;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.budget-inp {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .82rem;
    color: #374151;
    background: #fafaf8;
    outline: none;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    transition: border-color .18s, background .18s;
}

    .budget-inp:focus {
        border-color: var(--or);
        background: var(--white)
    }

.budget-sep {
    color: #D1D5DB;
    font-size: .82rem;
    padding-bottom: 8px;
    flex-shrink: 0
}

/* ════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════ */
.ps-main {
    flex: 1;
    padding: 16px 20px 60px;
    min-width: 0;
}

/* ── City chips ── */
.city-bar {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.city-bar-label {
    font-size: .72rem;
    font-weight: 700;
    color: #9CA3AF;
    white-space: nowrap;
    flex-shrink: 0;
}

.city-chip {
    padding: 5px 13px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: .74rem;
    font-weight: 600;
    color: #6B7280;
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}

    .city-chip:hover {
        border-color: var(--or);
        color: var(--or)
    }

    .city-chip.on {
        background: var(--or-pale);
        border-color: var(--or);
        color: var(--or)
    }

/* ── Results header ── */
.ps-results-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.ps-results-txt {
    font-size: .88rem;
    color: var(--muted)
}

    .ps-results-txt strong {
        color: var(--text)
    }

/* Active filter chips */
.ps-filter-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ps-filter-chip {
    background: var(--or-pale);
    color: var(--or);
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(242,101,34,.2);
    white-space: nowrap;
}

.ps-filter-chip-label {
    font-size: .7rem;
    color: #9CA3AF
}

.ps-filter-clear {
    font-size: .7rem;
    color: #9CA3AF;
    text-decoration: none;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 50px;
    transition: all .15s;
}

    .ps-filter-clear:hover {
        color: var(--or);
        background: var(--or-pale)
    }

/* ── Card grid ── */
.ps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 20px;
}

/* ── Card body classes ── */
.ps-card-body {
    padding: 13px 15px
}

.ps-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 3px
}

.ps-card-title {
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-card-loc {
    font-size: .74rem;
    color: #6B7280;
    margin-bottom: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-card-specs {
    display: flex;
    gap: 10px;
    border-top: 1px solid #F3F4F6;
    padding-top: 9px;
    flex-wrap: wrap;
}

    .ps-card-specs span {
        font-size: .72rem;
        color: #6B7280
    }

/* ── No results ── */
.ps-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9CA3AF
}

/* ── Mobile apply button ── */
.mob-apply {
    display: none;
    width: 100%;
    padding: 15px;
    background: var(--or);
    color: var(--white);
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 -4px 18px rgba(242,101,34,.2);
    letter-spacing: .01em;
    transition: background .2s;
}

    .mob-apply:hover {
        background: var(--or-d)
    }

    .mob-apply:active {
        background: var(--or-d)
    }

/* ── Mobile FAB ── */
.ps-filter-fab {
    display: none;
    position: fixed;
    bottom: 100px;
    left: 12px;
    z-index: 400;
    background: var(--or);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    font-family: 'Outfit', sans-serif;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(242,101,34,.45);
    align-items: center;
    gap: 7px;
    animation: fabPop .35s cubic-bezier(.34,1.56,.64,1);
}

    .ps-filter-fab:active {
        transform: scale(.94)
    }

@keyframes fabPop {
    from {
        opacity: 0;
        transform: scale(.6) translateY(20px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

.ps-fab-badge {
    background: var(--white);
    color: var(--or);
    font-size: .62rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
}

/* ── Mobile backdrop ── */
.ps-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 498;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

    .ps-backdrop.on {
        display: block
    }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
════════════════════════════════════════ */
@media (max-width: 1024px) {
    :root {
        --sidebar-w: 230px
    }

    .ps-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 16px
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
   Slide-in drawer + 2-col card grid
════════════════════════════════════════ */
@media (max-width: 768px) {
    .nb-search {
        display: none !important;
    }
    /* ── Sidebar → full-height slide-in drawer ── */
    .ps-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        height: 100vh !important;
        width: min(310px, 90vw) !important;
        z-index: 499;
        transition: left .28s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
        z-index:999;
    }

        .ps-sidebar.open {
            left: 0 !important;
            box-shadow: 8px 0 40px rgba(0,0,0,.22) !important;
        }

        .ps-sidebar form {
            flex: 1;
            overflow-y: auto;
            padding: 0 14px 0;
            -webkit-overflow-scrolling: touch;
        }
    /* Close button visible on mobile */
    .sb-mob-close {
        display: block
    }
    /* Apply button visible and sticky */
    .mob-apply {
        display: block;
        flex-shrink: 0
    }
    /* FAB visible */
    .ps-filter-fab {
        display: flex
    }

    /* ── Main ── */
    .ps-main {
        padding: 10px 12px 90px
    }

    .ps-wrap {
        min-height: 0
    }

    /* ── Cards — 2 columns like an app ── */
    .ps-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

        /* Card image shorter on 2-col */
        .ps-grid > div > div:first-child {
            height: 140px !important
        }

    /* Card body compact */
    .ps-card-body {
        padding: 9px 10px
    }

    .ps-card-price {
        font-size: .92rem;
        margin-bottom: 2px
    }

    .ps-card-title {
        font-size: .74rem;
        margin-bottom: 2px
    }

    .ps-card-loc {
        font-size: .67rem;
        margin-bottom: 6px
    }

    .ps-card-specs {
        gap: 6px;
        padding-top: 6px
    }

        .ps-card-specs span {
            font-size: .64rem
        }

    /* ── City bar — horizontal scroll ── */
    .city-bar {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        padding-bottom: 6px;
        margin-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }

        .city-bar::-webkit-scrollbar {
            display: none
        }

    .city-bar-label {
        display: none
    }

    /* ── Results header compact ── */
    .ps-results-hd {
        margin-bottom: 10px;
        gap: 6px
    }

    .ps-results-txt {
        font-size: .8rem
    }

    /* Budget slider input smaller */
    .budget-inp {
        font-size: .78rem;
        padding: 7px 8px
    }

    .budget-inputs {
        gap: 6px;
        margin-top: 10px
    }
}

/* ════════════════════════════════════════
   RESPONSIVE — SMALL PHONES (≤440px)
   Single column, bigger images
════════════════════════════════════════ */
@media (max-width: 440px) {
    .ps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

        .ps-grid > div > div:first-child {
            height: 190px !important
        }

    .ps-card-body {
        padding: 12px 13px
    }

    .ps-card-price {
        font-size: 1rem
    }

    .ps-card-title {
        font-size: .8rem
    }

    .ps-card-loc {
        font-size: .72rem
    }

    .ps-card-specs span {
        font-size: .7rem
    }

    .ps-main {
        padding: 10px 10px 90px
    }

    .city-bar-label {
        display: none
    }

    .ps-filter-fab {
        bottom: 100px;
        left: 12px;
        padding: 11px 18px;
        font-size: .82rem
    }
}

/* ════════════════════════════════════════
   MOBILE BOTTOM NAV (from shared layout)
   Extra bottom padding to clear nav bar
════════════════════════════════════════ */
.mob-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    /*padding: 8px 0 12px;*/
    z-index: 500;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1)
}

.mob-nav-items {
    display: flex;
    justify-content: space-around
}

.mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: .65rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    padding: 2px 12px;
    text-decoration: none
}

    .mob-nav-item.active {
        color: var(--or)
    }

.mob-nav-icon {
    font-size: 1.2rem
}

@media (max-width: 768px) {
    .mob-bottom-nav {
        display: block
    }
}

.nb-links {
    margin-left: auto !important;
}