/* ==========================================================================
   konutpazari.com v2.0 — International PropTech Marketplace Stylesheet
   Inspired by Zillow, Airbnb, Redfin & Hepsiemlak + Uiverse micro-craft
   ========================================================================== */

:root {
    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFC;
    --line: #E5E9F0;
    --line-strong: #CBD5E1;

    --ink: #0F172A;
    --ink-2: #475569;
    --ink-3: #64748B;

    --dark: #111927;
    --dark-2: #1E293B;

    --brand: #E11D2E;
    --brand-hover: #C81525;
    --brand-soft: #FFF1F2;
    --brand-line: #FECDD3;

    --gold: #F5B700;
    --gold-ink: #92400E;
    --gold-soft: #FFFBEB;
    --gold-line: #FDE68A;

    --green: #059669;
    --green-hover: #047857;
    --green-soft: #ECFDF5;
    --green-line: #A7F3D0;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;

    --sh-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --sh-sm: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
    --sh-md: 0 12px 30px -6px rgba(15, 23, 42, 0.10), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
    --sh-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.22);

    --font-head: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip; /* CRITICAL: preserves position:sticky across Chrome/Safari */
}

h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-head);
    letter-spacing: -0.025em;
    color: var(--ink);
    line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.num {
    font-family: var(--font-head);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

.ico { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

.container {
    width: 100%;
    max-width: 1340px;
    margin: 0 auto;
    padding: 0 20px;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ==========================================================================
   TOP BAR & STICKY HEADER
   ========================================================================== */
.topbar {
    background: var(--dark);
    color: #CBD5E1;
    font-size: 12.5px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px;
}
.topbar-left { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.topbar-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}
.topbar-links { display: flex; align-items: center; gap: 18px; }
.topbar-links a { color: #CBD5E1; transition: color 150ms ease; white-space: nowrap; }
.topbar-links a:hover { color: #FFFFFF; }
.topbar-links .hl-gold { color: var(--gold); font-weight: 700; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 65;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 70px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex: none;
}
.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #E11D2E 0%, #B91C1C 100%);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(225, 29, 46, 0.28);
}
.brand-text {
    font-family: var(--font-head);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--ink);
}
.brand-text span { color: var(--brand); }

/* Header Integrated Search Pill (Airbnb / Zillow inspired) */
.header-search {
    flex: 1;
    max-width: 580px;
    display: flex;
    align-items: stretch;
    background: var(--surface-2);
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    padding: 3px;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.header-search:focus-within {
    background: #FFFFFF;
    border-color: var(--dark);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.header-search select {
    border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    padding: 0 12px 0 14px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    border-radius: 999px 0 0 999px;
}
.header-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 8px 14px;
    font-size: 14px;
}
.header-search input::placeholder { color: var(--ink-3); }
.header-search-btn {
    border: 0;
    background: var(--dark);
    color: #FFFFFF;
    padding: 0 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 150ms ease, transform 120ms ease;
    white-space: nowrap;
}
.header-search-btn:hover { background: var(--brand); }
.header-search-btn:active { transform: scale(0.97); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}
.icon-pill:hover { border-color: var(--dark); background: var(--surface-2); }
.pill-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-family: var(--font-head);
    font-size: 11px; font-weight: 800;
}

/* Tactile Uiverse-inspired Buttons with Sheen */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 17px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 130ms ease, box-shadow 180ms ease, background 150ms ease, border-color 150ms ease;
}
.btn-primary {
    background: var(--brand);
    color: #FFFFFF;
    box-shadow: 0 2px 0 #991B1B, 0 6px 16px rgba(225, 29, 46, 0.24);
}
.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 550ms ease;
}
.btn-primary:hover {
    background: var(--brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 0 #991B1B, 0 10px 22px rgba(225, 29, 46, 0.30);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 #991B1B; }

.btn-dark {
    background: var(--dark);
    color: #FFFFFF;
    box-shadow: 0 2px 0 #020617;
}
.btn-dark:hover { background: #1E293B; transform: translateY(-1px); }
.btn-dark:active { transform: translateY(1px); }

.btn-green {
    background: var(--green);
    color: #FFFFFF;
    box-shadow: 0 2px 0 #065F46;
}
.btn-green:hover { background: var(--green-hover); transform: translateY(-1px); }
.btn-green:active { transform: translateY(1px); }

.btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--dark); }

.btn-pill { border-radius: 999px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ==========================================================================
   CATEGORY RIBBON + CITY DISCOVERY STRIP
   ========================================================================== */
.cat-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.cat-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    white-space: nowrap;
    transition: all 150ms ease;
}
.cat-item:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.cat-item.is-active { background: var(--dark); color: #FFFFFF; border-color: var(--dark); }
.cat-item .cnt { font-size: 11.5px; opacity: 0.72; font-weight: 700; }
.cat-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }
.cat-item--drop { background: var(--green-soft); color: #065F46; border-color: var(--green-line); }
.cat-item--drop:hover, .cat-item--drop.is-active { background: var(--green); color: #FFFFFF; border-color: var(--green); }
.cat-item--owner { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold-line); }
.cat-item--owner:hover, .cat-item--owner.is-active { background: #D97706; color: #FFFFFF; border-color: #D97706; }

/* Compact Editorial Discovery Strip (Zillow / Airbnb Style — Shown on Clean Home) */
.discovery-band {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 58%, #281B25 100%);
    color: #FFFFFF;
    padding: 24px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.discovery-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.discovery-copy h1 {
    color: #FFFFFF;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.discovery-copy p {
    margin: 5px 0 0;
    color: #CBD5E1;
    font-size: 14.5px;
}
.city-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.city-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.16);
    color: #FFFFFF;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    transition: all 160ms ease;
    white-space: nowrap;
}
.city-pill:hover {
    background: #FFFFFF;
    color: var(--dark);
    transform: translateY(-2px);
}
.city-pill small { opacity: 0.7; font-weight: 600; font-size: 11.5px; }

/* Flash & Alerts */
.flash-banner {
    margin: 16px 0 0;
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.flash-ok { background: var(--green-soft); color: #065F46; border: 1px solid var(--green-line); }
.flash-err { background: var(--brand-soft); color: #991B1B; border: 1px solid var(--brand-line); }
.flash-warn { background: var(--gold-soft); color: var(--gold-ink); border: 1px solid var(--gold-line); }

/* ==========================================================================
   MARKETPLACE MAIN LAYOUT
   ========================================================================== */
.market-wrap {
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr);
    gap: 22px;
    padding: 22px 0 72px;
    align-items: start;
}

.filter-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 18px;
    position: sticky;
    top: 86px;
    max-height: calc(100vh - 102px);
    overflow-y: auto;
    box-shadow: var(--sh-sm);
}
.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.filter-head h2 {
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.filter-clear { font-size: 12.5px; font-weight: 700; color: var(--brand); }
.filter-clear:hover { text-decoration: underline; }

.fg { margin-bottom: 15px; }
.fg-label {
    display: block;
    font-family: var(--font-head);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.045em;
    margin-bottom: 6px;
}
.fg-label .req { color: var(--brand); }

.input, .select, .textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--line-strong);
    background: #FFFFFF;
    font-size: 14px;
    color: var(--ink);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 112px; }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(17, 25, 39, 0.08);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
    border-color: var(--brand);
    background: #FFF9FA;
    box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.10);
}
.field-err {
    margin-top: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
    display: none;
}
.field-err.is-show { display: block; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Sliding Segmented Control */
.seg-control {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 3px;
}
.seg-control label {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 7px 4px;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
    border-radius: 8px;
    transition: color 180ms ease;
    user-select: none;
}
.seg-control input { position: absolute; opacity: 0; pointer-events: none; }
.seg-control input:checked + span { display: block; color: var(--ink); }
.seg-slider {
    position: absolute;
    top: 3px; bottom: 3px; left: 3px;
    width: calc(33.333% - 2px);
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transition: transform 260ms cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: 1;
}

.room-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.room-chip { position: relative; display: block; cursor: pointer; }
.room-chip input { position: absolute; opacity: 0; }
.room-chip span {
    display: flex; align-items: center; justify-content: center;
    height: 33px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: #FFFFFF;
    font-family: var(--font-head);
    font-size: 12.5px; font-weight: 700; color: var(--ink-2);
    transition: all 140ms ease;
}
.room-chip:hover span { border-color: var(--dark); color: var(--ink); }
.room-chip input:checked + span { background: var(--dark); color: #FFFFFF; border-color: var(--dark); }

/* Uiverse Elastic Switch */
.switch-list { display: flex; flex-direction: column; gap: 10px; }
.u-switch {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    user-select: none;
}
.u-switch input { position: absolute; opacity: 0; pointer-events: none; }
.u-track {
    position: relative;
    width: 42px; height: 23px;
    border-radius: 999px;
    background: #CBD5E1;
    transition: background 200ms ease;
    flex: none;
}
.u-track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0,0,0,0.22);
    transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1), width 130ms ease;
}
.u-switch:active .u-track::after { width: 21px; }
.u-switch input:checked + .u-track { background: var(--green); }
.u-switch input:checked + .u-track::after { transform: translateX(19px); }
.u-switch:active input:checked + .u-track::after { transform: translateX(15px); }

/* ==========================================================================
   RESULTS TOOLBAR, INTERACTIVE MAP PANEL & ACTIVE CHIPS
   ========================================================================== */
.results-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 12px 16px;
    margin-bottom: 14px;
    box-shadow: var(--sh-sm);
}
.results-title {
    font-family: var(--font-head);
    font-size: 16.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.results-count { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.results-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.results-controls .select { width: auto; min-width: 190px; height: 36px; font-size: 13px; font-weight: 600; }

.view-toggle {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: #FFFFFF;
}
.view-toggle button {
    border: 0;
    background: transparent;
    width: 36px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3);
    cursor: pointer;
    transition: all 140ms ease;
}
.view-toggle button.is-active { background: var(--dark); color: #FFFFFF; }

.map-toggle-btn {
    height: 36px;
    padding: 0 13px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--dark);
    background: #FFFFFF;
    color: var(--dark);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 150ms ease;
}
.map-toggle-btn:hover, .map-toggle-btn.is-active {
    background: var(--dark);
    color: #FFFFFF;
}

/* Interactive Leaflet Map Container */
.map-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: var(--sh-md);
}
.map-canvas {
    width: 100%;
    height: 430px;
    background: #E8EDF3;
    z-index: 1;
}
.kp-price-pin {
    background: #FFFFFF;
    color: var(--ink);
    border: 1.5px solid rgba(15, 23, 42, 0.22);
    border-radius: 999px;
    padding: 4px 10px;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
    transition: transform 140ms ease, background 140ms ease, color 140ms ease;
}
.kp-price-pin:hover {
    background: var(--brand);
    color: #FFFFFF;
    border-color: var(--brand);
    transform: scale(1.1);
}
.map-popup { width: 220px; font-family: var(--font-body); }
.map-popup img { width: 100%; height: 115px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.map-popup-price { font-family: var(--font-head); font-size: 15px; font-weight: 800; color: var(--ink); }
.map-popup-title { font-weight: 700; font-size: 13px; color: var(--ink-2); margin: 3px 0 6px; display: block; line-height: 1.3; }
.map-popup-title:hover { color: var(--brand); }

.mobile-filter-btn { display: none; }

.active-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 999px;
    background: #FFFFFF; border: 1px solid var(--line-strong);
    font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.filter-chip a { display: inline-flex; color: var(--ink-3); }
.filter-chip a:hover { color: var(--brand); }

/* ==========================================================================
   LISTING CARDS (STRICT PIXEL-ALIGNED GRID + DENSE LIST VIEW)
   ========================================================================== */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, border-color 180ms ease;
    position: relative;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-md);
    border-color: var(--line-strong);
}

/* Shimmer skeleton prevents gray dead boxes while loading */
.card-media {
    position: relative;
    aspect-ratio: 16 / 10.5;
    background: linear-gradient(90deg, #E8ECF2 25%, #F3F6FA 50%, #E8ECF2 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite linear;
    overflow: hidden;
}
.card-media.is-loaded { animation: none; background: #E8ECF2; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.card-media > a { display: block; width: 100%; height: 100%; }
.card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}
.card:hover .card-img { transform: scale(1.04); }

.photo-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 0;
    background: rgba(17, 25, 39, 0.78);
    color: #FFFFFF;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 160ms ease, background 150ms ease, transform 120ms ease;
    z-index: 6;
}
.card-media:hover .photo-nav { opacity: 1; }
.photo-nav:hover { background: #000000; transform: translateY(-50%) scale(1.08); }
.photo-nav--prev { left: 8px; }
.photo-nav--next { right: 8px; }

.photo-dots {
    position: absolute;
    left: 10px; right: 10px; bottom: 8px;
    display: flex; gap: 4px; z-index: 3; pointer-events: none;
}
.photo-dots span {
    flex: 1; height: 3px; border-radius: 99px;
    background: rgba(255, 255, 255, 0.45);
    transition: background 150ms ease;
}
.photo-dots span.is-on { background: #FFFFFF; }

.photo-count {
    position: absolute;
    right: 10px; bottom: 16px;
    background: rgba(15, 23, 42, 0.78);
    color: #FFFFFF;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: var(--font-head);
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 4px;
    z-index: 3;
}

.card-badges {
    position: absolute;
    top: 10px; left: 10px;
    display: flex; flex-wrap: wrap; gap: 5px;
    z-index: 4; pointer-events: none;
}
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 6px;
    font-family: var(--font-head);
    font-size: 11px; font-weight: 800;
    letter-spacing: 0.02em; line-height: 1.25;
}
.badge-vitrin { background: var(--gold); color: #111827; }
.badge-drop { background: var(--green); color: #FFFFFF; }
.badge-urgent { background: var(--brand); color: #FFFFFF; }
.badge-type { background: rgba(15, 23, 42, 0.80); color: #FFFFFF; }

.card-actions {
    position: absolute;
    top: 10px; right: 10px;
    display: flex; flex-direction: column; gap: 6px;
    z-index: 6;
}
.act-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink-2);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    transition: transform 150ms cubic-bezier(0.34, 1.56, 0.64, 1), color 150ms ease, background 150ms ease;
}
.act-btn:hover { transform: scale(1.1); color: var(--ink); background: #FFFFFF; }
.act-btn.is-fav { color: var(--brand); background: #FFFFFF; animation: heartPop 340ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.act-btn.is-fav svg { fill: var(--brand); }
.act-btn.is-cmp { background: var(--dark); color: #FFFFFF; border-color: var(--dark); }

@keyframes heartPop {
    0% { transform: scale(0.78); }
    50% { transform: scale(1.28); }
    100% { transform: scale(1); }
}

/* Uniform vertical rhythm so every card's title starts on the exact same line */
.card-body {
    padding: 13px 15px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}
.card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
    height: 28px;
    overflow: hidden;
}
.card-price {
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.025em;
    white-space: nowrap;
}
.card-m2 {
    font-family: var(--font-head);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink-2);
    background: var(--bg);
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.card-meta-slot {
    height: 22px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}
.card-price-old {
    font-size: 12px;
    color: var(--ink-3);
    text-decoration: line-through;
    font-weight: 600;
    white-space: nowrap;
}
.card-bench {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 700;
    color: #065F46;
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    padding: 1px 7px;
    border-radius: 5px;
    white-space: nowrap;
}
.card-type-note {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    white-space: nowrap;
}

.card-title {
    font-family: var(--font-head);
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
}
.card-title:hover { color: var(--brand); }

.card-loc {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--ink-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-specs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding-top: 9px; margin-top: auto;
    border-top: 1px solid var(--line);
    font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.spec-pill {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.card-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.owner-tag { font-weight: 700; color: var(--green); }
.owner-tag--agency { color: var(--ink-2); }

/* LIST VIEW MODE */
.listings-grid.is-list { grid-template-columns: 1fr; gap: 12px; }
.listings-grid.is-list .card { flex-direction: row; min-height: 184px; }
.listings-grid.is-list .card-media { width: 275px; flex: none; aspect-ratio: auto; }
.listings-grid.is-list .card-body { padding: 14px 18px; }
.listings-grid.is-list .card-title { font-size: 16px; min-height: auto; -webkit-line-clamp: 1; }
.listings-grid.is-list .card-price { font-size: 21px; }

.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 28px;
}
.page-btn {
    min-width: 38px; height: 38px; padding: 0 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: #FFFFFF;
    font-family: var(--font-head); font-weight: 700; font-size: 13.5px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 140ms ease;
}
.page-btn:hover { border-color: var(--dark); }
.page-btn.is-active { background: var(--dark); color: #FFFFFF; border-color: var(--dark); }

/* ==========================================================================
   DETAIL PAGE (/ilan/{slug}-{no})
   ========================================================================== */
.detail-wrap { padding-top: 18px; padding-bottom: 76px; }
.breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    font-size: 13px; color: var(--ink-3); margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }

.detail-header {
    display: flex; flex-wrap: wrap; align-items: flex-start;
    justify-content: space-between; gap: 16px; margin-bottom: 16px;
}
.detail-header h1 { font-size: 25px; font-weight: 800; max-width: 840px; }
.detail-sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    margin-top: 6px; font-size: 14px; color: var(--ink-2);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
    border-radius: var(--r-xl);
    overflow: hidden;
    max-height: 470px;
    box-shadow: var(--sh-sm);
}
.gallery-main { position: relative; background: #111827; cursor: zoom-in; height: 470px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-side { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; height: 470px; }
.gallery-thumb { position: relative; background: #111827; cursor: zoom-in; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 280ms ease; }
.gallery-thumb:hover img { transform: scale(1.05); }
.gallery-all-btn {
    position: absolute; right: 14px; bottom: 14px;
    background: rgba(15, 23, 42, 0.88); color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 999px;
    padding: 8px 15px;
    font-family: var(--font-head); font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
}
.gallery-all-btn:hover { background: #000000; }

.detail-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 375px;
    gap: 24px;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 22px;
    box-shadow: var(--sh-sm);
    margin-bottom: 18px;
}
.panel h2 {
    font-size: 17px; font-weight: 800; margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}

.hl-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
    margin-bottom: 18px;
}
.hl-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 13px 15px;
    box-shadow: var(--sh-xs);
}
.hl-box small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.hl-box strong { display: block; margin-top: 2px; font-family: var(--font-head); font-size: 16px; font-weight: 800; }

/* District Benchmark & SVG Price History Chart (Redfin/Zillow Inspired) */
.history-card { border-left: 4px solid var(--green); }
.history-metrics {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    padding: 13px; background: var(--surface-2);
    border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: 14px;
}
.history-metrics small { display: block; font-size: 12px; color: var(--ink-3); }
.history-metrics strong { font-family: var(--font-head); font-size: 15.5px; font-weight: 800; }

.chart-box {
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}
.chart-svg { width: 100%; height: 155px; display: block; overflow: visible; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 13px; border-radius: var(--r-sm);
    background: #FFFFFF; border: 1px solid var(--line); font-size: 13.5px;
}

.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th { text-align: left; padding: 8px 6px; color: var(--ink-2); font-weight: 600; width: 48%; }
.spec-table td { text-align: right; padding: 8px 6px; font-weight: 700; color: var(--ink); }
.spec-table tr:nth-child(even) { background: var(--surface-2); }

/* Right Sticky Box — Works cleanly with body { overflow-x: clip } */
.detail-sticky {
    position: sticky;
    top: 86px;
    align-self: start;
}
.price-hero-box {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.price-big { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.seller-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar {
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--dark); color: #FFFFFF;
    font-family: var(--font-head); font-weight: 800; font-size: 16px;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.verified-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--green); }

.detail-actions {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 12px;
}
.detail-actions button {
    height: 36px; border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    font-family: var(--font-head); font-size: 12.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; transition: all 140ms ease;
}
.detail-actions button:hover { border-color: var(--dark); background: #FFFFFF; }
.detail-actions button.is-fav { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.detail-actions button.is-cmp { color: #FFFFFF; background: var(--dark); border-color: var(--dark); }

.trust-links {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
}
.trust-link-btn {
    border: 0; background: transparent; padding: 4px 0;
    color: var(--ink-2); font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
}
.trust-link-btn:hover { color: var(--brand); }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.feat-item {
    display: flex; align-items: center; gap: 7px;
    font-size: 13.5px; font-weight: 600;
    padding: 8px 11px; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--line);
}
.feat-item.is-yes { color: var(--ink); }
.feat-item.is-yes svg { color: var(--green); }
.feat-item.is-no { color: var(--ink-3); opacity: 0.55; }

/* ==========================================================================
   FORMS, AUTH, ACCOUNT & ADMIN
   ========================================================================== */
.form-page { max-width: 880px; margin: 26px auto 64px; }
.auth-page { max-width: 470px; margin: 40px auto 72px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.upload-zone {
    border: 2px dashed var(--line-strong);
    border-radius: var(--r-md);
    padding: 26px;
    text-align: center;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}
.upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload-zone.is-invalid { border-color: var(--brand); background: var(--brand-soft); }
.preview-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.preview-thumbs img {
    width: 96px; height: 70px; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--line-strong);
}

.check-row {
    display: flex; align-items: flex-start; gap: 9px;
    font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.check-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.check-row a { color: var(--brand); font-weight: 700; text-decoration: underline; }

/* ==========================================================================
   COMPARE DOCK, MODALS, LIGHTBOX & TOAST
   ========================================================================== */
.compare-dock {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
    z-index: 80;
    background: var(--dark); color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: var(--sh-lg);
    display: flex; align-items: center; gap: 14px;
    max-width: calc(100vw - 24px);
}
.compare-items { display: flex; align-items: center; gap: 8px; }
.cmp-mini {
    display: flex; align-items: center; gap: 7px;
    background: var(--dark-2);
    padding: 4px 8px 4px 4px; border-radius: 8px;
    font-size: 12px; font-weight: 600;
}
.cmp-mini img { width: 34px; height: 26px; object-fit: cover; border-radius: 5px; }
.cmp-mini button { border: 0; background: transparent; color: #94A3B8; cursor: pointer; padding: 2px; display: inline-flex; }
.cmp-mini button:hover { color: #FFFFFF; }

.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
    background: #FFFFFF; border-radius: var(--r-lg);
    width: 100%; max-width: 960px; max-height: 88vh; overflow: auto;
    box-shadow: var(--sh-lg); padding: 22px;
}
.modal-box--sm { max-width: 480px; }
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cmp-table th, .cmp-table td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table th { background: var(--surface-2); font-weight: 700; width: 170px; }
.cmp-win { background: var(--green-soft); color: #065F46; font-weight: 800; }

.lightbox {
    position: fixed; inset: 0; z-index: 120;
    background: rgba(8, 12, 20, 0.95);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.lb-btn {
    position: absolute; width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.12);
    color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-btn:hover { background: rgba(255,255,255,0.26); }
.lb-close { top: 18px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-counter {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    color: #E2E8F0; font-family: var(--font-head); font-weight: 700; font-size: 14px;
    background: rgba(0,0,0,0.6); padding: 5px 14px; border-radius: 999px;
}

.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 130;
    background: var(--dark); color: #FFFFFF;
    padding: 12px 18px; border-radius: var(--r-md);
    font-family: var(--font-head); font-size: 13.5px; font-weight: 600;
    box-shadow: var(--sh-lg);
    opacity: 0; transform: translateY(10px);
    transition: all 200ms ease; pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--dark);
    color: #94A3B8;
    padding: 42px 0 36px;
    margin-top: 40px;
    font-size: 13.5px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer h4 { color: #FFFFFF; font-size: 14px; margin-bottom: 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-links a:hover { color: #FFFFFF; }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 12px; padding-top: 18px; font-size: 12.5px;
}

.empty-box {
    background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 48px 24px; text-align: center;
}
.empty-box h3 { font-size: 19px; margin: 12px 0 6px; }
.empty-box p { color: var(--ink-2); margin: 0 0 18px; }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { background: var(--surface-2); font-family: var(--font-head); font-size: 12px; text-transform: uppercase; color: var(--ink-2); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1120px) {
    .listings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-cols { grid-template-columns: minmax(0, 1fr) 335px; }
}
@media (max-width: 920px) {
    .topbar-left { display: none; }
    .header-inner { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
    .header-search { order: 3; max-width: 100%; flex-basis: 100%; }
    .market-wrap { grid-template-columns: 1fr; }
    .mobile-filter-btn { display: inline-flex; }
    .filter-panel {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 315px; max-width: 88vw; max-height: 100vh;
        z-index: 95; border-radius: 0;
        transform: translateX(-105%);
        transition: transform 240ms ease;
    }
    .filter-panel.is-open { transform: translateX(0); }
    .filter-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 90; }
    .detail-cols { grid-template-columns: 1fr; }
    .detail-sticky { position: static; }
    .gallery-grid { grid-template-columns: 1fr; max-height: none; }
    .gallery-main { height: 290px; }
    .gallery-side { display: none; }
    .hl-strip { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .listings-grid { grid-template-columns: 1fr; }
    .listings-grid.is-list .card { flex-direction: column; }
    .listings-grid.is-list .card-media { width: 100%; aspect-ratio: 16 / 10.5; }
    .icon-pill .hide-sm { display: none; }
    .feat-grid, .history-metrics, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .col-span-2, .col-span-3 { grid-column: auto; }
    .footer-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   v2.1 UPGRADES: MAP TOOLBAR, SPEC GRID, INTERACTIVE CHART TOOLTIP, 4-COL GRID
   ========================================================================== */
.map-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.map-layer-seg {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 2px;
}
.map-layer-seg button {
    border: 0;
    background: transparent;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-2);
    cursor: pointer;
    transition: all 140ms ease;
}
.map-layer-seg button.is-active {
    background: var(--dark);
    color: #FFFFFF;
}
.map-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 0;
    background: var(--brand);
    color: #FFFFFF;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(225, 29, 46, 0.28);
    transition: transform 130ms ease, background 140ms ease;
}
.map-search-btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
.map-status-note {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink-3);
}
.kp-price-pin.is-highlight {
    background: var(--brand);
    color: #FFFFFF;
    border-color: var(--brand);
    transform: scale(1.16);
    z-index: 999 !important;
}
.leaflet-container { font-family: var(--font-body); }
.detail-map {
    width: 100%;
    height: 300px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    overflow: hidden;
    background: #E8EDF3;
    z-index: 1;
}

/* 2-Column Technical Specs Grid (Inside Left Column -> Keeps Sticky Seller Box Compact!) */
.spec-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}
.spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}
.spec-row span { color: var(--ink-2); font-weight: 600; }
.spec-row strong { color: var(--ink); font-weight: 700; text-align: right; }

/* Interactive SVG Chart Hover Tooltip */
.chart-box { position: relative; }
.chart-node .chart-guide { opacity: 0.45; transition: opacity 150ms ease; }
.chart-node .chart-dot { transition: r 150ms ease, stroke-width 150ms ease; }
.chart-node:hover .chart-guide,
.chart-node:focus .chart-guide { opacity: 1; stroke: #64748B; }
.chart-node:hover .chart-dot,
.chart-node:focus .chart-dot { r: 7.5; stroke-width: 3; }

.chart-tooltip {
    position: absolute;
    z-index: 12;
    pointer-events: none;
    background: var(--dark);
    color: #FFFFFF;
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: var(--sh-md);
    font-size: 12.5px;
    line-height: 1.4;
    white-space: nowrap;
    transform: translate(-50%, -108%);
    transition: left 120ms ease, top 120ms ease;
}
.chart-tooltip .ct-date { color: #94A3B8; font-size: 11.5px; font-weight: 600; }
.chart-tooltip .ct-price { font-family: var(--font-head); font-size: 14px; font-weight: 800; color: #FFFFFF; }
.chart-tooltip .ct-delta { font-family: var(--font-head); font-size: 12px; font-weight: 700; margin-top: 1px; }
.chart-tooltip .ct-delta.is-down { color: #34D399; }
.chart-tooltip .ct-delta.is-up { color: #FDA4AF; }
.chart-tooltip .ct-delta.is-flat { color: #CBD5E1; }

/* Compare Mixed-Type Warning */
.cmp-warn-banner {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: var(--gold-soft);
    border: 1px solid var(--gold-line);
    color: var(--gold-ink);
    font-size: 13px;
    font-weight: 600;
}

/* Responsive 4-Column Similar Listings Grid (Pixel-aligned!) */
.listings-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}
.listings-grid--4 .card-price { font-size: 16.5px; }
.listings-grid--4 .card-m2 { font-size: 11px; padding: 2px 6px; }
.listings-grid--4 .card-body { padding: 12px 13px 13px; }

@media (max-width: 1180px) {
    .listings-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .spec-grid-2col { grid-template-columns: 1fr; }
    .listings-grid--4 { grid-template-columns: 1fr; }
}


/* ==========================================================================
   v2.2 UPGRADES: .page-pad FIX, CLEAN CARD PILL, SPLIT-SCREEN MAP & CLUSTERS
   ========================================================================== */
.page-pad {
    padding-top: 26px;
    padding-bottom: 72px;
}

.card-type-pill {
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-2);
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.drawer-only-btn { display: none; }
@media (max-width: 920px) {
    .drawer-only-btn { display: inline-flex; }
}

/* Split-Screen Map Mode (Zillow / Airbnb Style: Left Cards + Right Sticky Map) */
.split-stage { display: block; }

.market-wrap.is-map-open {
    grid-template-columns: 1fr;
}
.market-wrap.is-map-open .drawer-only-btn {
    display: inline-flex;
}
.market-wrap.is-map-open .filter-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 315px; max-width: 88vw; max-height: 100vh;
    z-index: 95;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 240ms ease;
}
.market-wrap.is-map-open .filter-panel.is-open {
    transform: translateX(0);
}
.market-wrap.is-map-open .filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 90;
}

@media (min-width: 1060px) {
    .market-wrap.is-map-open .split-stage {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
        gap: 20px;
        align-items: start;
    }
    .market-wrap.is-map-open .listings-grid:not(.is-list) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .market-wrap.is-map-open .map-panel {
        position: sticky;
        top: 84px;
        margin-bottom: 0;
    }
    .market-wrap.is-map-open .map-canvas {
        height: calc(100vh - 154px);
        min-height: 460px;
    }
}

@media (max-width: 1059px) {
    .market-wrap.is-map-open .split-stage {
        display: flex;
        flex-direction: column-reverse;
        gap: 16px;
    }
    .market-wrap.is-map-open .map-panel {
        position: static;
        margin-bottom: 0;
    }
    .market-wrap.is-map-open .map-canvas {
        height: 380px;
    }
}

/* Custom Map Marker Cluster Badge */
.kp-cluster-wrap { background: transparent; border: 0; }
.kp-cluster {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--dark);
    color: #FFFFFF;
    border: 2.5px solid #FFFFFF;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.34);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head);
    font-size: 13px; font-weight: 800;
    transition: transform 140ms ease, background 140ms ease;
}
.kp-cluster:hover {
    background: var(--brand);
    transform: scale(1.1);
}


/* ==========================================================================
   v2.3 UPGRADES: FULL-HEIGHT DESKTOP FILTER + 390px MOBILE POLISH
   ========================================================================== */
@media (min-width: 921px) {
    .market-wrap:not(.is-map-open) .filter-panel {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

.chart-svg {
    width: 100%;
    height: auto;
    max-height: 155px;
    display: block;
    overflow: visible;
}

@media (max-width: 620px) {
    .container { padding: 0 14px; }
    .topbar-links {
        gap: 12px;
        overflow-x: auto;
        scrollbar-width: none;
        width: 100%;
        justify-content: flex-start;
    }
    .topbar-links::-webkit-scrollbar { display: none; }
    .brand-mark { width: 32px; height: 32px; }
    .brand-text { font-size: 17.5px; }
    .header-actions { gap: 6px; }
    .header-actions .btn { padding: 0 12px; font-size: 12.5px; min-height: 36px; }
    .icon-pill { height: 36px; padding: 0 10px; }
    .results-controls { width: 100%; }
    .results-controls form { flex: 1; min-width: 140px; }
    .results-controls .select { width: 100%; min-width: 0; }
    .detail-header h1 { font-size: 20px; }
    .price-big { font-size: 24px; }
    .timeline li { flex-direction: column; align-items: flex-start; gap: 4px; }
}
