/* =====================================================================
   BẢN ĐỒ QUY HOẠCH & NHÀ ĐẤT – site.css (mobile-first)
   ===================================================================== */
:root {
    --c-primary: #0b6e4f;
    --c-primary-600: #095a41;
    --c-primary-50: #e8f4ef;
    --c-accent: #f28c28;
    --c-accent-600: #d9731a;
    --c-ink: #1d2a2f;
    --c-muted: #64748b;
    --c-bg: #f4f6f5;
    --c-card: #ffffff;
    --c-border: #e2e8e5;
    --c-danger: #d63a3a;
    --c-vip1: #8c99a6;
    --c-vip2: #e0a100;
    --c-vip3: #c4344d;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 10px rgba(16, 40, 32, .07);
    --shadow-lg: 0 10px 30px rgba(16, 40, 32, .16);
    --header-h: 60px;
    --bottom-nav-h: 60px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --bs-primary: #0b6e4f;
    --bs-primary-rgb: 11, 110, 79;
    --bs-link-color: #0b6e4f;
    --bs-link-hover-color: #095a41;
    --bs-body-font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--bs-body-font-family);
    color: var(--c-ink);
    background: var(--c-bg);
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b));
}
@media (min-width: 992px) { body { padding-bottom: 0; } }
img { max-width: 100%; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-600); }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -.01em; }
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.18em; flex-shrink: 0; }
.ic-fill { fill: currentColor; stroke: none; }
.text-muted { color: var(--c-muted) !important; }
.fw-600 { font-weight: 600; }
.small-xs { font-size: .78rem; }
.container-xl { max-width: 1320px; }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { min-height: 36px; }
.btn-primary { --bs-btn-bg: var(--c-primary); --bs-btn-border-color: var(--c-primary); --bs-btn-hover-bg: var(--c-primary-600); --bs-btn-hover-border-color: var(--c-primary-600); --bs-btn-active-bg: var(--c-primary-600); --bs-btn-disabled-bg: var(--c-primary); --bs-btn-disabled-border-color: var(--c-primary); }
.btn-outline-primary { --bs-btn-color: var(--c-primary); --bs-btn-border-color: var(--c-primary); --bs-btn-hover-bg: var(--c-primary); --bs-btn-hover-border-color: var(--c-primary); --bs-btn-active-bg: var(--c-primary); }
.btn-accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: var(--c-accent-600); border-color: var(--c-accent-600); color: #fff; }
.btn-light { background: #fff; border-color: var(--c-border); }
.btn-icon { width: 44px; padding: 0; }
.form-control, .form-select { border-radius: var(--radius-sm); min-height: 44px; border-color: #d4dcd8; }
.form-control:focus, .form-select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 .2rem rgba(11, 110, 79, .15); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--c-primary); border-color: var(--c-primary); }
.field-validation-error, .text-danger { color: var(--c-danger) !important; font-size: .85rem; }
.input-validation-error { border-color: var(--c-danger) !important; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; height: var(--header-h); background: #fff; border-bottom: 1px solid var(--c-border); }
.site-header > div { height: 100%; display: flex; align-items: center; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--c-ink); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: var(--c-ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--c-primary); display: grid; place-items: center; color: #fff; }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-size: .66rem; font-weight: 500; color: var(--c-muted); letter-spacing: .02em; }
.main-nav { display: none; gap: .1rem; margin-left: .75rem; }
.main-nav a { color: var(--c-ink); font-weight: 600; font-size: .93rem; padding: .5rem .7rem; border-radius: var(--radius-sm); }
.main-nav a:hover, .main-nav a.active { background: var(--c-primary-50); color: var(--c-primary); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.header-actions .btn-post { display: none; }
.header-actions .user-chip { display: none; }
.hamburger { border: 0; background: transparent; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; color: var(--c-ink); }
.hamburger:hover { background: var(--c-bg); }
@media (min-width: 992px) {
    .main-nav { display: flex; }
    .hamburger { display: none; }
    .header-actions .btn-post, .header-actions .user-chip { display: inline-flex; }
}
.user-chip { align-items: center; gap: .4rem; border: 1px solid var(--c-border); border-radius: 999px; padding: .25rem .7rem .25rem .25rem; color: var(--c-ink); background: #fff; min-height: 40px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.offcanvas-nav a { display: flex; align-items: center; gap: .7rem; padding: .8rem .5rem; color: var(--c-ink); font-weight: 600; border-bottom: 1px solid var(--c-border); }

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035; background: #fff; border-top: 1px solid var(--c-border);
    display: flex; height: calc(var(--bottom-nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); box-shadow: 0 -4px 14px rgba(0, 0, 0, .05);
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; font-weight: 600; color: var(--c-muted); min-height: 44px; }
.bottom-nav a .ic { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--c-primary); }
.bottom-nav a.bn-post .bn-plus { width: 46px; height: 46px; margin-top: -22px; border-radius: 50%; background: var(--c-accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(242, 140, 40, .45); border: 3px solid #fff; }
.bottom-nav a.bn-post .bn-plus .ic { width: 22px; height: 22px; }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: .85rem; padding: .7rem 0 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: .35rem; }
.crumbs li + li::before { content: "›"; color: var(--c-muted); margin-right: .35rem; }
.crumbs a { color: var(--c-muted); }
.crumbs li:last-child { color: var(--c-ink); font-weight: 600; }

/* ---------- Cards & sections ---------- */
.section { padding: 1.75rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { font-size: 1.25rem; margin: 0; }
.section-head a { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.card-x { background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-x .card-x-body { padding: 1rem; }
@media (min-width: 768px) { .card-x .card-x-body { padding: 1.25rem; } .section { padding: 2.5rem 0; } .section-head h2 { font-size: 1.5rem; } }

/* ---------- Hero (trang chủ) ---------- */
.hero {
    position: relative; color: #fff; padding: 2.25rem 0 4.5rem; overflow: hidden;
    background: radial-gradient(1200px 400px at 80% -10%, rgba(255, 255, 255, .14), transparent 60%), linear-gradient(135deg, #0b6e4f 0%, #0e5a6e 100%);
}
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 38px 38px; pointer-events: none; }
.hero .container-xl { position: relative; z-index: 1; }
.hero h1 { font-size: 1.6rem; line-height: 1.25; margin-bottom: .5rem; }
.hero p.lead { font-size: 1rem; opacity: .9; margin-bottom: 1.25rem; }
@media (min-width: 768px) { .hero { padding: 3.5rem 0 6rem; } .hero h1 { font-size: 2.4rem; } .hero p.lead { font-size: 1.1rem; } }
.search-box { background: #fff; border-radius: 14px; padding: .5rem; box-shadow: var(--shadow-lg); }
.search-tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .15rem .15rem .5rem; scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }
.search-tabs button { border: 0; background: transparent; color: var(--c-muted); font-weight: 600; font-size: .85rem; padding: .45rem .8rem; border-radius: 999px; white-space: nowrap; min-height: 36px; }
.search-tabs button.active { background: var(--c-primary-50); color: var(--c-primary); }
.search-row { display: flex; gap: .5rem; }
.search-row .form-control { border: 0; background: var(--c-bg); min-height: 50px; font-size: 1rem; }
.search-row .btn { min-height: 50px; padding: 0 1.2rem; }
.search-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--c-border); border-radius: 0 0 12px 12px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; display: none; color: var(--c-ink); }
.search-suggest.show { display: block; }
.search-suggest a { display: flex; gap: .6rem; padding: .7rem 1rem; color: var(--c-ink); border-bottom: 1px solid var(--c-border); font-size: .92rem; }
.search-suggest a:hover, .search-suggest a.active { background: var(--c-primary-50); }
.search-suggest .src { font-size: .72rem; color: var(--c-muted); margin-left: auto; white-space: nowrap; }
.hero-ctas { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.hero-ctas .btn { min-height: 48px; }
.hero-stats { display: flex; gap: 1.5rem; margin-top: 1.25rem; font-size: .85rem; opacity: .92; flex-wrap: wrap; }
.hero-stats b { font-size: 1.15rem; display: block; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-top: -3rem; position: relative; z-index: 2; }
@media (min-width: 768px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: -4rem; } }
@media (min-width: 1200px) { .feature-grid { grid-template-columns: repeat(6, 1fr); } }
.feature { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: #fff; border-radius: var(--radius); border: 1px solid var(--c-border); box-shadow: var(--shadow); color: var(--c-ink); transition: transform .15s, box-shadow .15s; min-height: 120px; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--c-ink); }
.feature .f-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary); }
.feature .f-ic .ic { width: 22px; height: 22px; }
.feature b { font-size: .95rem; }
.feature span { font-size: .8rem; color: var(--c-muted); line-height: 1.35; }

/* ---------- Listing grid & card ---------- */
.listing-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 576px) { .listing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .listing-grid { grid-template-columns: repeat(4, 1fr); } }
.lcard { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; position: relative; min-width: 0; }
.lcard:hover { box-shadow: var(--shadow-lg); }
.lcard.highlight { outline: 3px solid var(--c-accent); }
.lcard .thumb { position: relative; aspect-ratio: 3 / 2; background: #dfe5e2; overflow: hidden; display: block; }
.lcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.lcard:hover .thumb img { transform: scale(1.03); }
.lcard .badges { position: absolute; top: .5rem; left: .5rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.badge-x { font-size: .7rem; font-weight: 700; padding: .25rem .5rem; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; letter-spacing: .02em; }
.badge-vip1 { background: var(--c-vip1); } .badge-vip2 { background: var(--c-vip2); } .badge-vip3 { background: var(--c-vip3); }
.badge-rent { background: #2563eb; } .badge-sale { background: var(--c-primary); }
.lcard .img-count { position: absolute; right: .5rem; bottom: .5rem; font-size: .72rem; color: #fff; background: rgba(0, 0, 0, .55); padding: .15rem .45rem; border-radius: 6px; }
.lcard .body { padding: .8rem .9rem .9rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; min-width: 0; }
.lcard .title { font-weight: 700; font-size: .95rem; line-height: 1.35; color: var(--c-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.lcard.vip-3 .title, .lcard.vip-2 .title { color: var(--c-vip3); text-transform: uppercase; font-size: .88rem; }
.lcard .meta { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.lcard .price { color: var(--c-danger); font-weight: 800; font-size: 1.02rem; }
.lcard .area { font-weight: 600; font-size: .9rem; }
.lcard .ppm { font-size: .78rem; color: var(--c-muted); }
.lcard .loc { font-size: .82rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard .foot { display: flex; align-items: center; justify-content: space-between; font-size: .76rem; color: var(--c-muted); margin-top: auto; padding-top: .35rem; }
.btn-save { border: 0; background: transparent; color: var(--c-muted); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.btn-save:hover { background: var(--c-bg); color: var(--c-danger); }
.btn-save.saved { color: var(--c-danger); }
.btn-save.saved .ic { fill: currentColor; }
.lcard.vip-2 { border-color: #f1d27a; } .lcard.vip-3 { border-color: #e9a3b0; }

/* List row (danh sách chia đôi) */
.lrow { display: grid; grid-template-columns: 120px 1fr; gap: .75rem; padding: .75rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); position: relative; }
@media (min-width: 576px) { .lrow { grid-template-columns: 200px 1fr; } }
.lrow .thumb { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #dfe5e2; position: relative; display: block; }
.lrow .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lrow .body { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.lrow .title { font-weight: 700; font-size: .93rem; line-height: 1.35; color: var(--c-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lrow .price { color: var(--c-danger); font-weight: 800; }
.lrow .specs { display: flex; gap: .7rem; flex-wrap: wrap; font-size: .82rem; color: var(--c-muted); }
.lrow .loc { font-size: .8rem; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow.vip-3 .title, .lrow.vip-2 .title { color: var(--c-vip3); }
.lrow.highlight { outline: 3px solid var(--c-accent); }
.lrow .btn-save { position: absolute; right: .35rem; bottom: .35rem; }

/* ---------- Khu vực nổi bật ---------- */
.area-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .area-grid { grid-template-columns: repeat(4, 1fr); } }
.area-tile { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 110px; padding: 1rem; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(135deg, #0b6e4f, #2b8f6e); }
.area-tile:nth-child(4n+2) { background: linear-gradient(135deg, #0e5a6e, #2b7f97); }
.area-tile:nth-child(4n+3) { background: linear-gradient(135deg, #7a4b16, #b9792e); }
.area-tile:nth-child(4n+4) { background: linear-gradient(135deg, #4b3f7a, #7166b0); }
.area-tile:hover { color: #fff; filter: brightness(1.06); }
.area-tile b { font-size: 1.05rem; }
.area-tile span { font-size: .8rem; opacity: .9; }

/* ---------- Article card ---------- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 576px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .article-grid { grid-template-columns: repeat(4, 1fr); } }
.acard { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--c-ink); box-shadow: var(--shadow); }
.acard:hover { color: var(--c-ink); box-shadow: var(--shadow-lg); }
.acard img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: #dfe5e2; }
.acard .body { padding: .9rem; display: flex; flex-direction: column; gap: .35rem; }
.acard .cat { font-size: .72rem; font-weight: 700; color: var(--c-primary); text-transform: uppercase; letter-spacing: .04em; }
.acard h3 { font-size: 1rem; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard p { font-size: .85rem; color: var(--c-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-content { font-size: 1.02rem; line-height: 1.75; overflow-wrap: anywhere; }
.article-content img { border-radius: 10px; height: auto; }
.article-content table { width: 100%; display: block; overflow-x: auto; }
.article-content h2 { font-size: 1.3rem; margin-top: 1.5rem; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--c-muted); }
.empty-state .es-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--c-primary-50); color: var(--c-primary); display: grid; place-items: center; margin: 0 auto 1rem; }
.empty-state .es-ic .ic { width: 34px; height: 34px; }
.empty-state h3 { font-size: 1.1rem; color: var(--c-ink); }

/* ---------- Trang danh sách chia đôi ---------- */
.split-page { display: grid; grid-template-columns: 1fr; }
.split-list { padding: 1rem 0 1.5rem; min-width: 0; }
.split-map { display: none; position: relative; }
.split-map .map-box { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
@media (min-width: 992px) {
    .split-page { grid-template-columns: minmax(0, 1fr) minmax(0, 42%); }
    .split-map { display: block; }
    .split-list { padding: 1rem 1.25rem 2rem; max-height: none; }
}
/* mobile: chế độ bản đồ */
body.show-map .split-list { display: none; }
body.show-map .split-map { display: block; }
body.show-map .split-map .map-box { height: calc(100vh - var(--header-h) - var(--bottom-nav-h) - var(--safe-b)); height: calc(100dvh - var(--header-h) - var(--bottom-nav-h) - var(--safe-b)); }
.view-toggle { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 14px); z-index: 1020; border-radius: 999px; box-shadow: var(--shadow-lg); padding: 0 1.2rem; }
@media (min-width: 992px) { .view-toggle { display: none !important; } }
.filter-bar { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar .form-select, .filter-bar .btn { flex: 0 0 auto; width: auto; min-width: 0; font-size: .88rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--c-border); background: #fff; padding: .35rem .75rem; border-radius: 999px; font-size: .82rem; color: var(--c-ink); min-height: 36px; }
.chip.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.result-head h1 { font-size: 1.15rem; margin: 0; }
@media (min-width: 768px) { .result-head h1 { font-size: 1.35rem; } }

/* ---------- Chi tiết tin ---------- */
.gallery { position: relative; background: #111; border-radius: var(--radius); overflow: hidden; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track figure { flex: 0 0 100%; scroll-snap-align: center; margin: 0; aspect-ratio: 3 / 2; display: grid; place-items: center; }
.gallery-track img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 768px) { .gallery-track figure { aspect-ratio: 16 / 9; } }
.gallery .g-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); display: grid; place-items: center; }
.gallery .g-prev { left: .6rem; } .gallery .g-next { right: .6rem; }
.gallery .g-count { position: absolute; right: .6rem; bottom: .6rem; background: rgba(0, 0, 0, .6); color: #fff; font-size: .78rem; padding: .2rem .55rem; border-radius: 6px; }
.gallery-thumbs { display: flex; gap: .4rem; overflow-x: auto; margin-top: .5rem; scrollbar-width: thin; }
.gallery-thumbs button { flex: 0 0 82px; height: 58px; border: 2px solid transparent; border-radius: 8px; padding: 0; overflow: hidden; background: #ddd; }
.gallery-thumbs button.active { border-color: var(--c-accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: 1.25rem; line-height: 1.35; margin: 1rem 0 .4rem; }
@media (min-width: 768px) { .detail-title { font-size: 1.55rem; } }
.key-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .9rem 0; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); margin: .75rem 0; }
.key-facts div { min-width: 0; }
.key-facts small { display: block; color: var(--c-muted); font-size: .78rem; }
.key-facts b { font-size: 1.05rem; overflow-wrap: anywhere; }
.key-facts .price b { color: var(--c-danger); }
.spec-table { width: 100%; font-size: .92rem; }
.spec-table th { color: var(--c-muted); font-weight: 500; width: 45%; padding: .55rem 0; border-bottom: 1px dashed var(--c-border); vertical-align: top; }
.spec-table td { font-weight: 600; padding: .55rem 0; border-bottom: 1px dashed var(--c-border); overflow-wrap: anywhere; }
@media (min-width: 768px) { .spec-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.description { white-space: normal; overflow-wrap: anywhere; }
.contact-box { position: sticky; top: calc(var(--header-h) + 1rem); }
.contact-box .avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.mobile-contact-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + var(--safe-b)); z-index: 1025; background: #fff; border-top: 1px solid var(--c-border); padding: .5rem .75rem; display: flex; gap: .5rem; box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }
.mobile-contact-bar .btn { flex: 1; }
@media (min-width: 992px) { .mobile-contact-bar { display: none; } }
body.has-contact-bar { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 64px); }
@media (min-width: 992px) { body.has-contact-bar { padding-bottom: 0; } }
.mini-map { height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); position: relative; z-index: 0; }
@media (min-width: 768px) { .mini-map { height: 380px; } }

/* ---------- Đăng tin (form nhiều bước) ---------- */
.steps { display: flex; gap: .25rem; margin-bottom: 1rem; counter-reset: step; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button { flex: 1 0 auto; border: 0; background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: .55rem .7rem; font-size: .82rem; font-weight: 600; color: var(--c-muted); display: flex; align-items: center; gap: .4rem; min-height: 44px; }
.steps button::before { counter-increment: step; content: counter(step); width: 24px; height: 24px; border-radius: 50%; background: var(--c-bg); display: grid; place-items: center; font-size: .78rem; }
.steps button.active { border-color: var(--c-primary); color: var(--c-primary); }
.steps button.active::before, .steps button.done::before { background: var(--c-primary); color: #fff; }
.step-pane { display: none; }
.step-pane.active { display: block; }
.step-actions { display: flex; gap: .5rem; justify-content: space-between; margin-top: 1.25rem; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--c-bg); border-radius: 10px; padding: 4px; gap: 4px; }
.seg input { display: none; }
.seg label { padding: .55rem 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer; color: var(--c-muted); min-height: 40px; display: inline-flex; align-items: center; }
.seg input:checked + label { background: #fff; color: var(--c-primary); box-shadow: var(--shadow); }
.pick-map { height: 360px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-border); position: relative; z-index: 0; }
.img-uploader { border: 2px dashed #c9d4cf; border-radius: var(--radius); padding: 1.25rem; text-align: center; background: #fafcfb; cursor: pointer; }
.img-uploader.drag { border-color: var(--c-primary); background: var(--c-primary-50); }
.img-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .75rem; }
@media (min-width: 576px) { .img-list { grid-template-columns: repeat(5, 1fr); } }
.img-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e5e9e7; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .rm { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.img-item .mv { position: absolute; bottom: 4px; left: 4px; display: flex; gap: 3px; }
.img-item .mv button { width: 28px; height: 28px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .9); font-size: .8rem; }
.img-item .cover { position: absolute; top: 4px; left: 4px; font-size: .68rem; background: var(--c-accent); color: #fff; padding: 1px 6px; border-radius: 4px; }
.img-item.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%230b6e4f' stroke-width='5' stroke-dasharray='90 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 36px no-repeat; }

/* ---------- Bảng giá đất ---------- */
.table-x { width: 100%; font-size: .9rem; }
.table-x thead th { background: var(--c-primary-50); color: var(--c-primary-600); font-weight: 700; white-space: nowrap; padding: .65rem .6rem; }
.table-x td { padding: .6rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table-x .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* mobile: bảng thành thẻ */
@media (max-width: 767.98px) {
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: .6rem .8rem; margin-bottom: .6rem; }
    .table-cards td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .table-cards td::before { content: attr(data-label); color: var(--c-muted); font-weight: 500; text-align: left; flex-shrink: 0; }
    .table-cards td.td-main { display: block; text-align: left; font-weight: 700; font-size: 1rem; }
    .table-cards td.td-main::before { display: none; }
}

/* ---------- Tài khoản ---------- */
.acc-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 992px) { .acc-layout { grid-template-columns: 260px 1fr; } }
.acc-menu { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.acc-menu::-webkit-scrollbar { display: none; }
.acc-menu a { display: flex; align-items: center; gap: .55rem; padding: .65rem .9rem; color: var(--c-ink); font-weight: 600; border-radius: 10px; white-space: nowrap; font-size: .92rem; background: #fff; border: 1px solid var(--c-border); min-height: 44px; }
.acc-menu a.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
@media (min-width: 992px) { .acc-menu { flex-direction: column; } .acc-menu a { border: 0; background: transparent; } .acc-menu a.active { background: var(--c-primary-50); color: var(--c-primary); } }
.my-listing { display: grid; grid-template-columns: 96px 1fr; gap: .75rem; padding: .85rem; border-bottom: 1px solid var(--c-border); }
@media (min-width: 576px) { .my-listing { grid-template-columns: 140px 1fr; } }
.my-listing img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #ddd; }
.my-listing .acts { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }
.my-listing .acts .btn { min-height: 34px; font-size: .8rem; padding: .25rem .6rem; }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 1.5rem auto; }
.captcha-row { display: flex; gap: .5rem; align-items: center; }
.captcha-row img { height: 44px; border-radius: 8px; border: 1px solid var(--c-border); cursor: pointer; flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #11201b; color: #b9c7c1; padding: 2.5rem 0 1.5rem; margin-top: 2rem; font-size: .9rem; }
.site-footer a { color: #dce7e2; }
.site-footer a:hover { color: #fff; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: .25rem 0; }
.site-footer .copy { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 1.5rem; padding-top: 1rem; font-size: .8rem; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); top: calc(var(--header-h) + 10px); width: min(92vw, 420px); display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast-x { pointer-events: auto; background: #1d2a2f; color: #fff; border-radius: 10px; padding: .75rem 1rem; box-shadow: var(--shadow-lg); font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; animation: toastIn .2s ease-out; }
.toast-x.success { background: #0b6e4f; } .toast-x.danger { background: #b42828; } .toast-x.warning { background: #a8650c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Trang lỗi ---------- */
.error-page { text-align: center; padding: 3rem 1rem; max-width: 560px; margin: 0 auto; }
.error-page .code { font-size: 4.5rem; font-weight: 800; color: var(--c-primary); line-height: 1; }

/* ---------- Leaflet chung ---------- */
.leaflet-container { font-family: var(--bs-body-font-family); }
.leaflet-popup-content { margin: 12px 14px; }
.price-marker { background: var(--c-primary); color: #fff; font-weight: 700; font-size: 11px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); border: 1.5px solid #fff; position: relative; transform: translate(-50%, -100%); display: inline-block; }
.price-marker::after { content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--c-primary); }
.price-marker.rent { background: #2563eb; } .price-marker.rent::after { border-top-color: #2563eb; }
.price-marker.vip { background: var(--c-vip3); } .price-marker.vip::after { border-top-color: var(--c-vip3); }
.price-marker.active { background: var(--c-accent); z-index: 1000; } .price-marker.active::after { border-top-color: var(--c-accent); }
.leaflet-div-icon.pm-wrap { background: transparent; border: 0; }
.marker-cluster-x { background: rgba(11, 110, 79, .25); border-radius: 50%; display: grid; place-items: center; }
.marker-cluster-x div { width: 34px; height: 34px; border-radius: 50%; background: var(--c-primary); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; border: 2px solid #fff; }

.skeleton { background: linear-gradient(90deg, #eef1ef 25%, #e2e7e4 37%, #eef1ef 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.visually-hidden-focusable:focus { position: fixed; top: 6px; left: 6px; z-index: 3000; background: #fff; padding: .5rem 1rem; border-radius: 8px; }
.min-w-0 { min-width: 0; }
.acc-layout > * { min-width: 0; }
.split-page > *, .row > * { min-width: 0; }
.my-listing .acts form { max-width: 100%; }
.my-listing .acts form.d-flex { flex-wrap: wrap; }
.my-listing .acts .form-select { max-width: 100%; min-width: 0; flex: 1 1 160px; }

