/* ==========================================================================
   bdstaybaccuchi — main.css (mobile-first). Dùng biến ở tokens.css.
   ========================================================================== */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 8px); }
body { margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.55; color: var(--c-text); background: var(--c-surface); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-primary); text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 var(--sp-3); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.125em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; clip: auto; width: auto; height: auto; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--sp-4)); margin: 0 auto; padding: 0 var(--sp-4); }
.muted { color: var(--c-muted); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-4); border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-600); color: #fff; }
.btn--accent { background: var(--c-accent); color: #3d2a00; }
.btn--accent:hover { background: var(--c-accent-600); color: #3d2a00; }
.btn--outline { background: #fff; color: var(--c-accent-600); border-color: var(--c-accent); }
.btn--outline:hover { background: var(--c-accent); color: #fff; }
.btn--light { background: #fff; color: var(--c-dark); }
.topbar .btn--light { background: var(--c-primary); color: #fff; }
.topbar .btn--light:hover { background: var(--c-primary-600); color: #fff; }
.btn--zalo { background: var(--c-zalo); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.field { display: block; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: #fff; color: var(--c-text); }
select.field { appearance: none; padding-right: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
textarea.field { min-height: 96px; resize: vertical; }
label.label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-1); }

/* ---------- Top bar ---------- */
.topbar { background: #fff; color: var(--c-dark); border-bottom: 1px solid var(--c-border); }
.topbar__inner { display: flex; align-items: center; gap: var(--sp-3); min-height: 74px; }
.logo { display: flex; align-items: center; gap: var(--sp-2); color: #fff !important; font-weight: 700; font-size: 18px; text-decoration: none !important; line-height: 1.1; }
.logo__mark { width: 36px; height: 36px; border-radius: 8px; background: var(--c-accent); display: grid; place-items: center; }
.logo__mark .icon { width: 22px; height: 22px; stroke: #fff; }
.logo small { display: block; font-weight: 500; font-size: 11px; color: var(--c-accent); letter-spacing: .5px; text-transform: uppercase; }
.logo img { max-height: 58px; width: auto; display: block; }
.custom-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.custom-logo { max-height: 62px; width: auto; height: auto; display: block; }
@media (max-width: 575px) {
	.custom-logo { max-height: 44px; }
	.topbar__inner { min-height: 62px; }
}
.topbar__search { display: none; flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.topbar__search input { width: 100%; height: 36px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 0 40px 0 12px; background: var(--c-surface-2); color: var(--c-text); }
.topbar__search input::placeholder { color: var(--c-muted); }
.topbar__search button { position: absolute; right: 0; top: 0; height: 36px; width: 40px; border: 0; background: none; color: var(--c-muted); cursor: pointer; }
.topbar__actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.topbar__post { display: none; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer; }
.icon-btn .icon { width: 22px; height: 22px; }

/* ---------- Main nav ---------- */
.mainnav { background: var(--c-primary); position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-1); }
.mainnav__list { display: none; list-style: none; margin: 0; padding: 0; }
.mainnav__list > li { position: relative; }
.mainnav__list a { display: flex; align-items: center; gap: 6px; height: var(--nav-h); padding: 0 14px; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.mainnav__list > li:hover > a, .mainnav__list > .current-menu-item > a, .mainnav__list > .current-menu-ancestor > a, .mainnav__list > .current_page_item > a { background: var(--c-accent); }
.mainnav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 240px; list-style: none; margin: 0; padding: 6px 0; background: #fff; border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: var(--shadow-2); }
.mainnav .sub-menu a { height: auto; padding: 8px 16px; color: var(--c-text); font-weight: 400; }
.mainnav .sub-menu a:hover { background: var(--c-primary-50); color: var(--c-primary); }
.mainnav li:hover > .sub-menu, .mainnav li:focus-within > .sub-menu { display: block; }
.mainnav__mobile { display: flex; align-items: center; height: var(--nav-h); gap: var(--sp-2); color: #fff; overflow-x: auto; scrollbar-width: none; }
.mainnav__mobile a { color: #fff; font-size: 14px; padding: 6px 10px; border-radius: 99px; white-space: nowrap; background: rgba(255,255,255,.12); text-decoration: none; }

/* Drawer (mobile) */
.drawer { position: fixed; inset: 0; z-index: 90; display: none; }
.drawer.is-open { display: block; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); background: #fff; overflow-y: auto; padding: var(--sp-4); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(-100%); } }
.drawer__menu, .drawer__menu ul { list-style: none; margin: 0; padding: 0; }
.drawer__menu a { display: block; padding: 10px 4px; color: var(--c-text); border-bottom: 1px solid var(--c-border); }
.drawer__menu ul a { padding-left: 20px; font-size: 14px; color: var(--c-muted); }

/* ---------- Section title ---------- */
.section { margin-bottom: var(--sp-6); }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3); border-bottom: 2px solid var(--c-primary); margin-bottom: var(--sp-4); }
.section-title h2, .section-title h1 { margin: 0; background: var(--c-primary); color: #fff; font-size: var(--fs-lg); font-weight: 600; text-transform: uppercase; padding: 6px 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.section-title a { font-size: 14px; padding-bottom: 4px; }
.section-title__nav { display: flex; gap: 4px; padding-bottom: 4px; }
.section-title__nav button { width: 30px; height: 28px; border: 1px solid var(--c-border); background: #fff; border-radius: var(--radius-sm); cursor: pointer; }

/* ---------- Hero search ---------- */
/* ---- Hero: ảnh bìa thương hiệu làm nền, thẻ tìm kiếm bên trái ---- */
.hero {
	position: relative;
	background: var(--c-darker) center right / cover no-repeat;
	color: var(--c-text);
	/* Ảnh bìa tỉ lệ 2546x969 — giữ chiều cao hero khớp để không cắt mất phần thương hiệu */
	min-height: min(calc(100vw / 2.627), 620px);
}
/* Chỉ tối nhẹ bên trái để thẻ tìm kiếm nổi — giữ nguyên phần thương hiệu bên phải ảnh */
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,20,35,.30) 0%, rgba(10,20,35,.12) 38%, rgba(10,20,35,0) 62%); }
.hero__inner { position: relative; display: flex; align-items: center; min-height: inherit; padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
.hero__box { width: min(630px, 58%); background: rgba(255,255,255,.98); border-radius: var(--radius); padding: var(--sp-4); box-shadow: 0 20px 55px rgba(8,18,32,.30); }
.hero__box .demand-tabs button { border-color: var(--c-border); background: var(--c-surface-2); color: var(--c-muted); }
.hero__box .demand-tabs button[aria-selected="true"] { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.hero__box .hero__stats { color: var(--c-muted); }
.hero__box .hero__stats b { color: var(--c-primary); }
.hero__box .hero__query .field { border: 1px solid var(--c-border); background: #fff; }
.hero__box .filter-grid { grid-template-columns: repeat(2, 1fr); }
.hero__box .filter-grid .field { border: 1px solid var(--c-border); background: #fff; }

@media (max-width: 991px) {
	.hero { min-height: min(calc(100vw / 2.627), 460px); }
	.hero__box { width: min(560px, 74%); }
}
@media (max-width: 767px) {
	/* Mobile: ảnh bìa thành dải phía trên, thẻ tìm kiếm nằm dưới cho khỏi che thương hiệu */
	.hero { min-height: 0; background-size: 100% auto; background-position: top center; background-color: #fff; }
	.hero::before { display: none; }
	.hero__inner { display: block; min-height: 0; padding-top: calc(38.1vw + 14px); padding-bottom: var(--sp-4); }
	.hero__box { width: 100%; box-shadow: 0 6px 20px rgba(8,18,32,.14); border: 1px solid var(--c-border); }
}
.hero__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.hero__stats { font-size: 15px; }
.hero__stats b { font-size: 24px; }
.demand-tabs { display: flex; gap: 0; }
.demand-tabs button { border: 1px solid var(--c-accent); background: #fff; color: var(--c-accent-600); padding: 8px 12px; font-size: 14px; cursor: pointer; }
.demand-tabs button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.demand-tabs button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.demand-tabs button[aria-selected="true"] { background: var(--c-accent); color: #fff; font-weight: 600; }
.hero__query { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.hero__query .field { flex: 1; }
.filter-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
.filter-grid .field { font-size: 14px; }
.hero h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: var(--sp-5); padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: var(--sp-4) 0 0; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: 14px; background: #fff; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--c-muted); }
.breadcrumb li:last-child { color: var(--c-muted); }

/* ---------- Card: row ---------- */
.card-list { display: grid; gap: var(--sp-3); }
.card-row { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-3); background: var(--c-surface-2); border-radius: var(--radius-sm); overflow: hidden; }
.card-row__media { position: relative; aspect-ratio: 4 / 3; background: #ddd; }
.card-row__media img { width: 100%; height: 100%; object-fit: cover; }
.card-row__body { padding: var(--sp-2) var(--sp-2) var(--sp-2) 0; min-width: 0; }
.card-row__title { font-size: 15px; font-weight: 600; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-row__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--sp-3); font-size: var(--fs-sm); color: var(--c-muted); }
.card-row__meta span { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-row__meta .is-strong { color: var(--c-text); font-weight: 600; }
.price-tag { display: inline-block; background: var(--c-accent); color: #fff; font-size: var(--fs-sm); padding: 3px 8px; border-radius: var(--radius-sm); font-weight: 500; white-space: nowrap; }
.price-tag b { font-weight: 700; }
.card-row__price { margin-top: 6px; }
.badge { position: absolute; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 7px; border-radius: var(--radius-sm); color: #fff; }
.badge--vip { left: 6px; top: 6px; background: var(--c-vip); }
.badge--sold { right: 6px; top: 6px; background: var(--c-danger); }

/* ---------- Card: tile ---------- */
.tile-track { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; }
.tile-track::-webkit-scrollbar { display: none; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.card-tile { position: relative; scroll-snap-align: start; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.card-tile__media { position: relative; aspect-ratio: 4 / 3; background: #ddd; }
.card-tile__media img { width: 100%; height: 100%; object-fit: cover; }
.card-tile__area { position: absolute; left: 0; top: 0; background: var(--c-primary); color: #fff; font-size: 12px; font-weight: 600; text-transform: uppercase; padding: 4px 8px; display: flex; gap: 4px; align-items: center; max-width: 90%; }
.card-tile__price { position: absolute; right: 0; bottom: 0; background: var(--c-accent); color: #fff; font-size: 14px; font-weight: 600; padding: 3px 10px; text-transform: uppercase; }
.card-tile .badge--vip { top: auto; bottom: 6px; left: 6px; }
.card-tile__body { padding: var(--sp-2) var(--sp-3) var(--sp-3); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-tile__title { font-size: 14px; font-weight: 600; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-tile__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--c-muted); }
.card-tile__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--c-muted); }

/* Placeholder ảnh khi tin chưa có ảnh */
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #f7dbdd, #f6ecd2); color: var(--c-primary); }
.ph .icon { width: 36%; height: 36%; opacity: .45; }

/* ---------- News ---------- */
.news-feature { display: grid; gap: var(--sp-4); }
.news-main__media { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: #ddd; margin-bottom: var(--sp-2); }
.news-main__media img { width: 100%; height: 100%; object-fit: cover; }
.news-main h3 { font-size: 18px; }
.news-list { display: grid; gap: var(--sp-3); list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 110px 1fr; gap: var(--sp-3); }
.news-item__media { display: block; aspect-ratio: 11 / 7; border-radius: var(--radius-sm); overflow: hidden; background: #ddd; }
.news-item__media img { width: 100%; height: 100%; object-fit: cover; }
.news-item h3 { font-size: 14px; margin: 0 0 4px; }
.news-item p { font-size: 13px; color: var(--c-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Sidebar widgets ---------- */
.sidebar { display: grid; gap: var(--sp-5); align-content: start; }
.widget .section-title { margin-bottom: var(--sp-2); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px solid var(--c-border); }
.link-list a { display: flex; justify-content: space-between; gap: var(--sp-2); padding: 7px 0; font-size: 14px; }
.link-list a::before { content: "›"; color: var(--c-primary); font-weight: 700; margin-right: 6px; }
.link-list a span:first-child { flex: 1; }
.link-list small { color: var(--c-muted); }
.widget-banner img { border-radius: var(--radius-sm); width: 100%; }
.mini-post { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-2); padding: 6px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.mini-post__media { display: block; aspect-ratio: 4 / 3; background: #ddd; border-radius: 3px; overflow: hidden; }
.mini-post__media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Single listing ---------- */
.listing__head { background: var(--c-accent-50); border: 1px solid #f2dfae; border-bottom: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.listing__head h1 { font-size: var(--fs-xl); margin: 0 0 6px; color: var(--c-text); }
.listing__addr { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--c-muted); margin: 0; }
.listing__tools { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.gallery { background: #111; }
.gallery__main { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 16 / 10; }
.gallery__main::-webkit-scrollbar { display: none; }
.gallery__main figure { margin: 0; scroll-snap-align: center; position: relative; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery__count { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.gallery__thumbs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; background: #fff; border: 1px solid var(--c-border); }
.gallery__thumbs button { flex: none; width: 76px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; background: #ddd; }
.gallery__thumbs button[aria-current="true"] { border-color: var(--c-accent); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.media-tabs { display: flex; border: 1px solid var(--c-border); border-top: 0; background: #fff; }
.media-tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--c-muted); }
.media-tabs button[aria-selected="true"] { background: var(--c-primary); color: #fff; }
.media-panel[hidden] { display: none; }
.media-panel iframe { width: 100%; aspect-ratio: 16 / 10; border: 0; display: block; }
.price-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-2); background: var(--c-accent-50); border: 1px solid #f2dfae; margin-top: var(--sp-3); padding-left: var(--sp-4); }
.price-bar__where { font-size: 14px; color: var(--c-primary); padding: 8px 0; }
.price-flag { background: var(--c-primary); color: #fff; padding: 8px 16px 8px 26px; clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); font-size: 15px; }
.price-flag b { font-size: 22px; }
.price-flag small { opacity: .85; margin-left: 6px; }
.box { background: #fff; border: 1px solid var(--c-border); border-top: 0; padding: var(--sp-4); }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--c-border); border-width: 1px 0 0 1px; margin: 0 0 var(--sp-4); }
.spec-grid div { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--c-border); border-width: 0 1px 1px 0; font-size: 14px; min-width: 0; }
.spec-grid .icon { color: var(--c-primary); }
.spec-grid dt { color: var(--c-muted); }
.spec-grid dd { margin: 0; font-weight: 600; }
.meta-line { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--c-muted); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-4); }
.prose { font-size: var(--fs-md); }
.prose p { margin: 0 0 var(--sp-3); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); list-style: none; padding: 0; margin: 0; }
.chips li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--c-accent-50); color: var(--c-accent-600); border-radius: 99px; font-size: 13px; font-weight: 500; }
.sub-title { font-size: 16px; text-transform: uppercase; color: var(--c-primary); border-left: 4px solid var(--c-accent); padding-left: 8px; margin: var(--sp-5) 0 var(--sp-3); }
.agent-box { display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-3); align-items: center; padding: var(--sp-4); border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.agent-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--c-primary-50); color: transparent; }
.agent-box__name { font-weight: 600; margin: 0; }
.agent-box__actions { grid-column: 1 / -1; display: grid; gap: var(--sp-2); }
.lead-form { display: grid; gap: var(--sp-2); }
.lead-form .hp { position: absolute; left: -9999px; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.notice--ok { background: var(--c-accent-50); color: var(--c-accent-600); }
.notice--err { background: #fdecea; color: var(--c-danger); }

/* Contact bar (mobile) */
.contact-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; padding: 8px; background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.12); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.has-contact-bar { padding-bottom: 72px; }

/* Lightbox */
.lightbox { padding: 0; border: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(0,0,0,.92); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lightbox button { position: absolute; top: 12px; right: 12px; color: #fff; background: rgba(255,255,255,.15); }

/* ---------- Archive ---------- */
.archive-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.archive-head h1 { font-size: var(--fs-xl); margin: 0; }
.archive-tools { display: flex; gap: var(--sp-2); }
.filter-panel { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: var(--sp-4); display: grid; gap: var(--sp-3); }
.filter-sheet { position: fixed; inset: auto 0 0 0; z-index: 80; max-height: 85vh; overflow-y: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-2); transform: translateY(100%); transition: transform .2s; }
.filter-sheet.is-open { transform: none; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-5); }
.pagination .page-numbers { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 8px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); color: var(--c-text); }
.pagination .current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.empty { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--c-muted); background: var(--c-surface-2); border-radius: var(--radius); }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-dark); color: #ddd; margin-top: var(--sp-6); }
.site-footer__cols { display: grid; gap: var(--sp-5); padding: var(--sp-6) 0; }
.site-footer h3 { color: #fff; font-size: 16px; font-weight: 600; text-transform: uppercase; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #ddd; font-size: 14px; }
.site-footer a::before { content: "› "; }
.site-footer a.no-arrow::before, .site-footer .btn::before { content: none; }
.site-footer p { font-size: 14px; margin: 0 0 6px; }
.site-footer__bottom { background: var(--c-darker); text-align: center; font-size: 13px; padding: var(--sp-3) 0; color: #aaa; }
.app-links { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }

/* ---------- Page / post ---------- */
.entry { background: #fff; }
.entry h1 { font-size: var(--fs-xl); }
.entry-meta { font-size: 13px; color: var(--c-muted); margin-bottom: var(--sp-4); }
.post-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ==========================================================================
   Breakpoints
   ========================================================================== */
@media (min-width: 576px) {
	.card-row { grid-template-columns: 170px 1fr; }
	.card-row__body { padding: var(--sp-3) var(--sp-3) var(--sp-3) 0; }
	.card-row__price { position: absolute; right: 0; top: 0; margin: 0; }
	.card-row__price .price-tag { border-radius: 0 0 0 var(--radius-sm); padding: 5px 10px; font-size: 14px; }
	.card-row__title { padding-right: 190px; font-size: 16px; }
	.tile-track { grid-auto-columns: calc((100% - 2 * var(--sp-3)) / 2.3); }
	.filter-grid { grid-template-columns: repeat(3, 1fr); }
	.hero__box .filter-grid { grid-template-columns: repeat(2, 1fr); }
	.spec-grid { grid-template-columns: repeat(3, 1fr); }
	.agent-box__actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
	.topbar__search { display: block; }
	.topbar__post { display: inline-flex; }
	.topbar__actions { margin-left: 0; }
	.topbar .js-open-search { display: none; }
	.card-row { grid-template-columns: 190px 1fr; }
	.card-row__media { aspect-ratio: auto; min-height: 112px; }
	.news-feature { grid-template-columns: 1fr 1fr; }
	.site-footer__cols { grid-template-columns: repeat(2, 1fr); }
	.contact-bar { display: none; }
	.has-contact-bar { padding-bottom: 0; }
	.filter-sheet { position: static; transform: none; box-shadow: none; max-height: none; border-radius: var(--radius-sm); }
	.js-open-filter { display: none !important; }
	.filter-sheet .js-close-filter { display: none; }
}
@media (min-width: 992px) {
	.mainnav__list { display: flex; }
	.mainnav__mobile, .js-open-drawer { display: none !important; }
	.layout { grid-template-columns: minmax(0, 1fr) 300px; }
	.layout--wide-side { grid-template-columns: minmax(0, 1fr) 340px; }
	.layout--filter { grid-template-columns: 280px minmax(0, 1fr); }
	.filter-grid { grid-template-columns: repeat(7, 1fr); }
	.hero__box .filter-grid { grid-template-columns: repeat(2, 1fr); }
	.hero__inner { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
	.tile-track { grid-auto-columns: calc((100% - 2 * var(--sp-3)) / 3); }
	.spec-grid { grid-template-columns: repeat(4, 1fr); }
	.site-footer__cols { grid-template-columns: repeat(4, 1fr); }
	.sidebar--sticky { position: sticky; top: calc(var(--nav-h) + 16px); }
	.agent-box__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.side__head { margin-bottom: var(--sp-3); }
.side__head .demand-tabs { flex-wrap: wrap; }
.bds-search--side .filter-grid { grid-template-columns: 1fr !important; }
.hero__stats { margin: 0; }
.filter-panel { align-content: start; align-self: start; }
@media (max-width: 575.98px) {
	.card-row__meta { grid-template-columns: 1fr; }
	.card-row__meta span:nth-child(1), .card-row__meta span:nth-child(4) { display: none; }
}
@media (min-width: 992px) {
	.layout--filter .filter-panel { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto; }
}

/* ---- Danh sách bài nhỏ (Tư vấn / Phong thủy) ---- */
.mini-posts { display: flex; flex-direction: column; }
.mini-post { display: grid; grid-template-columns: 74px 1fr; gap: var(--sp-2); padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; line-height: 1.45; align-items: start; }
.mini-post:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-post__media { display: block; aspect-ratio: 4 / 3; background: var(--c-surface-2); border-radius: 3px; overflow: hidden; }
.mini-post__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-post__media .ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--c-primary); }
.mini-post__title { color: var(--c-text); }
.mini-post:hover .mini-post__title { color: var(--c-primary); }

/* ---- Ghi chú xã cũ sau sáp nhập ---- */
.old-area-note { background: var(--c-primary-50); border-left: 3px solid var(--c-primary); padding: 8px 12px; margin: var(--sp-3) 0; font-size: 13px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.old-area-note strong { color: var(--c-primary); }
.old-area-note--inline { display: inline-block; margin: 0 0 var(--sp-2); }

/* ---- Sidebar khu vực kèm tên xã cũ ---- */
.link-list--area > li { padding-bottom: 8px; }
.link-list--area .link-list__old { display: block; font-size: 11.5px; color: var(--c-muted); font-style: italic; padding-left: 14px; line-height: 1.4; }

/* ---- Bảng tra cứu sáp nhập ---- */
.bds-merge-map table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bds-merge-map th { background: var(--c-primary); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; }
.bds-merge-map td { border: 1px solid var(--c-border); padding: 10px 12px; vertical-align: top; }
.bds-merge-map tbody tr:nth-child(even) { background: var(--c-surface-2); }
.bds-merge-map td strong { color: var(--c-primary); }

/* ---- Widget Thống kê truy cập ---- */
.stats-list { list-style: none; margin: 0; padding: 0; }
.stats-list > li { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); padding: 7px 0; border-bottom: 1px dashed var(--c-border); font-size: 13px; }
.stats-list > li:last-child { border-bottom: 0; }
.stats-list__label { color: var(--c-muted); display: inline-flex; align-items: center; gap: 6px; }
.stats-list strong { color: var(--c-primary); font-size: 15px; font-weight: 700; }
.stats-list__online strong { color: #1a7f5a; }
.stats-list .dot { width: 8px; height: 8px; border-radius: 50%; background: #1a7f5a; display: inline-block; box-shadow: 0 0 0 3px rgba(26,127,90,.18); animation: bds-pulse 1.8s infinite; }
@keyframes bds-pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.stats-list__top { flex-direction: column; align-items: flex-start; }
.stats-list__top strong { margin-top: 2px; }
.stats-list__link { font-size: 12.5px; color: var(--c-text); line-height: 1.45; }
.stats-list__link:hover { color: var(--c-primary); }

/* ============================================================
   Khung chat tư vấn tự động (trợ lý ảo)
   ============================================================ */
.bds-chat { position: fixed; right: 18px; bottom: 18px; z-index: 9000; font-size: 14px; }
.bds-chat__fab { display: inline-flex; align-items: center; gap: 9px; background: var(--c-primary); color: #fff; border: 0; border-radius: 999px; padding: 12px 20px; font-size: 14.5px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(202,37,43,.38); font-family: inherit; transition: transform .15s, box-shadow .15s; }
.bds-chat__fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(202,37,43,.46); }
.bds-chat__fab-icon { display: inline-flex; }
.bds-chat.is-open .bds-chat__fab { display: none; }

.bds-chat__panel { position: absolute; right: 0; bottom: 0; width: 380px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 40px); background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(14,28,46,.32); display: flex; flex-direction: column; overflow: hidden; }
.bds-chat__panel[hidden] { display: none; }

.bds-chat__head { display: flex; align-items: center; gap: 11px; background: var(--c-primary); color: #fff; padding: 13px 15px; }
.bds-chat__avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.bds-chat__who { flex: 1; min-width: 0; }
.bds-chat__who strong { display: block; font-size: 14.5px; }
.bds-chat__who small { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,.85); margin-top: 2px; }
.bds-chat__dot { width: 7px; height: 7px; border-radius: 50%; background: #7ee2a8; display: inline-block; }
.bds-chat__close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .85; }
.bds-chat__close:hover { opacity: 1; }

.bds-chat__body { flex: 1; overflow-y: auto; padding: 15px; background: #f4f6f9; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }

.bds-msg { display: flex; }
.bds-msg--user { justify-content: flex-end; }
.bds-msg--bot { flex-direction: column; align-items: flex-start; }
.bds-msg__bubble { max-width: 86%; padding: 10px 13px; border-radius: 14px; line-height: 1.5; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.bds-msg--bot .bds-msg__bubble { background: #fff; color: var(--c-text); border: 1px solid var(--c-border); border-bottom-left-radius: 4px; }
.bds-msg--user .bds-msg__bubble { background: var(--c-primary); color: #fff; border-bottom-right-radius: 4px; }

.bds-typing { display: inline-flex; gap: 4px; padding: 13px !important; }
.bds-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9c3cf; animation: bds-typing 1.2s infinite; }
.bds-typing span:nth-child(2) { animation-delay: .18s; }
.bds-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes bds-typing { 0%,60%,100% { transform: translateY(0); opacity: .5 } 30% { transform: translateY(-4px); opacity: 1 } }

.bds-chat__listings { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; width: 100%; }
.bds-card-chat { display: grid; grid-template-columns: 78px 1fr; gap: 10px; background: #fff; border: 1px solid var(--c-border); border-left: 3px solid var(--c-primary); border-radius: 9px; padding: 9px; text-decoration: none !important; color: inherit; transition: box-shadow .15s, transform .15s; }
.bds-card-chat:hover { box-shadow: 0 6px 16px rgba(14,28,46,.13); transform: translateY(-1px); }
.bds-card-chat__media { width: 78px; height: 62px; border-radius: 6px; overflow: hidden; background: var(--c-surface-2); display: grid; place-items: center; font-size: 22px; }
.bds-card-chat__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bds-card-chat__info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bds-card-chat__title { font-size: 13px; font-weight: 600; color: var(--c-text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bds-card-chat__meta { display: flex; gap: 9px; align-items: baseline; }
.bds-card-chat__price { color: var(--c-primary); font-size: 14px; }
.bds-card-chat__loc { font-size: 11.5px; color: var(--c-muted); }
.bds-card-chat__cta { font-size: 11.5px; color: var(--c-primary); font-weight: 700; margin-top: 2px; }

.bds-chat__quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 15px 0; background: #fff; border-top: 1px solid var(--c-border); }
.bds-chat__quick:empty { display: none; }
.bds-chat__quick button { background: var(--c-primary-50); color: var(--c-primary); border: 1px solid #f3cfd1; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.bds-chat__quick button:hover { background: var(--c-primary); color: #fff; }

.bds-chat__form { display: flex; gap: 7px; padding: 11px 15px; background: #fff; }
.bds-chat__form input { flex: 1; border: 1px solid var(--c-border); border-radius: 999px; padding: 10px 15px; font-size: 13.5px; font-family: inherit; outline: none; }
.bds-chat__form input:focus { border-color: var(--c-primary); }
.bds-chat__form button { width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--c-primary); color: #fff; cursor: pointer; display: grid; place-items: center; }
.bds-chat__form button:disabled { opacity: .5; cursor: default; }

.bds-chat__foot { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; padding: 0 15px 11px; background: #fff; font-size: 11px; color: var(--c-muted); }
.bds-chat__foot a { color: var(--c-primary); font-weight: 700; text-decoration: none !important; }
.bds-chat__foot span { flex: 1 1 100%; line-height: 1.4; }

/* Nằm trên thanh liên hệ cố định ở mobile */
@media (max-width: 768px) {
	.bds-chat { right: 12px; bottom: 78px; }
	.bds-chat__fab-text { display: none; }
	.bds-chat__fab { padding: 14px; }
	.bds-chat__panel { position: fixed; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; border-radius: 0; }
}
