/* =========================================================
   PropertyStock — Buy House | Buy Land | Investment
   Plain CSS, no build step required.
   ========================================================= */
:root {
    --brand: #0f3d3e;
    --brand-700: #0b2e2f;
    --brand-50: #e8f1f0;
    --accent: #e2b248;
    --accent-light: #f6d77c;
    --accent-600: #b8862b;
    --gold-gradient: linear-gradient(180deg, #f6d77c 0%, #e2b248 45%, #b8862b 100%);
    --ink: #1b2324;
    --muted: #5f6b6c;
    --line: #e3e8e8;
    --bg: #f7f8f6;
    --white: #fff;
    --success: #1f8a4c;
    --danger: #c0392b;
    --warning: #c77c02;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(15, 61, 62, .08);
    --shadow-lg: 0 18px 48px rgba(15, 61, 62, .16);
    --font-logo: "Montserrat", "Plus Jakarta Sans", system-ui, sans-serif;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent-600); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 560px; margin: 0; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-600); margin-bottom: .6rem; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .section { padding: 56px 0; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .95rem; border: 2px solid transparent; cursor: pointer; transition: .2s ease; font-family: inherit; line-height: 1.2; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #1b1300; }
.btn-accent:hover { background: var(--accent-600); color: #fff; }
.btn-outline { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: #fff; color: var(--brand); }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }
.btn-block { width: 100%; }

/* ---------- Top bar / Header ---------- */
.topbar { background: var(--brand-700); color: #cfe0df; font-size: .82rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; flex-wrap: wrap; }
.topbar a { color: #fff; }
.header { background: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--line); }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 1rem; }
.logo { display: flex; align-items: center; gap: .65rem; color: var(--ink); }
.logo-mark-img { height: 52px; width: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font-family: var(--font-logo); font-weight: 600; font-size: 1.42rem; letter-spacing: .04em; background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo small { font-family: var(--font-logo); font-size: .62rem; font-weight: 500; letter-spacing: .55em; text-transform: uppercase; color: var(--ink); margin-top: .35rem; padding-left: .1em; }
.logo-dark small { color: #fff; }
.nav { display: flex; align-items: center; gap: .3rem; }
.nav a { padding: .55rem .9rem; border-radius: 999px; font-weight: 600; color: var(--ink); font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--brand-50); color: var(--brand); }
.nav .btn { margin-left: .5rem; color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
@media (max-width: 960px) {
    .nav-toggle { display: block; }
    .nav { position: absolute; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 1rem; box-shadow: var(--shadow-lg); display: none; }
    .nav.open { display: flex; }
    .nav .btn { margin: .5rem 0 0; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: linear-gradient(110deg, rgba(11,46,47,.95) 0%, rgba(15,61,62,.85) 45%, rgba(15,61,62,.35) 100%), url('../images/hero.svg') center/cover; padding: 110px 0 150px; overflow: hidden; }
.hero h1 { max-width: 720px; }
.hero h1 span { color: var(--accent); }
.hero p.lead { font-size: 1.15rem; max-width: 600px; color: #d9e7e6; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }
.hero-pills { display: flex; gap: 1.5rem; margin-top: 2.5rem; flex-wrap: wrap; color: #cfe0df; font-size: .92rem; }
.hero-pills span::before { content: "✓"; color: var(--accent); font-weight: 800; margin-right: .4rem; }

/* ---------- Search box ---------- */
.search-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1.4rem; margin-top: -90px; position: relative; z-index: 5; }
.search-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.search-tabs label { cursor: pointer; }
.search-tabs input { display: none; }
.search-tabs span { display: inline-block; padding: .5rem 1.1rem; border-radius: 999px; background: var(--bg); font-weight: 700; font-size: .9rem; color: var(--muted); }
.search-tabs input:checked + span { background: var(--brand); color: #fff; }
.search-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: .8rem; }
@media (max-width: 960px) { .search-row { grid-template-columns: 1fr 1fr; } .search-row .btn { grid-column: span 2; } }
@media (max-width: 540px) { .search-row { grid-template-columns: 1fr; } .search-row .btn { grid-column: auto; } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label, .label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.input, .select, .textarea { width: 100%; padding: .78rem .95rem; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: .95rem; background: #fff; color: var(--ink); transition: border-color .15s; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.textarea { min-height: 120px; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: var(--danger); font-size: .82rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }

/* ---------- Alerts ---------- */
.alert { padding: 1rem 1.2rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 600; }
.alert-success { background: #e6f5ec; color: var(--success); border: 1px solid #bfe5cd; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }

/* ---------- Category tiles ---------- */
.cat-tile { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 260px; display: flex; align-items: end; color: #fff; box-shadow: var(--shadow); }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,46,47,.92), rgba(11,46,47,.1) 65%); }
.cat-tile:hover img { transform: scale(1.06); }
.cat-tile .body { position: relative; z-index: 1; padding: 1.5rem; }
.cat-tile h3 { font-size: 1.4rem; margin-bottom: .2rem; color: #fff; }
.cat-tile p { margin: 0; color: #d9e7e6; font-size: .92rem; }
.cat-tile:hover { color: #fff; }

/* ---------- Property card ---------- */
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: .25s ease; display: flex; flex-direction: column; border: 1px solid var(--line); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--brand-50); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.05); }
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: .4rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: .28rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: #fff; color: var(--brand); }
.badge-accent { background: var(--accent); color: #1b1300; }
.badge-brand { background: var(--brand); color: #fff; }
.badge-sold { background: var(--danger); color: #fff; }
.badge-offer { background: var(--warning); color: #fff; }
.badge-muted { background: var(--bg); color: var(--muted); }
.badge-success { background: #e6f5ec; color: var(--success); }
.roi-chip { position: absolute; bottom: 12px; right: 12px; background: var(--success); color: #fff; font-weight: 800; padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; }
.card-body { padding: 1.2rem 1.25rem 1.3rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-price { font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.card-price small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.card-title:hover { color: var(--brand); }
.card-loc { color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: .3rem; }
.card-meta { display: flex; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .8rem; margin-top: auto; font-size: .85rem; color: var(--muted); font-weight: 600; }
.card-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; }

/* ---------- Features / Why us ---------- */
.feature { background: #fff; padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--line); }
.feature .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 1rem; font-size: 1.5rem; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

.stats-band { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 2.4rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; text-align: center; }
.stats-band strong { display: block; font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.stats-band span { color: #cfe0df; font-size: .92rem; }
@media (max-width: 760px) { .stats-band { grid-template-columns: repeat(2, 1fr); } }

.steps { counter-reset: s; }
.step { position: relative; padding: 1.6rem 1.6rem 1.6rem 4.6rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 1.4rem; top: 1.5rem; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--accent); color: #1b1300; display: grid; place-items: center; font-weight: 800; }
.step p { color: var(--muted); margin: 0; font-size: .94rem; }

.testimonial { background: #fff; padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--line); }
.testimonial blockquote { margin: 0 0 1rem; font-size: 1rem; }
.testimonial .who { font-weight: 700; }
.testimonial .who small { display: block; color: var(--muted); font-weight: 500; }
.stars { color: var(--accent); letter-spacing: 2px; margin-bottom: .6rem; }

.cta { background: linear-gradient(120deg, var(--brand-700), var(--brand)); color: #fff; border-radius: 22px; padding: 3.2rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta h2 { color: #fff; margin: 0 0 .3rem; }
.cta p { color: #cfe0df; margin: 0; }

/* ---------- Page header ---------- */
.page-hero { background: linear-gradient(120deg, var(--brand-700), var(--brand)); color: #fff; padding: 60px 0 56px; }
.page-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-bottom: .3rem; }
.page-hero p { color: #cfe0df; margin: 0; max-width: 640px; }
.crumbs { font-size: .85rem; color: #a9c4c2; margin-bottom: .8rem; }
.crumbs a { color: #fff; }

/* ---------- Listing page ---------- */
.listing { display: grid; grid-template-columns: 290px 1fr; gap: 2rem; align-items: start; }
.filters { background: #fff; border-radius: var(--radius); padding: 1.4rem; border: 1px solid var(--line); position: sticky; top: 96px; }
.filters h3 { margin-bottom: 1rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; gap: 1rem; flex-wrap: wrap; }
.toolbar .select { width: auto; }
.empty { background: #fff; border: 2px dashed var(--line); border-radius: var(--radius); padding: 3rem; text-align: center; color: var(--muted); }
@media (max-width: 960px) { .listing { grid-template-columns: 1fr; } .filters { position: static; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; list-style: none; padding: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .8rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.pagination .active span { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled span { color: #bbb; }

/* ---------- Property detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 380px; gap: 2rem; align-items: start; }
@media (max-width: 1020px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--brand-50); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: .6rem; margin-top: .7rem; overflow-x: auto; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; width: 110px; flex: 0 0 auto; aspect-ratio: 4/3; background: none; }
.thumbs button.active { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.panel { background: #fff; border-radius: var(--radius); padding: 1.6rem; border: 1px solid var(--line); margin-top: 1.5rem; }
.panel h2 { font-size: 1.3rem; }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.spec { background: var(--bg); border-radius: 10px; padding: .9rem 1rem; }
.spec small { display: block; color: var(--muted); font-size: .78rem; font-weight: 600; }
.spec strong { font-size: 1.02rem; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; list-style: none; padding: 0; margin: 0; }
.feature-list li::before { content: "✓"; color: var(--success); font-weight: 800; margin-right: .5rem; }
.prose { white-space: pre-line; color: #333; }
.sticky-box { position: sticky; top: 96px; }
.price-box { background: #fff; border-radius: var(--radius); padding: 1.6rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.price-box .price { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.calc-result { background: var(--brand-50); border-radius: 10px; padding: 1rem; margin-top: .5rem; }
.calc-result div { display: flex; justify-content: space-between; font-size: .92rem; padding: .2rem 0; }
.calc-result strong { color: var(--brand); }

/* ---------- Footer ---------- */
.footer { background: var(--brand-700); color: #b9cfcd; padding: 64px 0 0; margin-top: 80px; }
.footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer a { color: #b9cfcd; }
.footer a:hover { color: var(--accent); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; gap: 2rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.newsletter { display: flex; gap: .5rem; margin-top: .6rem; }
.newsletter .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
.socials { display: flex; gap: .5rem; margin-top: 1rem; }
.socials a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.copyright { border-top: 1px solid rgba(255,255,255,.08); margin-top: 48px; padding: 1.2rem 0; font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.wa-float { position: fixed; right: 20px; bottom: 20px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 60; }
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(120deg, var(--brand-700), var(--brand)); padding: 2rem; }
.auth-logo { display: block; width: 150px; margin: 0 auto 1.4rem; }
.auth-card { background: #fff; border-radius: 18px; padding: 2.4rem; width: min(420px, 100%); box-shadow: var(--shadow-lg); }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--brand-700); color: #cfe0df; padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh; }
.admin-side .logo { color: #fff; margin-bottom: 2rem; padding: 0 .5rem; }
.admin-side nav a { display: block; padding: .7rem .9rem; border-radius: 10px; color: #cfe0df; font-weight: 600; margin-bottom: .2rem; }
.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { padding: 2rem 2.4rem; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.8rem; gap: 1rem; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.7rem; margin: 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.stat-card small { color: var(--muted); font-weight: 600; }
.stat-card strong { display: block; font-size: 1.9rem; color: var(--brand); }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--bg); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.thumb-sm { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; }
.actions { display: flex; gap: .4rem; }
.inline { display: inline; }
.admin-grid-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; }
.admin-grid-imgs label { position: relative; display: block; }
.admin-grid-imgs img { border-radius: 10px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.admin-grid-imgs span { font-size: .78rem; display: flex; gap: .3rem; align-items: center; margin-top: .3rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem .4rem; margin: 0 0 1.4rem; background: #fff; }
legend { font-weight: 800; padding: 0 .5rem; color: var(--brand); }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } .admin-side { position: static; height: auto; } .admin-main { padding: 1.4rem; } }

/* =========================================================
   MOBILE / PHONE OPTIMISATIONS
   ========================================================= */
.only-mobile { display: none !important; }
.filter-toggle { display: none; }
.mobile-bar { display: none; }
body.nav-open { overflow: hidden; }

@media (max-width: 960px) {
    /* Full-screen slide-down menu with big tap targets */
    .nav { top: 76px; bottom: 0; height: calc(100dvh - 76px); overflow-y: auto; border-top: 1px solid var(--line); gap: .2rem; padding: 1rem 1.25rem 2rem; }
    .nav a { padding: .95rem 1rem; font-size: 1.05rem; border-radius: 12px; }
    .nav .btn { padding: 1rem; font-size: 1rem; }
    .nav-toggle { color: var(--ink); width: 44px; height: 44px; display: grid; place-items: center; }
    .nav-toggle .ic-close { display: none; }
    body.nav-open .nav-toggle .ic-open { display: none; }
    body.nav-open .nav-toggle .ic-close { display: block; }

    /* Listing filters collapse behind a button */
    .filter-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
    .filters { display: none; }
    .filters.open { display: block; }
}

@media (max-width: 640px) {
    html { -webkit-text-size-adjust: 100%; }
    body { font-size: 15px; }
    .container { width: calc(100% - 2rem); }
    .only-mobile { display: block !important; }
    .hide-mobile { display: none !important; }

    /* Prevent iPhone auto-zoom when tapping inputs */
    .input, .select, .textarea { font-size: 16px; padding: .75rem .85rem; }

    /* Top bar: one compact line */
    .topbar .container { justify-content: center; padding: .4rem 0; font-size: .78rem; }
    .topbar .tb-address, .topbar .tb-email { display: none; }

    .header .container, .nav { height: 64px; }
    .nav { top: 64px; height: calc(100dvh - 64px); }
    .logo-mark-img { height: 40px; }
    .logo-name { font-size: 1.12rem; }
    .logo small { font-size: .55rem; }

    /* Section rhythm */
    .section { padding: 44px 0; }
    .section-sm { padding: 32px 0; }
    .section-head { margin-bottom: 1.2rem; align-items: center; }
    .section-head p { font-size: .92rem; }
    h2 { font-size: 1.45rem; }

    /* Hero */
    .hero { padding: 48px 0 110px; }
    .hero h1 { font-size: 1.9rem; }
    .hero p.lead { font-size: 1rem; }
    .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.4rem; }
    .hero-actions .btn:first-child { grid-column: span 2; }
    .hero-actions .btn { padding: .85rem .8rem; }
    .hero-pills { gap: .4rem 1rem; margin-top: 1.4rem; font-size: .82rem; }

    .search-card { padding: 1rem; margin-top: -80px; }
    .search-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .search-tabs::-webkit-scrollbar { display: none; }
    .search-tabs span { white-space: nowrap; padding: .45rem .9rem; }
    .search-row { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .search-row > :first-child, .search-row > select[name=city], .search-row .btn { grid-column: span 2; }

    /* Horizontal swipe rows instead of very long stacks */
    .m-scroll { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; margin-inline: -1rem; padding: .25rem 1rem 1rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .m-scroll::-webkit-scrollbar { display: none; }
    .m-scroll > * { flex: 0 0 82%; scroll-snap-align: start; }
    .m-scroll .cat-tile { min-height: 200px; }
    .swipe-hint { font-size: .78rem; color: var(--muted); margin-top: -.4rem; }

    .card:hover { transform: none; }
    .card-body { padding: 1rem; }
    .card-price { font-size: 1.15rem; }

    /* Compact "why us" and steps */
    .m-2col { grid-template-columns: 1fr 1fr !important; gap: .75rem; }
    .feature { padding: 1rem; }
    .feature .ic { width: 40px; height: 40px; font-size: 1.15rem; margin-bottom: .6rem; border-radius: 10px; }
    .feature h3 { font-size: .95rem; }
    .feature p { font-size: .82rem; }
    .step { padding: 1rem 1rem 1rem 3.6rem; }
    .step::before { left: 1rem; top: 1rem; width: 2rem; height: 2rem; }
    .stats-band { padding: 1.4rem 1rem; }
    .stats-band strong { font-size: 1.6rem; }
    .cta { padding: 1.6rem; border-radius: 16px; }
    .cta > div:last-child { width: 100%; display: grid !important; grid-template-columns: 1fr; }

    /* Page header */
    .page-hero { padding: 32px 0 30px; }
    .page-hero h1 { font-size: 1.55rem; }
    .page-hero p { font-size: .93rem; }

    /* Listing */
    .toolbar { margin-bottom: .8rem; }
    .toolbar strong { font-size: .9rem; }
    .toolbar .select { padding: .55rem .7rem; }

    /* Property detail */
    .gallery-main { border-radius: 12px; margin-inline: -1rem; border-radius: 0; aspect-ratio: 4/3; }
    .thumbs button { width: 84px; }
    .panel { padding: 1.1rem; margin-top: 1rem; }
    .spec-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .spec { padding: .7rem .8rem; }
    .feature-list { grid-template-columns: 1fr; }
    .price-box { padding: 1.2rem; }
    .price-box .price { font-size: 1.6rem; }
    .sticky-box { position: static; }
    .mobile-price { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; margin-top: 1rem; }
    .mobile-price .price { font-size: 1.55rem; font-weight: 800; color: var(--brand); line-height: 1.1; }

    /* Sticky bottom action bar on property pages */
    .mobile-bar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff; padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
    .mobile-bar .btn { padding: .75rem .4rem; font-size: .88rem; }
    body.has-mobile-bar { padding-bottom: 76px; }
    body.has-mobile-bar .wa-float { display: none; }

    /* Footer */
    .footer { padding-top: 40px; margin-top: 48px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem 1rem; }
    .footer-grid > :first-child, .footer-grid > :last-child { grid-column: span 2; }
    .newsletter .btn { flex: 0 0 auto; }
    .copyright { margin-top: 28px; flex-direction: column; gap: .3rem; text-align: center; }
    .wa-float { width: 52px; height: 52px; right: 14px; bottom: 14px; }
    .wa-float svg { width: 26px; height: 26px; }

    /* Auth */
    .auth-wrap { padding: 1rem; }
    .auth-card { padding: 1.6rem 1.3rem; }
}

/* ---------- Admin on phones ---------- */
.admin-menu-toggle { display: none; }
@media (max-width: 860px) {
    .admin-side { padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; position: sticky; top: 0; z-index: 40; }
    .admin-side .logo { margin: 0; padding: 0; }
    .admin-menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; background: rgba(255,255,255,.08); border: 0; border-radius: 10px; color: #fff; cursor: pointer; }
    .admin-side nav { display: none; width: 100%; padding-top: .8rem; }
    .admin-side nav.open { display: block; }
    .admin-top h1 { font-size: 1.35rem; }
    .admin-top .btn { width: 100%; }
    fieldset { padding: 1rem 1rem .2rem; }

    /* Tables become stacked cards */
    .table-wrap.cards { background: transparent; border: 0; overflow: visible; }
    .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; width: 100%; }
    .table-wrap.cards tr:first-child { display: none; }
    .table-wrap.cards tr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .8rem; }
    .table-wrap.cards td { border: 0; padding: .3rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; overflow-wrap: anywhere; }
    .table-wrap.cards td > * { min-width: 0; }
    .table-wrap.cards td::before { content: attr(data-label); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; flex: 0 0 auto; }
    .table-wrap.cards td[data-label=""]::before, .table-wrap.cards td:not([data-label])::before { content: none; }
    .table-wrap.cards td.td-main { display: block; text-align: left; font-size: 1rem; }
    .table-wrap.cards td.td-img img { width: 100%; height: 150px; border-radius: 10px; }
    .table-wrap.cards td.actions { justify-content: flex-start; padding-top: .7rem; }
    .table-wrap.cards td.actions .btn { flex: 1; }
}
