/* Trang Mặt bằng – mặt bằng tầng ốp lên ảnh tổng mặt bằng, bộ lọc, thông tin căn, danh sách */
body { padding-top: calc(var(--nav-h) + var(--safe-t)); background: #f3efe6; }
.mb-wrap { max-width: 1480px; margin: 0 auto; padding: 0 18px; }

/* ---------- đầu trang + bộ lọc ---------- */
.mb-head { padding: 12px 0 12px; }
.mb-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mb-title h1 { margin: 2px 0 0; font-size: clamp(24px, 2.4vw, 32px); }
.mb-sum { display: flex; gap: 22px; color: var(--b-cream); flex-wrap: wrap; }
.mb-sum div { font-size: 22px; font-weight: 300; color: var(--b-gold2); line-height: 1.1; }
.mb-sum span { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #b9cbc3; font-weight: 600; margin-top: 3px; }
.mb-ftoggle { display: none; }
.mb-filters { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 10px; padding: 10px 16px 12px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid var(--b-line); align-items: flex-start; }
.mb-filters .fg { flex: 0 1 auto; } .mb-filters .fr { flex: 1 1 190px; min-width: 190px; max-width: 260px; }
.fl { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--b-gold); font-weight: 700; margin-bottom: 6px; white-space: nowrap; }
.fl b { color: var(--b-cream); letter-spacing: 0; text-transform: none; font-size: 12px; margin-left: 6px; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fchip { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--b-cream); background: rgba(255,255,255,.06); border: 1px solid rgba(239,220,182,.28); border-radius: 999px; padding: 5px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fchip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fchip small { color: #a9bdb4; font-weight: 500; }
.fchip:hover { border-color: var(--b-gold); }
.fchip.on { background: var(--b-gold2); color: #10352c; border-color: var(--b-gold2); }
.fchip.on small { color: #5b6b62; }
.fclear { font: inherit; font-size: 12.5px; background: none; border: 0; color: var(--b-gold2); text-decoration: underline; cursor: pointer; margin-left: 6px; }
.range { position: relative; height: 26px; margin: 0 4px; }
.range::before { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); }
.range i { position: absolute; top: 11px; height: 4px; border-radius: 2px; background: var(--b-gold); }
.range input { position: absolute; left: 0; width: 100%; top: 2px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 22px; z-index: 1; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--b-gold); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.range input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--b-gold); cursor: pointer; }
.range input::-moz-range-track { background: none; }

/* ---------- bố cục chính ---------- */
.mb-main { max-width: 1480px; margin: 0 auto; padding: 14px 18px 40px; display: grid; gap: 14px; grid-template-columns: 70px minmax(0, 1fr) 380px; grid-template-areas: "floors stage side" "floors list side"; align-items: start; }
.mb-floors { grid-area: floors; } .mb-stage { grid-area: stage; } .mb-side { grid-area: side; position: sticky; top: calc(var(--nav-h) + var(--safe-t) + 12px); max-height: calc(100vh - var(--nav-h) - var(--safe-t) - 24px); overflow-y: auto; } .mb-list { grid-area: list; }
.mb-stage, .mb-list, .mb-side > * { background: #fff; border-radius: 18px; box-shadow: 0 1px 3px rgba(15,58,49,.08), 0 8px 24px rgba(15,58,49,.05); }

/* thang tầng: mô phỏng thân tháp, tầng cao ở trên */
.mb-floors { position: sticky; top: calc(var(--nav-h) + var(--safe-t) + 12px); background: linear-gradient(180deg, #1d4b40, #0f3a31); border-radius: 18px; padding: 10px 7px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - var(--nav-h) - var(--safe-t) - 24px); overflow-y: auto; scrollbar-width: none; }
.mb-floors::-webkit-scrollbar { display: none; }
.mb-floors .cap { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--b-gold); text-align: center; font-weight: 700; margin: 0 0 4px; }
.mb-floors button { font: inherit; font-size: 12.5px; font-weight: 700; border: 0; border-radius: 6px; background: rgba(255,255,255,.08); color: var(--b-cream); padding: 3px 0; cursor: pointer; flex: none; }
.mb-floors button:hover { background: rgba(239,220,182,.25); }
.mb-floors button.on { background: var(--b-gold2); color: #10352c; box-shadow: 0 0 0 2px rgba(239,220,182,.35); }
.mb-floors button:disabled { background: none; color: rgba(255,255,255,.25); font-weight: 500; font-size: 10px; cursor: default; padding: 1px 0; }
.mb-floors .gap { height: 6px; flex: none; }

/* thanh trên mặt bằng */
.mb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.mb-ft { font-size: 14px; } .mb-ft b { font-size: 26px; color: var(--green); font-weight: 800; vertical-align: -2px; margin: 0 4px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tbtn { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--green); background: #f4f0e6; border: 1px solid #e6dcc6; border-radius: 999px; padding: 6px 12px; text-decoration: none; cursor: pointer; }
.tbtn.on { background: var(--green); color: #fff; border-color: var(--green); }
.tbtn:disabled { opacity: .5; }

/* khung mặt bằng */
.viewer { position: relative; overflow: hidden; height: max(560px, calc(100vh - var(--nav-h) - var(--safe-t) - 90px)); background: #e9e4d6; touch-action: none; border-radius: 0 0 18px 18px; cursor: grab; user-select: none; -webkit-user-select: none; }
.viewer.drag { cursor: grabbing; }
.viewer > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#plan .bgimg { transition: opacity .3s; }
#plan.nobg .bgimg { opacity: 0; }
#plan .tshadow { fill: none; stroke: rgba(0,0,0,.35); stroke-width: .8; filter: blur(.6px); }
#plan .tbase { fill: #fbfaf6; }
.u { cursor: pointer; }
.u path { fill-opacity: .12; stroke: #fff; stroke-width: .16; stroke-linejoin: round; transition: fill-opacity .15s, opacity .2s; }
.u:hover path, .u.hov path { fill-opacity: .55; stroke: #0f3a31; stroke-width: .3; }
.u.sel path { fill: #f2cf7d; fill-opacity: .95; stroke: #a8741c; stroke-width: .55; }
.u.sel { animation: selPulse 1.6s ease-in-out infinite; }
@keyframes selPulse { 50% { filter: drop-shadow(0 0 .9px #f6d27a); } }
.u.dim path { fill: #e9e6df; fill-opacity: .78; stroke: rgba(255,255,255,.4); }

/* nhãn căn: nhìn xa = mã căn trong ô; nhìn gần = mã trong ô mờ đi + thẻ ngoài tòa nối bằng nét đứt */
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; display: none; overflow: visible; }
.leaders line { stroke: #0f3a31; stroke-width: 1.4; stroke-dasharray: 5 3; filter: drop-shadow(0 0 1.2px #fff) drop-shadow(0 0 1px #fff); }
.leaders circle { fill: #fff; stroke: #0f3a31; stroke-width: 1.5; }
.leaders g.sel line { stroke: #a8741c; stroke-width: 2; opacity: 1; stroke-dasharray: none; }
.leaders g.sel circle { fill: #f2cf7d; stroke: #a8741c; }
.lb { display: none !important; position: absolute; left: 0; top: 0; white-space: nowrap; color: #10352c; will-change: transform; }
.lb .c { display: inline-block; font-weight: 800; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--tc); box-shadow: 0 1px 3px rgba(0,0,0,.25); letter-spacing: .02em; }
.lb.sel .c { background: #a8741c; color: #fff; }
.lb.dim { opacity: .25; }
.tagmode .leaders { display: block; }
.tagmode .lb .c { background: none; box-shadow: none; font-size: 12px; color: rgba(15,58,49,.42); padding: 0; transform: translateY(-13px); }
.tagmode .lb.sel .c { color: rgba(120,80,15,.6); background: none; }
.tagmode .lb.dim { opacity: 0; }
.near .lb { visibility: hidden; }
.tg { position: absolute; left: 0; top: 0; display: none; pointer-events: auto; cursor: pointer; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); padding: 4px 9px 5px 12px; min-width: 100px; white-space: nowrap; line-height: 1.22; will-change: transform; overflow: hidden; }
.tg::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tc); }
.tg b { display: block; font-size: 13.5px; font-weight: 800; color: #0f3a31; letter-spacing: .02em; }
.tg .d { display: block; font-size: 10.5px; color: #4b5a52; font-weight: 600; }
.tg .p { display: block; font-size: 13px; font-weight: 800; color: #8a2a12; margin-top: 1px; }
.tg:hover { box-shadow: 0 0 0 2px #0f3a31, 0 4px 12px rgba(0,0,0,.3); z-index: 3; }
.tg.sel { background: #fff7e2; box-shadow: 0 0 0 2.5px #a8741c, 0 4px 14px rgba(0,0,0,.3); z-index: 4; }
.tg.sel::before { background: #a8741c; }
.labels:not(.tagmode) .tg { display: none !important; }

.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.zoom button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.95); box-shadow: 0 1px 5px rgba(0,0,0,.25); font-size: 18px; color: var(--green); cursor: pointer; font-weight: 700; }
.north { position: absolute; left: 12px; top: 12px; width: 44px; height: 44px; z-index: 3; }
.north circle { fill: rgba(255,255,255,.94); stroke: #d8bf92; stroke-width: 1.5; }
.north path { fill: #a8741c; } .north text { font: 800 9px 'Be Vietnam Pro', Arial; fill: #10352c; text-anchor: middle; }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 3; display: flex; gap: 4px; flex-wrap: wrap; max-width: calc(100% - 24px); }
.legend span { background: rgba(255,255,255,.94); border-radius: 7px; padding: 3px 8px; font-size: 11.5px; font-weight: 600; color: #24302a; box-shadow: 0 1px 3px rgba(0,0,0,.18); display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.legend .sel i { background: #f2cf7d; border-color: #a8741c; }
.hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; background: rgba(15,58,49,.86); color: #fff; font-size: 12px; padding: 6px 12px; border-radius: 999px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.hint.off { opacity: 0; }

/* thẻ khi rê chuột: Mã căn – tầng / loại / DT / hướng / giá */
.tipbox { position: absolute; z-index: 5; pointer-events: none; min-width: 210px; background: #0f3a31; color: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); overflow: hidden; display: none; }
.tipbox .th { padding: 9px 14px 8px; display: flex; align-items: baseline; gap: 8px; border-bottom: 3px solid var(--tc); }
.tipbox .th b { font-size: 22px; color: var(--b-gold2); font-weight: 800; letter-spacing: .01em; }
.tipbox .th span { font-size: 12.5px; color: #c6d6cf; font-weight: 600; }
.tipbox dl { margin: 0; padding: 8px 14px 10px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.tipbox dt { color: #a9bdb4; } .tipbox dd { margin: 0; text-align: right; font-weight: 700; }
.tipbox dd.pr { color: var(--b-gold2); font-size: 16px; }
.tipbox .tp { display: inline-flex; align-items: center; gap: 6px; } .tipbox .tp i { width: 10px; height: 10px; border-radius: 3px; background: var(--tc); }

/* ---------- thông tin căn ---------- */
.mb-empty { padding: 26px 22px; color: var(--muted); font-size: 14px; line-height: 1.55; text-align: center; }
.mb-empty b { display: block; font-size: 18px; color: var(--green); margin-bottom: 6px; }
.uc { padding: 18px 18px 16px; display: grid; gap: 12px; }
.uc-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.uc-h .ey { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: #8a7547; font-weight: 700; }
.uc-h h2 { margin: 2px 0 6px; font-size: 38px; line-height: 1; color: var(--green); font-weight: 800; letter-spacing: -.01em; }
.uc-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.uc-tags span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #f1ece0; color: #3d4a43; display: inline-flex; gap: 5px; align-items: center; }
.uc-tags i { width: 9px; height: 9px; border-radius: 3px; background: var(--tc); }
.uc-nav { display: flex; gap: 4px; } .uc-nav button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e6dcc6; background: #fff; color: var(--green); font-size: 15px; cursor: pointer; }
.uc-img { position: relative; border-radius: 14px; background: #f7f4ec; overflow: hidden; }
.uc-img .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.uc-img .strip::-webkit-scrollbar { display: none; }
.uc-img img { flex: 0 0 100%; width: 100%; height: 210px; object-fit: contain; scroll-snap-align: center; cursor: zoom-in; }
.uc-img .sw { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.uc-img .sw button { font: inherit; font-size: 11px; font-weight: 700; border: 0; border-radius: 999px; padding: 3px 9px; background: rgba(255,255,255,.92); color: var(--green); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.uc-img .sw button.on { background: var(--green); color: #fff; }
.uc-price { border-radius: 14px; padding: 14px; background: linear-gradient(150deg, #133f35, #0f3a31); color: #fff; }
.uc-price .lbl { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--b-gold); font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.uc-price .lbl button { font: inherit; letter-spacing: 0; text-transform: none; font-size: 11.5px; color: var(--b-gold2); background: none; border: 1px solid rgba(239,220,182,.4); border-radius: 999px; padding: 1px 9px; cursor: pointer; }
.uc-price .big { font-size: 34px; font-weight: 300; color: var(--b-gold2); margin: 4px 0 0; line-height: 1.1; }
.uc-price .big small { font-size: 15px; margin-left: 4px; }
.uc-price .sub { font-size: 12.5px; color: #c6d6cf; margin-top: 2px; }
.uc-price .axis { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(239,220,182,.2); font-size: 12.5px; color: #dfe9e4; }
.uc-price .axis b { color: #fff; }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin: 10px 0 4px; position: relative; }
.hist span { flex: 1; background: rgba(239,220,182,.28); border-radius: 2px 2px 0 0; min-height: 2px; }
.hist span.me { background: var(--b-gold2); }
.hist-x { display: flex; justify-content: space-between; font-size: 10.5px; color: #a9bdb4; }
.uc-price .rank { font-size: 12.5px; color: #dfe9e4; margin-top: 6px; } .uc-price .rank b { color: var(--b-gold2); }
.uc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uc-facts > div { border: 1px solid #ece4d2; border-radius: 12px; padding: 9px 11px; }
.uc-facts .k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8a7547; font-weight: 700; }
.uc-facts .v { font-size: 17px; font-weight: 800; color: #1f2a24; margin-top: 2px; }
.uc-facts .s { font-size: 11.5px; color: var(--muted); }
.uc-facts .wide { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; }
.uc-facts .wide .v { font-size: 15px; }
.compass { width: 54px; height: 54px; flex: none; }
.compass circle { fill: #f7f4ec; stroke: #d8bf92; }
.compass text { font: 700 7px 'Be Vietnam Pro', Arial; fill: #8a7547; text-anchor: middle; dominant-baseline: middle; }
.compass .ar { fill: #a8741c; }
.uc-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uc-acts button, .uc-acts a { font: inherit; font-size: 13px; font-weight: 700; border-radius: 12px; padding: 10px 8px; border: 1px solid #e6dcc6; background: #fff; color: var(--green); cursor: pointer; text-decoration: none; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.uc-acts .main { grid-column: 1 / -1; background: var(--green); color: #fff; border-color: var(--green); font-size: 15px; padding: 13px; }
.uc-acts .gold { background: #f6ecd6; border-color: #e3cf9f; }
.uc-note { font-size: 11px; color: var(--muted); line-height: 1.45; }

/* ---------- danh sách ---------- */
.mb-lhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px 6px; flex-wrap: wrap; }
.mb-lhead b { font-size: 17px; color: var(--green); }
.tw { overflow-x: auto; padding: 0 6px 8px; }
.lt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.lt th { text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8a7547; font-weight: 700; padding: 8px 10px; border-bottom: 1px solid #ece4d2; cursor: pointer; white-space: nowrap; user-select: none; }
.lt th.r, .lt td.r { text-align: right; }
.lt th.sorted::after { content: ' ▲'; font-size: 8px; } .lt th.sorted.desc::after { content: ' ▼'; }
.lt th.nos { cursor: default; }
.lt td { padding: 8px 10px; border-bottom: 1px solid #f2ece0; white-space: nowrap; }
.lt tr[data-u] { cursor: pointer; }
.lt tr[data-u]:hover td { background: #faf6ec; }
.lt tr.on td { background: #fbf0d4; }
.lt td b { color: var(--green); }
.lt .tp { display: inline-flex; align-items: center; gap: 6px; } .lt .tp i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lt .pr { font-weight: 800; color: #1f2a24; }
.lt .dk { font-size: 10.5px; color: var(--muted); font-weight: 500; }
.lt .act { display: flex; gap: 4px; justify-content: flex-end; }
.lt .act button { font: inherit; font-size: 11.5px; font-weight: 700; border: 1px solid #e6dcc6; background: #fff; color: var(--green); border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.lt .mo { display: none; }
.lt .foot td { color: var(--muted); font-size: 12px; border: 0; white-space: normal; }

/* ---------- màn vừa ---------- */
@media (max-width: 1180px) {
  .mb-main { grid-template-columns: 62px minmax(0, 1fr) 340px; }
}
/* ---------- điện thoại / máy tính bảng ---------- */
@media (max-width: 900px) {
  .mb-wrap { padding: 0 14px; }
  .mb-head { padding: 14px 0 12px; }
  .mb-sum { gap: 16px; } .mb-sum div { font-size: 18px; }
  .mb-ftoggle { display: inline-flex; gap: 6px; margin-top: 12px; font: inherit; font-size: 13px; font-weight: 700; color: #10352c; background: var(--b-gold2); border: 0; border-radius: 999px; padding: 7px 14px; }
  .mb-filters { display: none; flex-direction: column; } .mb-filters .fr { max-width: none; width: calc(100% - 10px); }
  .mb-filters.open { display: flex; }
  .mb-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "floors" "stage" "side" "list"; padding: 10px 10px 30px; gap: 10px; }
  .mb-floors { position: sticky; top: calc(var(--nav-h) + var(--safe-t)); z-index: 6; flex-direction: row; overflow-x: auto; max-height: none; border-radius: 14px; padding: 7px; gap: 4px; }
  .mb-floors .cap { display: none; }
  .mb-floors button { min-width: 38px; padding: 6px 0; font-size: 13px; }
  .mb-floors button:disabled { min-width: 22px; }
  .mb-floors .gap { width: 4px; height: auto; }
  .mb-side { position: static; max-height: none; overflow: visible; }
  .viewer { height: 66vh; min-height: 420px; }
  .tools .tbtn { font-size: 12px; padding: 5px 10px; }
  .hint { font-size: 11px; white-space: normal; text-align: center; width: 80%; }
  .uc-h h2 { font-size: 32px; }
  .lt { min-width: 0; font-size: 13px; } .lt .hm { display: none; } .lt .mo { display: block; color: var(--muted); font-size: 11.5px; margin-left: 16px; } .lt td, .lt th { padding: 8px 6px; }
  .tg { min-width: 0; padding: 2px 6px 3px 9px; border-radius: 6px; } .tg::before { width: 4px; } .tg b { font-size: 11px; } .tg .d { display: none; } .tg .p { font-size: 10.5px; }
  .legend { bottom: 8px; left: 8px; gap: 3px; } .legend span { font-size: 10px; padding: 2px 6px; } .legend .sel { display: none; }
  .north { width: 36px; height: 36px; left: 8px; top: 8px; } .zoom { right: 8px; bottom: 40px; } .zoom button { width: 34px; height: 34px; }
  .tipbox.dock { bottom: 40px !important; }
}
