/* ── tokens ── */
:root {
    /* Horizontal breathing room + notch-safe edges (map/list) */
    --ml-gutter: clamp(8px, 2.8vw, 28px);
    --ml-shell-max: 1320px;
    /* Colour palette — match site header brand (see _Header: #6B5B95 / gradient) */
    --P: #6B5B95;
    --PD: #564a72;
    --PL: #ede9f5;
    --PM: #9b8fbf;
    --W: #fff;
    --BG: #f4f3f7;
    --BR: #e2dfec;
    --T: #1c1829;
    --M: #6b677a;
    --F: #b0acbc;
    --r: 12px;

    /* ── Typography scale (shared tokens — reuse in other page CSS files)
       Follows the same AqaryonHome pattern:
         · Titles / prices   → font-weight 700
         · Body / stats      → font-weight 500
         · UI controls       → font-weight 600
       Add these same variables to any page stylesheet for uniformity.  ── */
    --fs-2xs:  11px;   /* micro: type-badges, cbadge                */
    --fs-xs:   12px;   /* small labels, hints, filter section hdrs  */
    --fs-sm:   13px;   /* secondary: tags, location, unit, chips    */
    --fs-base: 15px;   /* primary card title                        */
    --fs-md:   18px;   /* prices (AqaryonHome uses 24-28px; scaled) */
    --fs-lg:   20px;   /* section / filter-panel headings           */

    --fw-medium:   500;   /* body text  — matches AqaryonHome body */
    --fw-semibold: 600;   /* UI controls (tabs, buttons)           */
    --fw-bold:     700;   /* titles & prices — matches AqaryonHome */

    /* Map overlay — frosted glass (toolbar, carousel, MAP/LIST, tools)
       Lower alpha + stronger blur so map shows through (avoids “solid white” on light tiles). */
    --map-glass-bg:      rgba(255, 255, 255, 0.34);
    --map-glass-bg-soft: rgba(255, 255, 255, 0.22);
    --map-glass-edge:    rgba(255, 255, 255, 0.42);
    --map-glass-shadow:  0 4px 24px rgba(28, 24, 41, 0.12);
    --map-glass-blur:    18px;
    --map-glass-brand:   rgba(107, 91, 149, 0.84);
    --map-glass-brand-mid: rgba(107, 91, 149, 0.42);
    --map-glass-brand-faint: rgba(107, 91, 149, 0.22);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

html, body {
    min-height: 100% /* Changed to min-height to allow content expansion */
}

body {
    font-family: 'Rubik',sans-serif;
    color: var(--T);
    direction: rtl;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Changed from height to min-height to allow content to expand */
    min-height: 100dvh;
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: auto; /* Allow vertical scroll */
    margin-top: clamp(120px, 18vw, 148px) !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Map page: remove all container constraints so the map
   can go truly full-width and full-height */
body > #root > div {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

main {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
}

/* ── Map view: hide footer & block background scroll ──
   #ws is position:fixed so it leaves the document flow.
   The footer sits after <main> in the flow and can peek
   through. Hide it + lock body scroll in map mode.
   List mode re-enables these via the .list-mode class
   toggled by JS on <body>.                              */
body:not(.list-mode) {
    overflow: hidden !important;
}

body:not(.list-mode) footer {
    display: none !important;
}

/* List mode: restore footer and scrolling */
body.list-mode {
    overflow-y: auto !important;
    margin-top: clamp(132px, 14vw, 168px) !important;
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
    background: var(--W);
}

body.list-mode footer {
    display: block !important;
}

/* Avoid clipping list shell / shadows; map mode keeps main overflow hidden */
body.list-mode main {
    overflow: visible !important;
}

body.list-mode #root > div.min-h-screen {
    padding-bottom: 2rem;
    background: var(--W) !important;
}

/* Main content area should respect max-width */
body > #root > div > main {
    max-width: 100%;
}

/* Header should respect max-width */
body > #root > div > header {
    max-width: 100%;
}

/* Footer should break out and take full width like home page */
body > #root > div > footer {
    max-width: 100vw !important;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
}

/* ─────────── MAP CHROME: top bars + carousel (below site header only)) ─────────── */
#hdr {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 25;
    flex-shrink: 0;
    background: transparent;
    border-bottom: none;
    padding: 12px 16px 0;
    pointer-events: none;
}

#hdr * {
    pointer-events: auto;
}

/* Wrapper for mobile toolbar card — inert on desktop */
.hdr-bar-mobile-shell {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Toolbar always follows design L→R: segment | listing type | filter (even on RTL pages). */
.hdr-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    direction: ltr;
    unicode-bidi: isolate;
}

.hdr-bar__top-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 10px 32px rgba(28, 24, 41, 0.18);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.hdr-bar__kind {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(220, 216, 233, 0.95);
}

html[dir="rtl"] .hdr-bar__kind {
    direction: rtl;
    justify-content: flex-start; /* Arabic: start chips from the right edge */
}

.hdr-bar__kind-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--T);
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

/*
 * Listing-type chips: DOM is [svg][label]. Parent `.hdr-bar__kind` is `direction: rtl`.
 * Use normal `flex-direction: row` so the first item (icon) sits at main-start = inline-end (right).
 * `row-reverse` was forcing the icon to the wrong side for most buttons.
 */
html[dir="rtl"] .hdr-bar__kind-btn {
    flex-direction: row;
}

/* Toolbar is `direction: ltr`; give property-type + filter their own RTL inline axis */
html[dir="rtl"] .hdr-bar__pt-wrap {
    direction: rtl;
}

html[dir="rtl"] .hdr-bar__filter {
    direction: rtl;
    flex-direction: row;
}

.hdr-bar__kind-btn .hdr-ic,
.hdr-bar__kind-btn svg.hdr-ic {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    opacity: .85;
}

.hdr-bar__kind-btn.on {
    background: var(--P);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.hdr-bar__kind-btn.on .hdr-ic {
    color: #fff;
    opacity: 1;
}

/* Map / List: single toggle — label shows destination (List while on map, Map while on list) */
.hdr-bar__view-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.hdr-bar__view-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid rgba(107, 91, 149, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 246, 252, 0.96) 100%);
    color: var(--PD);
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(28, 24, 41, 0.08);
    white-space: nowrap;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.hdr-bar__view-toggle:hover {
    border-color: rgba(107, 91, 149, 0.45);
    box-shadow: 0 4px 14px rgba(28, 24, 41, 0.1);
}

.hdr-bar__view-toggle:active {
    transform: scale(0.98);
}

.hdr-bar__view-toggle:focus-visible {
    outline: 2px solid var(--P);
    outline-offset: 2px;
}

.hdr-bar__view-toggle-ic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
    color: var(--P);
}

.hdr-bar__view-toggle-svg {
    width: 16px;
    height: 16px;
    display: block;
}

.hdr-bar__view-toggle-text {
    flex-shrink: 0;
}

body.list-mode .hdr-bar__view-toggle {
    border-color: rgba(226, 223, 236, 0.98);
    background: var(--W);
    box-shadow: 0 1px 4px rgba(28, 24, 41, 0.06);
}

/* View switch: subtle motion (honors .ml-view-anim on body) */
@keyframes ml-list-reveal {
    from {
        opacity: 0.35;
        transform: translateY(14px);
    }

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

@keyframes ml-map-reveal {
    from {
        opacity: 0.55;
        transform: scale(0.985);
    }

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

body.ml-view-anim.list-mode #cp {
    animation: ml-list-reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.ml-view-anim:not(.list-mode) #mapArea {
    animation: ml-map-reveal 0.4s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
    body.ml-view-anim.list-mode #cp,
    body.ml-view-anim:not(.list-mode) #mapArea {
        animation: none !important;
    }
}

/* Property type — pill trigger + custom dropdown (native <select> list cannot be styled) */
.hdr-bar__pt-wrap {
    --hdr-pt-fill: rgba(107, 91, 149, 0.08);
    position: relative;
    display: inline-flex;
    align-items: stretch;
    min-height: 38px;
    min-width: 175px;
    max-width: min(340px, calc(100vw - 200px));
    border-radius: 999px;
    border: 1px solid rgba(107, 91, 149, 0.16);
    background: var(--hdr-pt-fill);
    flex: 0 0 auto;
    box-sizing: border-box;
    color-scheme: light;
}

.hdr-bar__pt-wrap:hover {
    --hdr-pt-fill: rgba(107, 91, 149, 0.1);
    border-color: rgba(107, 91, 149, 0.28);
}

.hdr-bar__pt-trigger {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 10px 4px 12px;
    margin: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--T);
    text-align: start;
    line-height: 1.35;
    -webkit-tap-highlight-color: transparent;
}

.hdr-bar__pt-trigger:focus {
    outline: none;
}

.hdr-bar__pt-trigger:focus-visible {
    box-shadow: 0 0 0 2px rgba(107, 91, 149, 0.35);
}

.hdr-bar__pt-trigger.is-open .hdr-bar__pt-chevron {
    transform: rotate(180deg);
}

.hdr-bar__pt-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    unicode-bidi: plaintext;
}

.hdr-bar__pt-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    margin-inline-start: 2px;
}

.hdr-bar__pt-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--P);
    opacity: .92;
    pointer-events: none;
}

.hdr-bar__pt-ic .hdr-ic {
    display: block;
}

/* Dropdown panel */
.hdr-bar__pt-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    z-index: 50;
    min-width: max(100%, 268px);
    max-width: min(340px, calc(100vw - 32px));
    max-height: min(420px, 62vh);
    padding: 8px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(107, 91, 149, 0.14);
    box-shadow: 0 16px 48px rgba(28, 24, 41, 0.18), 0 4px 16px rgba(28, 24, 41, 0.08);
    box-sizing: border-box;
}

html[dir="rtl"] .hdr-bar__pt-dropdown {
    left: auto;
    right: 0;
}

html[dir="rtl"] .hdr-bar__pt-trigger {
    text-align: right;
    /* DOM: [icon][label][chevron] — `direction: rtl` on `.hdr-bar__pt-wrap` places icon on the right */
    flex-direction: row;
}

.hdr-bar__pt-list {
    max-height: min(396px, calc(62vh - 24px));
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 91, 149, 0.35) transparent;
}

.hdr-bar__pt-list::-webkit-scrollbar {
    width: 6px;
}

.hdr-bar__pt-list::-webkit-scrollbar-thumb {
    background: rgba(107, 91, 149, 0.3);
    border-radius: 6px;
}

/* Mobile: JS sets position:fixed + width (see positionMapHdrPtDropdownForMobile) — flex so the list scrolls inside max-height */
@media (max-width: 768px) {
    .hdr-bar__pt-dropdown[data-mob-placed="1"] {
        display: flex;
        flex-direction: column;
        min-width: 0 !important;
        z-index: 10060;
    }

    .hdr-bar__pt-dropdown[data-mob-placed="1"] .hdr-bar__pt-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
    }
}

.hdr-bar__pt-section {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 12px 8px;
    margin: 4px 0 2px;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--PD);
    background: linear-gradient(180deg, #ede9f5 0%, #e8e3f2 100%);
    border-radius: 10px;
    border: 1px solid rgba(107, 91, 149, 0.12);
    text-align: center;
}

.hdr-bar__pt-item {
    display: block;
    width: 100%;
    margin: 2px 0;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--T);
    text-align: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    unicode-bidi: plaintext;
}

html[dir="rtl"] .hdr-bar__pt-item {
    text-align: right;
}

.hdr-bar__pt-item:hover {
    background: rgba(107, 91, 149, 0.08);
    color: var(--PD);
}

.hdr-bar__pt-item.is-selected {
    background: var(--P);
    color: #fff;
    font-weight: 600;
}

.hdr-bar__pt-item.is-selected:hover {
    background: var(--PD);
    color: #fff;
}

.hdr-bar__filter {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    min-height: 39px;
    border-radius: 999px;
    border: 1px solid rgba(220, 216, 233, 0.95);
    background: #fff;
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--T);
    cursor: pointer;
}

html[dir="rtl"] .hdr-bar__filter {
    unicode-bidi: plaintext;
}

.hdr-bar__filter .hdr-ic,
.hdr-bar__filter svg.hdr-ic {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.hdr-bar__filter:hover {
    border-color: rgba(179, 172, 199, 0.95);
}

.hdr-bar__filter.on {
    border-color: rgba(107, 91, 149, 0.6);
    color: var(--PD);
    background: rgba(237, 233, 245, 0.8);
}

/* Only the chip row scrolls — the next chevron stays fixed at the end of the bar. */
.pt-carousel__track {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pt-carousel__track::-webkit-scrollbar {
    display: none;
}

.pt-carousel__chip {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: auto;
    min-width: 0;
    max-width: 220px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: var(--map-glass-bg-soft);
    color: var(--T);
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .15s, background .15s, color .15s;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.pt-carousel__ic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--P);
}

.pt-carousel__ic svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Icon + label in one row; long names may wrap to a second line beside the icon */
.pt-carousel__lbl {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 168px;
    margin: 0;
    padding: 0;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: start;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    color: inherit;
}

html[dir="rtl"] .pt-carousel__lbl {
    direction: rtl;
    unicode-bidi: plaintext;
}

.pt-carousel__chip.on {
    border-color: rgba(107, 91, 149, 0.4);
    background: var(--map-glass-brand-faint);
}

.pt-carousel__chip.on .pt-carousel__lbl {
    color: var(--PD);
    font-size: 11px;
    font-weight: 600;
}

.pt-carousel__next {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--map-glass-edge);
    background: var(--map-glass-bg-soft);
    backdrop-filter: blur(var(--map-glass-blur));
    -webkit-backdrop-filter: blur(var(--map-glass-blur));
    color: var(--M);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--map-glass-shadow);
}

html[dir="rtl"] .pt-carousel__next svg {
    transform: scaleX(-1);
}

@media (max-width: 900px) {
    .hdr-bar__top-pill {
        width: min(100%, calc(100vw - 20px));
        justify-content: center;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .hdr-bar__view-wrap {
        flex: 1 1 auto;
        justify-content: center;
    }

    .hdr-bar__pt-wrap {
        min-width: 150px;
        max-width: min(280px, calc(100vw - 120px));
    }
}

.sg {
    position: relative;
}

    .sg i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--P);
        pointer-events: none;
        line-height: 0;
        z-index: 1;
    }

    .sg select {
        width: 100%;
        height: 42px;
        border: 1.5px solid var(--BR);
        border-radius: 10px;
        padding: 0 24px 0 30px;
        font-family: 'Rubik',sans-serif;
        font-size: var(--fs-base);
        font-weight: var(--fw-medium);
        color: var(--T);
        background: var(--W) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b5d8b'/%3E%3C/svg%3E") no-repeat right 8px center;
        appearance: none;
        outline: none;
        cursor: pointer;
        direction: ltr;
        text-align: left;
    }

        .sg select:focus {
            border-color: var(--P)
        }

/* RTL overrides */
[dir="rtl"] .sg i {
    left: auto;
    right: 10px;
}

[dir="rtl"] .sg select {
    padding: 0 30px 0 24px;
    background-position: left 8px center;
    text-align: right;
    direction: rtl;
}

/* rtl vtab rules removed */

/* RTL overrides for property cards (horizontal “pin” card only — not list/grid tiles) */
[dir="rtl"] .card:not(.card--listing) {
    flex-direction: row-reverse; /* RTL: image on right, content on left */
}

[dir="rtl"] .cbadge {
    left: auto;
    right: 6px; /* RTL: badge on top right */
    text-align: right; /* RTL: right align badge text */
}

[dir="rtl"] .cinfo {
    text-align: right !important; /* RTL: right align all text */
    direction: rtl !important; /* RTL: right-to-left direction */
    align-items: flex-start !important;
}

[dir="rtl"] .ctitle {
    text-align: right !important; /* RTL: right align title */
    direction: rtl; /* RTL: title direction */
}

[dir="rtl"] .ctags {
    justify-content: flex-start; /* RTL: align tags to right */
    direction: rtl; /* RTL: tags container direction */
}

[dir="rtl"] .ctag {
    direction: rtl; /* RTL: ensure icons/text flow right-to-left */
    text-align: right; /* RTL: right align tag text */
}

[dir="rtl"] .cloc {
    direction: rtl !important; /* RTL: location text direction */
    justify-content: flex-end; /* RTL: align location to right */
    text-align: right; /* RTL: right align location text */
}

[dir="rtl"] .cprow {
    direction: rtl !important; /* RTL: price row direction */
    justify-content: flex-end; /* RTL: align price to right */
    text-align: right; /* RTL: right align price text */
}

[dir="rtl"] .cprice {
    text-align: right; /* RTL: right align price */
    direction: rtl; /* RTL: price direction */
}

[dir="rtl"] .cunit {
    text-align: right; /* RTL: right align unit */
    direction: rtl; /* RTL: unit direction */
}

.fbadge {
    position: absolute;
    top: -6px;
    inset-inline-start: auto;
    inset-inline-end: -6px;
    min-width: 17px;
    height: 17px;
    border-radius: 100px;
    padding: 0 4px;
    background: var(--P);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.92);
}

    .fbadge.on {
        display: flex
    }

/* Toolbar is direction:ltr — pin badge on the physical top-end of the filter pill. */
.hdr-bar__filter .fbadge {
    left: auto;
    right: -6px;
    inset-inline-start: auto;
    inset-inline-end: -6px;
}

/* ─────────── Map tools (view toggle is in header; no bottom bar) ─────────── */
.map-tools {
    position: absolute;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    left: max(14px, env(safe-area-inset-left, 0px));
    z-index: 28;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
}

html[dir="rtl"] .map-tools {
    left: auto;
    right: max(14px, env(safe-area-inset-right, 0px));
}

.map-tool-square {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, color .15s;
}

.map-tool-square svg,
.map-tool-square .map-layers-ic {
    width: 17px;
    height: 17px;
    display: block;
    flex-shrink: 0;
}

.map-tool-square--layers {
    border: 1px solid var(--map-glass-edge);
    background: var(--map-glass-bg);
    backdrop-filter: blur(var(--map-glass-blur));
    -webkit-backdrop-filter: blur(var(--map-glass-blur));
    color: var(--T);
    box-shadow: var(--map-glass-shadow);
}

.map-tool-square--layers:hover {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 4px 18px rgba(28, 24, 41, 0.13);
}

.map-tool-square--layers:active {
    transform: scale(0.98);
}

.map-tool-square--locate {
    border: 1.25px solid rgba(142, 200, 240, 0.65);
    background: var(--map-glass-bg);
    backdrop-filter: blur(var(--map-glass-blur));
    -webkit-backdrop-filter: blur(var(--map-glass-blur));
    color: #868696;
    box-shadow: var(--map-glass-shadow);
}

.map-tool-square--locate:hover {
    border-color: #6bb0e6;
    color: #6b6b7a;
    box-shadow: 0 3px 12px rgba(142, 200, 240, 0.35);
}

.map-tool-square--locate:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .map-tools {
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        left: max(12px, env(safe-area-inset-left, 0px));
        gap: 4px;
    }

    html[dir="rtl"] .map-tools {
        right: max(12px, env(safe-area-inset-right, 0px));
    }
}

/* ─────────── WORKSPACE ─────────── */
/* position:fixed breaks out of every container/layout constraint
   so the map fills the full screen edge-to-edge.
   'top' is set dynamically by JS (= bottom of #mainHeader).      */
#ws {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    display: flex;
    overflow: hidden;
    z-index: 40;
    /* fallback top; JS overrides with site header bottom */
    top: 120px;
    box-sizing: border-box;
    min-height: 0;
    /* Home indicator / gesture bar — keeps LIST/MAP & tools above the inset */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Inner flex host: map mode = row (map + hidden cp); list mode = centered column “panel”. */
.map-listing-shell {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    flex-direction: row;
    align-items: stretch;
    box-sizing: border-box;
}

/* map side — takes full width since the side panel is hidden in map view */
#mapArea {
    flex: 1;
    width: 100%;
    position: relative;
    min-width: 0
}

#map {
    width: 100%;
    height: 100%;
    touch-action: manipulation
}

/* Manual viewport refresh chip + optional “Clear filters” (map-only) */
.map-search-here-wrap {
    position: absolute;
    top: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 24;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: calc(100% - 24px);
    flex-wrap: wrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}

[dir="rtl"] .map-search-here-wrap {
    flex-direction: row-reverse;
}

.map-search-here {
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(107, 91, 149, 0.35);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--PD);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: var(--fw-semibold);
    box-shadow: 0 8px 18px rgba(28, 24, 41, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    opacity: 0;
    max-width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
    overflow: hidden;
    border-width: 0;
    pointer-events: none;
    transition: opacity .2s ease, max-width .2s ease, padding .2s ease, border-width .2s ease, box-shadow .2s ease;
}

.map-search-here.on {
    opacity: 1;
    max-width: min(420px, 100vw);
    min-height: 34px;
    padding: 8px 14px;
    border-width: 1px;
    pointer-events: auto;
}

.map-search-here:hover {
    background: var(--W);
    box-shadow: 0 10px 22px rgba(28, 24, 41, 0.18);
}

.map-clear-filters {
    min-height: 34px;
    padding: 8px 14px;
    border: 1px solid rgba(107, 91, 149, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    color: var(--P);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    font-weight: var(--fw-semibold);
    box-shadow: 0 6px 16px rgba(107, 91, 149, 0.12);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    pointer-events: auto;
    transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.map-clear-filters:hover {
    background: rgba(107, 91, 149, 0.08);
    border-color: var(--P);
}

.map-clear-filters:focus-visible {
    outline: 2px solid var(--P);
    outline-offset: 2px;
}

.map-clear-filters[hidden] {
    display: none !important;
}

/* Wrap visible when “Search Here” is shown and/or clear filters is shown */
.map-search-here-wrap:has(.map-search-here.on),
.map-search-here-wrap:has(.map-clear-filters:not([hidden])) {
    pointer-events: auto;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Search Here is map-only; never show in list mode */
body.list-mode .map-search-here-wrap {
    display: none !important;
}

@media (max-width: 768px) {
    .map-search-here-wrap {
        top: 104px;
    }

    .map-search-here.on {
        font-size: 12px;
        padding: 7px 12px;
    }

    .map-clear-filters {
        font-size: 12px;
        padding: 7px 12px;
    }
}

/*
  Mapbox GeolocateControl draws the real blue dot + accuracy circle (same mechanism as Maps).
  Do NOT use display:none on it — that can prevent the dot from working. Visually hide only the stock button.
*/
#map .mapboxgl-ctrl-geolocate {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Blue “current location” dot (custom #mapLocateBtn — Mapbox GeolocateControl UI is hidden) */
.map-user-location-marker {
    width: 20px;
    height: 20px;
    position: relative;
    pointer-events: none;
}

.map-user-location-marker::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #1a73e8;
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    box-sizing: border-box;
}

/* placeholder map */
#mph {
    position: absolute;
    inset: 0;
    background: #dcd7ec;
    overflow: hidden;
    z-index: 2
}

    #mph::before {
        content: '';
        position: absolute;
        inset: 0;
        background: repeating-linear-gradient(0deg,transparent,transparent 39px,rgba(255,255,255,.25) 40px), repeating-linear-gradient(90deg,transparent,transparent 39px,rgba(255,255,255,.25) 40px);
    }

#mroads {
    position: absolute;
    inset: 0;
    pointer-events: none
}

#pins {
    position: absolute;
    inset: 0;
    pointer-events: none
}

/* price pins */
.pin {
    background: var(--map-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(155, 143, 191, 0.65);
    color: var(--PD);
    font-family: 'Rubik',sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 1px 6px rgba(107,93,139,.15);
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    transition: all .18s;
    user-select: none;
    position: relative;
}

    .pin:hover, .pin.on {
        background: var(--P);
        border-color: var(--P);
        color: #fff;
        transform: scale(1.1);
        box-shadow: 0 4px 20px rgba(107,93,139,.3);
        z-index: 10;
    }


/* Mapbox HTML marker pill */
/* placeholder map pins — absolutely positioned by left/top % */
#pins .pin {
    position: absolute;
    transform: translate(-50%,-50%);
    pointer-events: all;
}

    #pins .pin:hover, #pins .pin.on {
        transform: translate(-50%,-50%) scale(1.1);
    }

#pincard {
    position: absolute;
    top: 50%;
    left: 16px;
    width: min(380px, calc(100vw - 32px));
    z-index: 35;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transform: translate(calc(-100% - 32px), -50%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
}

html[dir="rtl"] #pincard {
    left: auto;
    right: 16px;
    transform: translate(calc(100% + 32px), -50%);
}

html[dir="ltr"] #pincard {
    direction: ltr;
}

html[dir="rtl"] #pincard {
    direction: rtl;
}

html[dir="ltr"] #ws.lo {
    direction: ltr;
}

#pincard.on {
    transform: translate(0, -50%);
    pointer-events: all;
}

/* RTL: `html[dir="rtl"] #pincard` beats `#pincard.on` (extra element+attr) — without this, the tile stays off-screen when open */
html[dir="rtl"] #pincard.on {
    transform: translate(0, -50%);
    pointer-events: all;
}

.pincard-cls {
    position: absolute;
    top: 10px;
    z-index: 25;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--map-glass-edge);
    background: var(--map-glass-bg-soft);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 18px;
    line-height: 1;
    color: var(--M);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

html[dir="ltr"] .pincard-cls {
    right: 10px;
    left: auto;
}

html[dir="rtl"] .pincard-cls {
    left: 10px;
    right: auto;
}

.pincard-cls:hover {
    border-color: var(--P);
    color: var(--P);
}

#pincard-inner.pincard-inner {
    display: flex;
    flex-direction: column;
    padding: 0;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: var(--W);
    box-shadow: 0 14px 44px rgba(28, 24, 41, 0.16);
    border: 1px solid rgba(226, 223, 236, 0.95);
}

/* Same vertical tile as list view — no double chrome */
#pincard .pincard-card.card.card--listing {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    max-width: 100%;
}

#pincard .pincard-card.card--listing:hover {
    transform: none;
    box-shadow: none;
}

#pincard-top {
    display: flex;
    flex-direction: row;
    gap: 14px;
    padding: 16px 18px;
    align-items: flex-start;
}

html[dir="rtl"] #pincard-top {
    flex-direction: row-reverse;
}

#pincard-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#pincard-img {
    width: 104px;
    height: 104px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--PL);
    position: relative;
}

#pincard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-bdg {
    position: absolute;
    top: 6px;
    right: 6px;
    height: 18px;
    padding: 0 7px;
    border-radius: 100px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    display: flex;
    align-items: center;
}

html[dir="rtl"] .pc-bdg {
    right: auto;
    left: 6px;
}

#pc-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--T);
    line-height: 1.35;
}

#pc-pricerow {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

#pc-price {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--PD);
}

#pc-unit {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--F);
}

#pc-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.pc-spec {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--M);
}

.pc-spec svg {
    flex-shrink: 0;
    opacity: .8;
}

#pincard-footer {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 12px 16px;
    background: var(--map-glass-brand);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 12px;
}

.pincard-foot__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    transition: background .15s, transform .1s;
}

.pincard-foot__btn:hover {
    background: rgba(255, 255, 255, 0.32);
}

.pincard-foot__btn img {
    width: 30px;
    height: auto;
    display: block;
}

.pincard-foot__wa {
    background: #25D366 !important;
}

.pincard-foot__wa:hover {
    background: #20bd5a !important;
}

#pc-cta {
    display: block;
    width: 100%;
    height: 44px;
    margin: 0;
    background: var(--W);
    color: var(--P);
    border: none;
    border-top: 1px solid var(--BR);
    border-radius: 0;
    font-family: 'Rubik', sans-serif;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: background .15s, transform .1s;
    flex-shrink: 0;
}

#pc-cta:hover {
    background: var(--PL);
}

#pc-cta:active {
    transform: scale(.995);
}

/* cards panel — hidden in map view; list mode shows split view */
#cp {
    width: min(380px, 42vw);
    flex-shrink: 0;
    background: var(--BG);
    border-inline-end: 1px solid var(--BR);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

body.list-mode #cp {
    display: flex;
}

/* List view: full-width scrollable feed; map canvas hidden (toolbar stays on #mapArea). */
body.list-mode #ws {
    flex-direction: column;
}

body.list-mode .map-listing-shell {
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    width: calc(100% - 2 * var(--ml-gutter));
    max-width: min(var(--ml-shell-max), calc(100vw - 2 * var(--ml-gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    margin: clamp(6px, 1.2vw, 12px) auto 0;
    padding: clamp(8px, 1.2vw, 14px) clamp(10px, 2vw, 22px) clamp(12px, 1.8vh, 18px);
    background: var(--W);
    border: 1px solid var(--BR);
    border-radius: clamp(12px, 2vw, 18px);
    box-shadow: 0 8px 36px rgba(28, 24, 41, 0.09);
    overflow: hidden;
}

/* Toolbar + list zone — same white as the outer shell (no grey band) */
body.list-mode #mapArea {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: visible;
    z-index: 1;
    padding: 10px clamp(8px, 1.5vw, 16px) 12px;
    background: var(--W);
    border: none;
    border-bottom: 1px solid var(--BR);
    border-radius: 0;
}

body.list-mode #map,
body.list-mode #mph,
body.list-mode #pincard,
body.list-mode #mapTools {
    display: none !important;
}

body.list-mode #cp {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100%;
    min-height: 0;
    border-inline-end: none;
    background: var(--W);
    position: relative;
    z-index: 0;
    border-radius: 0;
    border: none;
    padding-top: 12px;
    padding-bottom: clamp(12px, 1.6vw, 18px);
    gap: 14px;
    flex-direction: column;
}

/* List view: toolbar must be in-flow. Absolute #hdr + hidden map gives #mapArea
   zero height, so #cp / #cpHead ride up under the site header and overlap. */
body.list-mode #hdr {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding: 0 4px 6px;
    z-index: 2;
    background: var(--W);
}

/* List: calm toolbar on white (subtle pill, not map glass) */
body.list-mode .hdr-bar__top-pill {
    padding: 6px 8px;
    gap: 6px;
    background: var(--W);
    border: 1px solid var(--BR);
    box-shadow: 0 1px 4px rgba(28, 24, 41, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.list-mode .hdr-bar__kind {
    background: var(--W);
    border-color: rgba(226, 223, 236, 0.95);
}

body.list-mode #cpHead {
    flex-shrink: 0;
    margin-inline: clamp(10px, 2vw, 22px);
    margin-top: 0;
    margin-bottom: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--W);
    border: 1px solid var(--BR);
    box-shadow: 0 1px 6px rgba(28, 24, 41, 0.05);
}

body.list-mode #cards {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(10px, 2vw, 16px);
    padding: 4px clamp(8px, 1.8vw, 20px) 10px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    align-content: start;
    background: var(--W);
}

/* Tablet/laptop: keep readable card width */
@media (max-width: 1200px) {
    body.list-mode #cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Single row: [Prev] [Page x of y] [Next] — nowrap so mobile does not stack */
body.list-mode .map-listing-pagination {
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin: 4px 0 12px;
    padding: 0 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.list-mode .map-listing-pagination__btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--BR);
    background: var(--W);
    color: var(--PD);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(28, 24, 41, 0.06);
    white-space: nowrap;
}

body.list-mode .map-listing-pagination__btn:hover:not(:disabled) {
    border-color: var(--PD);
}

body.list-mode .map-listing-pagination__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.list-mode .map-listing-pagination__status {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--fs-sm);
    color: var(--M);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-inline: 4px;
}

@media (min-width: 900px) {
    body.list-mode .map-listing-pagination {
        align-self: center;
        max-width: 420px;
        margin-inline: auto;
        padding: 0 clamp(8px, 2vw, 20px);
    }

    body.list-mode .map-listing-pagination__btn {
        padding: 10px 18px;
        border-radius: 12px;
    }
}

#cpHead {
    padding: 10px 14px;
    border-bottom: 1px solid var(--BR);
    background: var(--W);
    font-size: var(--fs-sm);
    color: var(--M);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    #cpHead b {
        color: var(--PD)
    }

#cards {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1
}

    #cards::-webkit-scrollbar {
        width: 3px
    }

    #cards::-webkit-scrollbar-thumb {
        background: var(--BR);
        border-radius: 3px
    }

/* card */
.card {
    background: var(--W);
    border-radius: var(--r);
    border: 1.5px solid transparent;
    display: flex;
    flex-direction: row; /* LTR: image on left, content on right */
    overflow: hidden;
    cursor: pointer;
    transition: border-color .18s,box-shadow .18s,transform .15s;
    animation: up .22s ease both;
    min-height: 120px;
}

@keyframes up {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

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

@keyframes pulse {
    0%, 100% {
        opacity: .3
    }

    50% {
        opacity: .7
    }
}

.card:hover {
    border-color: var(--PM);
    box-shadow: 0 4px 20px rgba(107,93,139,.13);
    transform: translateY(-1px)
}

.card.on {
    border-color: var(--P);
    box-shadow: 0 0 0 3px rgba(107,93,139,.12)
}

.cthumb {
    width: 120px;
    flex-shrink: 0;
    align-self: stretch;
    position: relative;
    overflow: hidden;
    background: var(--PL)
}

    .cthumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .3s;
        display: block
    }

.card:hover .cthumb img {
    transform: scale(1.05)
}

.cbadge {
    position: absolute;
    top: 6px;
    left: 6px; /* LTR: badge on top left */
    height: 18px;
    padding: 0 7px;
    border-radius: 100px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    display: flex;
    align-items: center;
}

.br {
    background: var(--P);
    color: #fff
}

.bb {
    background: #1c1829;
    color: #fff
}

.bd {
    background: #d97706;
    color: #fff
}

.cinfo {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    text-align: left; /* LTR: left align text */
    direction: ltr; /* LTR: left-to-right direction */
}

.ctitle {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);    /* 700 — matches AqaryonHome card title weight */
    color: var(--T);
    line-height: 1.4;
    text-align: left; /* LTR: left align title */
}

.ctags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-start; /* LTR: align tags to left */
}

.ctag {
    height: 21px;
    padding: 0 8px;
    border-radius: 5px;
    background: var(--PL);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);  /* 500 — matches AqaryonHome stats/body weight */
    color: var(--PD);
    display: flex;
    align-items: center;
    direction: ltr; /* LTR: ensure icons/text flow left-to-right */
}

.cloc {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);  /* 500 — matches AqaryonHome location weight */
    color: var(--M);
    display: flex;
    align-items: center;
    gap: 3px;
    direction: ltr; /* LTR: location text left-to-right */
    justify-content: flex-start; /* LTR: align location to left */
}

.cprow {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: auto;
    padding-top: 4px;
    direction: ltr; /* LTR: price row left-to-right */
    justify-content: flex-start; /* LTR: align price to left */
}

.cprice {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--PD)
}

.cunit {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);  /* 500 */
    color: var(--F)
}

/* ── Full list cards (grid tiles: 2–3 per row on desktop, slightly compact) ── */
.card--listing {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--W);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(28, 24, 41, 0.08);
    border: 1px solid rgba(226, 223, 236, 0.95);
    direction: rtl;
    text-align: right;
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
}

/* Must stay column in RTL: [dir="rtl"] .card:not(.card--listing) uses row-reverse and would hide body */
[dir="rtl"] .card.card--listing {
    flex-direction: column;
}

html[dir="ltr"] .card--listing {
    direction: ltr;
    text-align: left;
}

.card--listing:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(28, 24, 41, 0.14);
}

.card__media {
    position: relative;
    aspect-ratio: 5 / 3;
    flex-shrink: 0;
    background: var(--PL);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card__fav {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 12px rgba(28, 24, 41, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--T);
    transition: transform 0.15s, color 0.15s;
    z-index: 2;
}

html[dir="ltr"] .card__fav {
    left: auto;
    right: 8px;
}

.card__fav svg {
    width: 17px;
    height: 17px;
}

.card__fav:hover {
    color: #e11d48;
}

.card--listing.is-fav .card__fav {
    color: #e11d48;
}

.card__type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(28, 24, 41, 0.78);
    color: #fff;
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(28, 24, 41, 0.24);
}

html[dir="rtl"] .card__type-badge {
    left: auto;
    right: 8px;
}

.card__type-badge--buy {
    background: rgba(25, 112, 55, 0.84);
}

.card__type-badge--rent {
    background: rgba(107, 91, 149, 0.88);
}

.card__type-badge--daily {
    background: rgba(192, 112, 20, 0.9);
}

.card__featured {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--P);
    color: #fff;
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    box-shadow: 0 2px 10px rgba(107, 91, 149, 0.35);
}

html[dir="ltr"] .card__featured {
    right: auto;
    left: 8px;
}

.card__dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 2;
    pointer-events: none;
}

.card__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}

.card__dot.is-on {
    background: #fff;
    width: 7px;
    height: 7px;
}

.card__body {
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.card__title {
    margin: 0;
    font-size: clamp(17px, 2.8vw, 20px);
    font-weight: var(--fw-bold);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    color: #111111;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__price {
    margin: 0;
    font-size: clamp(13px, 1.9vw, 15px);
    font-weight: var(--fw-semibold);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    color: #111111;
    letter-spacing: -0.01em;
}

/*
  Shared/typography.css targets [class*="card"] h3 and [class*="card"] p with !important,
  which matches .card--listing (class contains "card") and overrides size/weight/font here.
*/
#ws .card--listing h3.card__title,
#cp .card--listing h3.card__title,
#pincard .card--listing h3.card__title,
.map-listing-shell .card--listing h3.card__title {
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif !important;
    font-size: clamp(17px, 2.8vw, 20px) !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #111111 !important;
}

#ws .card--listing p.card__price,
#cp .card--listing p.card__price,
#pincard .card--listing p.card__price,
.map-listing-shell .card--listing p.card__price {
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif !important;
    font-size: clamp(13px, 1.9vw, 15px) !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #111111 !important;
    letter-spacing: -0.01em;
}

#ws .card--listing .card__spec,
#cp .card--listing .card__spec,
#pincard .card--listing .card__spec,
.map-listing-shell .card--listing .card__spec {
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #111111 !important;
}

#ws .card--listing .card__spec-ic,
#cp .card--listing .card__spec-ic,
#pincard .card--listing .card__spec-ic,
.map-listing-shell .card--listing .card__spec-ic {
    color: #111111 !important;
    opacity: 0.88 !important;
}

#ws .card--listing .card__loc,
#cp .card--listing .card__loc,
#pincard .card--listing .card__loc,
.map-listing-shell .card--listing .card__loc {
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #111111 !important;
}

.card__specs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    justify-content: flex-start;
}

html[dir="ltr"] .card__specs {
    justify-content: flex-start;
}

.card__spec {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: var(--fw-medium);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    color: var(--T);
}

.card__spec-ic {
    display: flex;
    color: var(--T);
    opacity: 0.85;
}

.card__spec-ic svg {
    width: 15px;
    height: 15px;
}

.card__loc {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: var(--fw-medium);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    color: var(--T);
    margin-top: 0;
    line-height: 1.3;
}

.card__loc svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.card__foot {
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--BR);
    flex-shrink: 0;
    /* Same pixel box for partner mark, message, and WhatsApp (avoid uneven optical multipliers) */
    --card-foot-ic: 24px;
    --foot-mul-brand: 1;
    --foot-mul-chat: 1;
    --foot-mul-wa: 1;
}

.card__foot-btn {
    flex: 1;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--W);
    color: var(--T);
    font-family: 'Rubik', 'Segoe UI', system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-inline-end: 1px solid var(--BR);
}

.card__foot-btn:last-child {
    border-inline-end: none;
}

.card__foot-btn:hover {
    background: var(--PL);
    color: var(--PD);
}

/* Partner logo is not a link — no pointer / hover affordance */
.card__foot-btn--brand-static {
    cursor: default;
}

.card__foot-btn--brand-static:hover {
    background: var(--W);
    color: var(--T);
}

.card__foot-btn img {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
}

.card__foot-btn--brand img,
.card__foot-btn--brand .card__partner-logo-img {
    width: calc(var(--card-foot-ic) * var(--foot-mul-brand));
    height: calc(var(--card-foot-ic) * var(--foot-mul-brand));
    max-width: calc(var(--card-foot-ic) * var(--foot-mul-brand));
    max-height: calc(var(--card-foot-ic) * var(--foot-mul-brand));
}

/* Partner mark: round circle (same footprint as message / WA icons) */
.card__foot-btn--brand .card__partner-logo-img {
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: var(--PL, #f3f2f6);
}

.card__foot-btn--brand .card__partner-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--card-foot-ic) * var(--foot-mul-brand));
    height: calc(var(--card-foot-ic) * var(--foot-mul-brand));
    border-radius: 50%;
    background: var(--PL, #f3f2f6);
    color: var(--PD, #6b5b95);
    overflow: hidden;
    flex-shrink: 0;
}

.card__foot-btn--brand .card__partner-logo-fallback svg {
    width: calc(var(--card-foot-ic) * var(--foot-mul-brand) * 0.62);
    height: calc(var(--card-foot-ic) * var(--foot-mul-brand) * 0.62);
}

/* Shown when partner image URL fails to load (404, invalid, etc.) */
.card__foot-btn--brand .card__partner-logo-fallback.card__partner-logo-fallback--hide {
    display: none !important;
}

.card__partner-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    line-height: 0;
    vertical-align: middle;
}

.card__foot-btn svg {
    flex-shrink: 0;
    display: block;
}

.card__foot-btn--chat svg {
    width: calc(var(--card-foot-ic) * var(--foot-mul-chat));
    height: calc(var(--card-foot-ic) * var(--foot-mul-chat));
}

.card__foot-btn--wa svg {
    width: calc(var(--card-foot-ic) * var(--foot-mul-wa));
    height: calc(var(--card-foot-ic) * var(--foot-mul-wa));
}

.card__foot-btn--wa {
    color: #20bd5a;
}

.card__foot-btn--wa:hover {
    color: #16924a;
    background: rgba(32, 189, 90, 0.08);
}

.skel--listing {
    flex-direction: column;
    height: auto;
    min-height: 240px;
}

.skel--listing .skel-media {
    width: 100%;
    aspect-ratio: 5 / 3;
    background: var(--BR);
    animation: pulse 1.2s infinite;
    border-radius: 14px 14px 0 0;
}

.skel--listing .skel-info {
    padding: 10px 12px;
}

.skel--listing .skel-foot {
    height: 44px;
    margin-top: auto;
    border-top: 1px solid var(--BR);
    background: var(--BR);
    animation: pulse 1.2s infinite;
}

/* empty */
.empty {
    text-align: center;
    padding: 50px 20px;
    /* span all grid columns so it centres across the full list panel */
    grid-column: 1 / -1;
    width: 100%;
}

    .empty div:first-child {
        font-size: 36px;
        margin-bottom: 12px
    }

    .empty h3 {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 6px
    }

    .empty p {
        font-size: 12px;
        color: var(--M);
        line-height: 1.7
    }

/* skeleton */
.skel {
    background: var(--W);
    border-radius: var(--r);
    border: 1.5px solid transparent;
    display: flex;
    flex-direction: row-reverse;
    overflow: hidden;
    height: 110px;
}

.skel-thumb {
    width: 110px;
    flex-shrink: 0;
    background: var(--BR);
    animation: pulse 1.2s infinite
}

.skel-info {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.skel-line {
    border-radius: 6px;
    background: var(--BR);
    animation: pulse 1.2s infinite
}

/* ─────────── DESKTOP LIST-ONLY MODE ─────────── */
/* In list mode, revert #ws to normal document flow so
   it has natural height and doesn't cover the footer.   */
#ws.lo {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60vh;
    z-index: auto !important;
    /* Document-flow list page: body/shell handle gutters; no double inset */
    padding-bottom: 0 !important;
}

body.list-mode #ws.lo {
    min-height: calc(100vh - 152px);
    min-height: calc(100dvh - 152px);
    background: var(--W);
}

/* Let the panel grow with content; desktop max-height clipped the shell */
body.list-mode #ws.lo .map-listing-shell {
    max-height: none;
    margin-top: 50px;
    margin-bottom: 50px;
}

/* list-only (#ws.lo) rules removed — map is always shown */

/* ─────────── TABLET — shell + split panel breathe on mid-width viewports ─────────── */
@media (max-width: 1024px) {
    #cp {
        width: min(340px, 46vw);
    }

    body.list-mode .map-listing-shell {
        width: calc(100% - 2 * var(--ml-gutter));
        max-width: min(var(--ml-shell-max), calc(100vw - 2 * var(--ml-gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    }

    .hdr-bar__top-pill {
        flex-wrap: wrap;
        row-gap: 8px;
    }
}

/* ─────────── MOBILE ─────────── */
@media(max-width:768px) {
    /* Outer card on map only (list mode uses the white shell — avoids double boxes) */
    body:not(.list-mode) .hdr-bar-mobile-shell {
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.97);
        border: 1px solid rgba(226, 223, 236, 0.98);
        border-radius: 14px;
        box-shadow: 0 8px 28px rgba(28, 24, 41, 0.14);
        max-width: 100%;
        /* overflow visible so property-type dropdown isn’t clipped */
        overflow: visible;
    }

    body.list-mode .hdr-bar-mobile-shell {
        padding: 0;
        max-width: 100%;
        overflow: visible;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    body:not(.list-mode) #hdr {
        padding: 10px max(10px, env(safe-area-inset-left, 0px)) 0 max(10px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .hdr-bar {
        align-items: stretch;
        max-width: 100%;
        width: 100%;
    }

    /* Inner: 2 rows — kind row, then [property type | filter | map/list] (toggle at end; type gets 1fr) */
    .hdr-bar__top-pill {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "mlKind mlKind mlKind"
            "mlTypes mlFilter mlView";
        align-items: center;
        column-gap: 8px;
        row-gap: 10px;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        white-space: normal;
        overflow: visible;
        box-sizing: border-box;
    }

    .hdr-bar__kind {
        grid-area: mlKind;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        /* Keep chips on one row; scroll horizontally if needed */
        display: flex;
        align-items: center;
    }

    .hdr-bar__kind::-webkit-scrollbar {
        display: none;
    }

    .hdr-bar__kind-btn {
        flex: 0 0 auto;
        padding: 8px 8px;
        font-size: 12px;
        gap: 4px;
    }

    .hdr-bar__pt-wrap {
        grid-area: mlTypes;
        min-width: 0;
        max-width: 100%;
        flex: none;
        min-height: 40px;
    }

    .hdr-bar__view-wrap {
        grid-area: mlView;
        width: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        justify-self: end;
        flex-shrink: 0;
    }

    /* Trailing control: keep “List” / “Map” visible; compact next to filter */
    .hdr-bar__view-toggle {
        position: relative;
        padding: 8px 10px;
        min-height: 40px;
        gap: 6px;
        font-size: 12px;
    }

    .hdr-bar__view-toggle-text {
        white-space: nowrap;
    }

    .hdr-bar__filter {
        grid-area: mlFilter;
        justify-self: end;
        align-self: center;
        width: max-content;
        max-width: 100%;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .hdr-bar__pt-trigger {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .hdr-bar__pt-trigger-text {
        font-size: 12px;
    }

    /* List mode: same 2-row grid (kind, then type + filter + view at end) */
    body.list-mode .hdr-bar__top-pill {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "mlKind mlKind mlKind"
            "mlTypes mlFilter mlView";
        align-items: center;
        column-gap: 8px;
        row-gap: 10px;
        width: 100%;
        max-width: 100%;
        /* Slightly tighter horizontal padding so the kind row can fit “Daily Booking” on small phones */
        padding: 10px 8px;
        white-space: normal;
        border-radius: 14px;
        background: var(--W);
        border: 1px solid var(--BR);
        box-shadow: 0 1px 4px rgba(28, 24, 41, 0.06);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /*
     * List mode: don’t use space-between — it injects huge gaps between chips (English LTR) and
     * truncates the last label (“Daily Booking”). Keep gaps + chip padding minimal on narrow widths.
     */
    body.list-mode .hdr-bar__kind {
        justify-content: flex-start;
        gap: 2px;
    }

    body.list-mode .hdr-bar__kind-btn {
        padding: 8px 5px;
        gap: 3px;
    }

    /* Arabic (RTL): slight bump vs LTR — too much padding caused “حجز يومي” to clip */
    html[dir="rtl"] body.list-mode .hdr-bar__top-pill {
        padding: 10px 8px;
    }

    html[dir="rtl"] body.list-mode .hdr-bar__kind {
        gap: 3px;
    }

    html[dir="rtl"] body.list-mode .hdr-bar__kind-btn {
        padding: 8px 6px;
        gap: 4px;
    }

    #ws.lo #cp {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #ws.lo #cpHead {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Map full screen when not in list mode */
    body:not(.list-mode) #mapArea,
    body:not(.list-mode) #cp {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100%;
    }

    body:not(.list-mode) #mapArea {
        z-index: 2;
    }

    /* List view: full-screen feed; mapArea is toolbar-only chrome */
    body.list-mode #ws.lo {
        flex-direction: column;
        min-height: auto;
    }

    body.list-mode .map-listing-shell {
        width: 100%;
        max-width: var(--ml-shell-max);
        margin: 6px auto 0;
        padding: 8px 4px 10px;
        border-radius: 16px;
    }

    body.list-mode #hdr {
        padding: 0 0 4px;
    }

    /* Shell sits below #mainHeader in document flow — large margin-top duplicated whitespace on phones */
    body.list-mode #ws.lo .map-listing-shell {
        max-height: none;
        margin-top: 0;
        margin-bottom: 40px;
    }

    body.list-mode #mapArea {
        position: relative !important;
        height: auto !important;
        min-height: 0 !important;
        flex: 0 0 auto !important;
        padding: 8px 8px 10px;
        background: var(--W);
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--BR);
    }

    body.list-mode #cp {
        position: relative !important;
        width: 100% !important;
        height: auto;
        flex: 1 1 auto;
        min-height: 50vh;
        border-inline-end: none;
        overflow: hidden;
        background: var(--W);
        border-radius: 0;
        border: none;
        padding-top: 10px;
        padding-bottom: 14px;
        gap: 12px;
    }

    /* Don’t let the old full-bleed #cpHead hack collapse list-mode spacing */
    body.list-mode #ws.lo #cpHead {
        margin-left: 12px;
        margin-right: 12px;
    }

    body.list-mode #cards {
        grid-template-columns: 1fr;
        max-width: 100%;
        padding: 6px 12px 10px;
        gap: 10px;
    }

    body.list-mode .map-listing-pagination {
        padding: 0 10px;
        gap: 4px;
        margin-bottom: 10px;
    }

    body.list-mode .map-listing-pagination__btn {
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 10px;
    }

    body.list-mode .map-listing-pagination__status {
        font-size: 12px;
    }

    @media (min-width: 480px) {
        body.list-mode #cards {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    /* Full-bleed map on narrow screens; list mode keeps readable side margins */
    body.list-mode {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    }
}

/* Stack All Types + City dropdowns vertically on very small screens */
@media(max-width:400px) {
    .fdr-row {
        flex-direction: column;
    }
}

/* #mtbar rule removed — element no longer exists */

/* ─────────── FILTER OVERLAY ─────────── */
#fov {
    position: fixed;
    inset: 0;
    background: var(--W);
    z-index: 99999; /* Must be above the site's fixed navbar (which uses z-index: 99997) */
    display: flex;
    flex-direction: column;
    direction: rtl;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    /* Respect iOS notch / status bar */
    padding-top: env(safe-area-inset-top, 0px);
}

    /* Open state: avoid transform so mobile WebKit can position in-modal UI correctly (native <select> was broken). */
    #fov.on {
        transform: none;
    }

.fhd {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--BR);
    background: var(--W);
}

.fhd-t {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--T)
}

.fcls {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1.5px solid var(--BR);
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--M);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s
}

    .fcls:hover {
        border-color: var(--P);
        color: var(--P)
    }

.fbody {
    flex: 1;
    overflow-y: auto;
    /* Reserve space so a scrollbar appearing doesn’t narrow the row and “shrink” the dropdowns */
    scrollbar-gutter: stable;
    padding: 4px 20px 28px;
    -webkit-overflow-scrolling: touch;
}

@supports not (scrollbar-gutter: stable) {
    .fbody {
        overflow-y: scroll;
    }
}

    .fbody::-webkit-scrollbar {
        width: 3px
    }

    .fbody::-webkit-scrollbar-thumb {
        background: var(--BR);
        border-radius: 3px
    }

.fsec {
    margin-top: 22px
}

.flbl {
    display: block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--F);
    margin-bottom: 10px
}

/* Two-column row for All Types + City dropdowns */
.fdr-row {
    display: flex;
    gap: 12px;
}

.fdr-col {
    flex: 1;
    min-width: 0;
}

/* City, District, Property type — one row, equal thirds */
.fdr-row--filters3 {
    gap: 10px;
}

.fdr-row--filters3 .fdr-col {
    flex: 1 1 0;
    min-width: 0;
}

    .fdr-col .flbl {
        margin-bottom: 8px;
    }

/* City/type select inside filter overlay */
.fcity-sg {
    margin-top: 2px;
}

/* Custom dropdown (Property type + City): full-width panel, matches district picker */
#fov .map-filter-select {
    position: relative;
    width: 100%;
    min-width: 0;
}

#fov .map-filter-select__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    white-space: nowrap !important;
}

#fov .map-filter-select__trigger {
    width: 100%;
    /* Lock outer box: auto height + vertical padding caused subpixel shifts; match district (44px) */
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    margin: 0;
    border: 1.5px solid var(--BR);
    border-style: solid;
    border-radius: 10px;
    padding: 0 28px 0 30px;
    font-family: 'Rubik', sans-serif;
    font-size: 16px;
    font-weight: var(--fw-medium);
    color: var(--T);
    text-align: start;
    background-color: var(--BG);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b5d8b'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    /* Instant border — animated border-color reads as “fluctuation” on click */
    transition: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

/* Native <button> padding/border quirks (esp. Firefox) — avoid 1px “jump” on press */
#fov .map-filter-select__trigger::-moz-focus-inner {
    border: 0;
    padding: 0;
}

#fov .map-filter-select__trigger:hover,
#fov .map-filter-select__trigger:focus,
#fov .map-filter-select__trigger[aria-expanded="true"] {
    border-color: var(--P);
}

/* Keyboard focus ring without extra outline (outline caused perceived resize before) */
#fov .map-filter-select__trigger:focus-visible {
    outline: none;
    border-color: var(--P);
}

/* UA :active can darken background — keep stable so height doesn’t flicker */
#fov .map-filter-select__trigger:active {
    background-color: var(--BG);
    border-color: var(--P);
}

#fov .map-filter-select__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

#fov .map-filter-select__menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    max-height: min(52vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--W);
    border: 1.5px solid var(--BR);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(17, 17, 17, 0.16);
}

#fov .map-filter-select__search-row {
    list-style: none;
    margin: -6px 0 0;
    padding: 0;
    border-bottom: 1px solid var(--BR);
    position: sticky;
    top: -6px;
    background: var(--W);
    z-index: 1;
}

#fov .map-filter-select__search {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    padding: 10px 14px;
    margin: 0;
    font-family: 'Rubik', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--T);
    background: var(--W);
    outline: none;
}

#fov .map-filter-select__search::placeholder {
    color: var(--PD);
    opacity: 0.75;
}

#fov .map-filter-select__search:focus {
    box-shadow: inset 0 0 0 2px rgba(107, 93, 139, 0.2);
}

#fov .map-filter-select__optgroup {
    padding: 10px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--PD);
    background: var(--PL);
    border-bottom: 1px solid var(--BR);
    pointer-events: none;
}

#fov .map-filter-select__option {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--T);
    cursor: pointer;
    transition: background .12s;
}

#fov .map-filter-select__option:hover,
#fov .map-filter-select__option:focus-visible {
    background: rgba(107, 93, 139, 0.08);
}

#fov .map-filter-select__option.is-selected {
    background: rgba(107, 93, 139, 0.14);
    font-weight: 600;
    color: var(--PD);
}

#fov .map-filter-select__option.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

[dir="rtl"] #fov .map-filter-select__trigger {
    padding: 0 30px 0 28px;
    background-position: left 10px center;
}

    .fcity-sg select.map-filter-select__native {
        background-color: transparent;
    }

    .fcity-sg select:not(.map-filter-select__native) {
        background-color: var(--BG);
    }

    .fcity-sg select:not(.map-filter-select__native):focus {
        background-color: var(--W);
    }

    /* Property type optgroups: segmentation headers — same or larger than options, bold */
    .fcity-sg select optgroup {
        font-family: 'Rubik', sans-serif;
        font-size: var(--fs-sm);
        font-weight: 700;
        color: var(--PD);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 10px 10px 6px 10px;
        margin-top: 8px;
        border: none;
        border-top: 1px solid var(--BR);
        background: var(--PL);
    }
    .fcity-sg select optgroup:first-of-type {
        margin-top: 0;
        border-top: none;
        padding-top: 8px;
    }
    .fcity-sg select option {
        font-size: var(--fs-xs);
        font-weight: 500;
        color: var(--T);
        padding: 8px 10px 8px 12px;
        background: var(--W);
    }

/* District multi-select dropdown with checkboxes */
.district-multi {
    position: relative;
}

.district-multi__trigger {
    width: 100%;
    height: 44px;
    max-height: 44px;
    box-sizing: border-box;
    margin: 0;
    border: 1.5px solid var(--BR);
    border-style: solid;
    border-radius: 10px;
    background: var(--BG);
    font-family: 'Rubik',sans-serif;
    font-size: var(--fs-base);
    color: var(--T);
    text-align: start;
    padding: 0 34px 0 30px;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    transition: none;
}

#fov .district-multi__trigger::-moz-focus-inner {
    border: 0;
    padding: 0;
}

#fov .district-multi__trigger:hover,
#fov .district-multi__trigger:focus,
#fov .district-multi__trigger[aria-expanded="true"] {
    border-color: var(--P);
}

#fov .district-multi__trigger:focus-visible {
    outline: none;
    border-color: var(--P);
}

#fov .district-multi__trigger:active {
    background-color: var(--BG);
    border-color: var(--P);
}

.district-multi__panel {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--W);
    border: 1.5px solid var(--BR);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(17,17,17,.12);
    max-height: 230px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Author `display: flex` above overrides the HTML [hidden] UA rule — panel stayed visible while closed. */
.district-multi__panel[hidden] {
    display: none !important;
}

#fov .district-multi__search {
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    border: none;
    border-bottom: 1px solid var(--BR);
    border-radius: 12px 12px 0 0;
    padding: 10px 12px;
    margin: 0;
    font-family: 'Rubik', sans-serif;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--T);
    background: var(--W);
    outline: none;
}

#fov .district-multi__search::placeholder {
    color: var(--PD);
    opacity: 0.75;
}

#fov .district-multi__search:focus {
    box-shadow: inset 0 0 0 2px rgba(107, 93, 139, 0.2);
}

.district-multi__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

.district-multi__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.district-multi__item:hover {
    background: var(--PL);
}

.district-multi__item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--P);
    flex-shrink: 0;
}

/* Advanced filter listing-type chips: same icon language as map toolbar */
.fc-kind {
    gap: 6px;
}

.fc-kind .fc-ic {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-block;
    color: currentColor;
}

.fprow {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.fpi {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1.5px solid var(--BR);
    border-radius: 10px;
    padding: 0 12px;
    font-family: 'Rubik',sans-serif;
    font-size: var(--fs-base);
    color: var(--T);
    background: var(--BG);
    outline: none;
    text-align: center;
    direction: ltr;
    transition: border-color .15s;
}

    .fpi:focus {
        border-color: var(--P);
        background: var(--W)
    }

/* Mobile: keep price inputs fully visible and avoid right-side clipping */
@media (max-width: 768px) {
    .fbody {
        padding-left: 14px;
        padding-right: 14px;
    }

    .fprow {
        flex-wrap: wrap;
        gap: 8px;
    }

    .fpi {
        flex: 1 1 100%;
        width: 100%;
    }
}

.fchips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px
}

.fc {
    height: 36px;
    padding: 0 16px;
    border-radius: 100px;
    border: 1.5px solid var(--BR);
    background: var(--W);
    font-family: 'Rubik',sans-serif;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);   /* 500 — body text weight */
    color: var(--M);
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
}

    .fc:active {
        transform: scale(.95)
    }

    .fc.on {
        background: var(--P);
        border-color: var(--P);
        color: #fff
    }

.fcks {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.fck {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--T);
    cursor: pointer;
    padding: 2px 0
}

    .fck input[type=checkbox] {
        accent-color: var(--P);
        width: 18px;
        height: 18px;
        flex-shrink: 0
    }

.fslider {
    width: 100%;
    accent-color: var(--P);
    cursor: pointer;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 4px
}

.fsllbl {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--F)
}

.fdiv {
    height: 1px;
    background: var(--BR);
    margin-top: 24px
}

.fft {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--BR);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--W)
}

.fapply {
    width: 100%;
    height: 48px;
    background: var(--P);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Rubik',sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s
}

    .fapply:active {
        background: var(--PD)
    }

.freset {
    width: 100%;
    height: 40px;
    background: none;
    border: 1.5px solid var(--BR);
    border-radius: 12px;
    font-family: 'Rubik',sans-serif;
    font-size: 14px;
    color: var(--M);
    cursor: pointer;
    transition: border-color .15s
}

    .freset:hover {
        border-color: var(--P);
        color: var(--P)
    }

/* Footer actions: full-width stack on phones; compact row on tablet/desktop */
@media (min-width: 600px) {
    .fft {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
    }

    .fapply,
    .freset {
        width: auto;
        flex: 0 0 auto;
    }

    .fapply {
        min-width: 160px;
        padding-left: 28px;
        padding-right: 28px;
    }

    .freset {
        min-width: 120px;
        height: 48px;
        padding-left: 22px;
        padding-right: 22px;
    }
}

/* LTR: secondary (Reset) before primary (Show Results) at the trailing edge */
@media (min-width: 600px) {
    [dir="ltr"] .fft .freset {
        order: 1;
    }

    [dir="ltr"] .fft .fapply {
        order: 2;
    }

    /* RTL: main axis runs R→L — flex-end packs the row toward physical left (bottom-left corner). */
    [dir="rtl"] .fft {
        justify-content: flex-end;
    }

    /* RTL: primary first on the reading side — Show Results on physical left, Reset on the right of the pair */
    [dir="rtl"] .fft .freset {
        order: 1;
    }

    [dir="rtl"] .fft .fapply {
        order: 2;
    }
}

/* LTR overrides for filter overlay */
[dir="ltr"] #fov {
    direction: ltr; /* LTR: left-to-right direction */
}

[dir="ltr"] .fcity-sg i {
    left: 10px;
    right: auto;
}

[dir="ltr"] .fcity-sg select {
    padding: 0 24px 0 30px;
    background-position: right 8px center;
    text-align: left;
    direction: ltr;
}

[dir="ltr"] #fov .map-filter-select__trigger {
    padding: 0 28px 0 30px;
    background-position: right 10px center;
    text-align: left;
    direction: ltr;
}

[dir="rtl"] .fcity-sg i {
    left: auto;
    right: 10px;
}

[dir="rtl"] .fcity-sg select {
    padding: 0 30px 0 24px;
    background-position: left 8px center;
    text-align: right;
    direction: rtl;
}

[dir="ltr"] .fhd {
    flex-direction: row; /* LTR: normal header layout (title left, close right) */
}

[dir="ltr"] .fhd-t {
    text-align: left; /* LTR: left align title */
}

[dir="ltr"] .fbody {
    direction: ltr; /* LTR: left-to-right for body */
}

[dir="ltr"] .flbl {
    text-align: left; /* LTR: left align labels */
    direction: ltr; /* LTR: left-to-right direction */
}

[dir="ltr"] .fprow {
    direction: ltr; /* LTR: normal input row order */
}

[dir="ltr"] .fpi {
    text-align: left; /* LTR: left align input text */
    direction: ltr; /* LTR: left-to-right for numbers */
}

[dir="ltr"] .fchips {
    justify-content: flex-start; /* LTR: align chips to left */
    direction: ltr; /* LTR: left-to-right direction */
}

[dir="ltr"] .fc {
    text-align: left; /* LTR: left align chip text */
    direction: ltr; /* LTR: left-to-right direction */
}

[dir="ltr"] .fcks {
    direction: ltr; /* LTR: left-to-right for checkboxes container */
}

[dir="ltr"] .fck {
    text-align: left; /* LTR: left align checkbox labels */
    direction: ltr; /* LTR: left-to-right direction */
    flex-direction: row; /* LTR: checkbox on left, label on right */
}

[dir="ltr"] .fslider,
[dir="rtl"] .fslider {
    direction: ltr; /* Slider always LTR: min (50) left, max (1000) right */
}

[dir="ltr"] .fsllbl,
[dir="rtl"] .fsllbl {
    direction: ltr; /* Labels always LTR: 50 left, current middle, 1000 right */
    flex-direction: row;
}

[dir="ltr"] .fsllbl {
    text-align: left; /* LTR: left align text */
}

[dir="rtl"] .fsllbl {
    text-align: left; /* Keep label row LTR-aligned so 50 | value | 1000 order is clear */
}

[dir="rtl"] .fsllbl #fAreaLbl {
    unicode-bidi: plaintext; /* Allow Arabic numerals (e.g. ٧٥٤) to display correctly */
}

[dir="ltr"] .fft {
    direction: ltr; /* LTR: left-to-right for footer */
}

[dir="ltr"] .fapply,
[dir="ltr"] .freset {
    text-align: center; /* Center align button text (same for both) */
    direction: ltr; /* LTR: left-to-right direction */
}
