/* VietReal — giao diện theo khuôn batdongsan (đỏ #e03c31, nền #fafafa, font Roboto) */
* { box-sizing: border-box; }
body { margin: 0; background: #fafafa; font-family: Roboto, Arial, Helvetica, sans-serif; color: #2c2c2c; font-size: 14px; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 12px 40px; }
h1 { font-size: 24px; font-weight: 500; margin: 6px 0 4px; line-height: 1.35; }
h2 { font-size: 19px; font-weight: 500; }

/* header */
header.topbar { background: #fff; border-bottom: 1px solid #ebebeb; position: sticky; top: 0; z-index: 40; }
.hd { max-width: 1140px; margin: 0 auto; padding: 0 12px; display: flex; align-items: center; gap: 26px; height: 64px; }
.logo { font-size: 23px; font-weight: 700; color: #2c2c2c; white-space: nowrap; }
.logo span { color: #e03c31; }
nav.mainnav { display: flex; gap: 20px; font-size: 14.5px; }
nav.mainnav a:hover { color: #e03c31; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.top-actions .ic { font-size: 18px; color: #505050; }
.btn-red { background: #e03c31; color: #fff !important; border: none; border-radius: 4px; padding: 9px 16px; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-block; }
.btn-red:hover { opacity: .92; }

/* search block */
.search { background: #fff; border-bottom: 1px solid #ebebeb; padding: 14px 0; }
.search .wrap { padding-bottom: 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab { padding: 7px 18px; border: 1px solid #e0e0e0; border-radius: 4px; background: #fff; font-weight: 500; }
.tab.on { background: #e03c31; border-color: #e03c31; color: #fff; }
.srow { display: flex; gap: 10px; flex-wrap: wrap; }
.sel { flex: 1; min-width: 150px; border: 1px solid #e0e0e0; border-radius: 4px; padding: 9px 12px; color: #505050; background: #fff; font: inherit; }
.sel b { color: #2c2c2c; font-weight: 500; }
select.sel { appearance: auto; color: #2c2c2c; }

/* breadcrumb / headings */
.crumb, .crumbs { padding: 14px 0 4px; color: #757575; font-size: 13px; }
.crumb b, .crumbs b { color: #2c2c2c; font-weight: 400; }
.crumb a:hover, .crumbs a:hover { color: #e03c31; }
.sub, .count-line { color: #757575; margin-bottom: 14px; font-size: 14px; }

/* ward chips + toolbar */
.ward-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.wtab { border: 1px solid #e0e0e0; background: #fff; border-radius: 20px; padding: 7px 15px; color: #2c2c2c; font-size: 13.5px; }
.wtab:hover { border-color: #e03c31; color: #e03c31; }
.wtab.active { background: #e03c31; border-color: #e03c31; color: #fff; font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { border: 1px solid #e0e0e0; background: #fff; border-radius: 4px; padding: 8px 12px; color: #2c2c2c; }
.toolbar .sort { margin-left: auto; color: #505050; }
.toolbar .sort b { color: #2c2c2c; font-weight: 500; }

/* listing cards (batdongsan style) */
.list { display: flex; flex-direction: column; }
.card { display: flex; gap: 16px; background: #fff; border: 1px solid #ebebeb; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.card-img { position: relative; flex: 0 0 276px; display: block; border-radius: 4px; overflow: hidden; background: #eee; height: 186px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img .cnt { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 3px; }
.card-img .heart { position: absolute; right: 8px; top: 6px; font-size: 21px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.noimg { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px; color: #888; background: #e8e8e8; }
.noimg.big { aspect-ratio: 4/3; max-width: 600px; margin: 0 auto; width: 100%; border-radius: 8px; }
.img-dead { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px; background: #e8e8e8; color: #888; font-size: 14px; }
.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ttl { font-size: 16px; font-weight: 500; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ttl a:hover { color: #e03c31; }
.ttl.vip { color: #e03c31; font-weight: 700; }
.ttl.vip a:hover { text-decoration: underline; }
.vipb { background: #e03c31; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 3px; padding: 2px 5px; margin-right: 7px; vertical-align: 2px; }
.pr { margin-top: 8px; font-size: 15px; color: #2c2c2c; }
.pr strong { font-size: 16.5px; color: #e03c31; }
.ad { margin-top: 6px; color: #505050; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds { margin: 6px 0 0; color: #757575; font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp { margin-top: 8px; color: #505050; font-size: 13px; }
.ft { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 7px; color: #757575; font-size: 13px; }
.av { background: #f2f2f2; border: 1px solid #e0e0e0; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.pn { color: #2c2c2c; font-weight: 500; }
.ph2 { margin-left: auto; color: #0a7d33; font-weight: 600; border: 1px solid #0a7d33; border-radius: 4px; padding: 4px 10px; white-space: nowrap; }

/* pagination */
.paging { display: flex; gap: 6px; justify-content: center; margin: 26px 0 10px; flex-wrap: wrap; }
.paging a, .paging span { border: 1px solid #e0e0e0; background: #fff; border-radius: 4px; padding: 8px 13px; color: #2c2c2c; }
.paging a:hover { border-color: #e03c31; color: #e03c31; }
.paging .cur { background: #e03c31; border-color: #e03c31; color: #fff; font-weight: 700; }
.paging .off { color: #bbb; }

/* projects strip */
.pj { background: #fff; border: 1px solid #ebebeb; border-radius: 8px; padding: 18px; margin: 6px 0 10px; }
.pj h2 { margin: 0 0 12px; font-size: 18px; }
.pj .chip { display: inline-block; border: 1px solid #e0e0e0; border-radius: 20px; padding: 7px 14px; margin: 0 8px 8px 0; background: #fafafa; }

/* footer */
footer.footer { background: #f2f2f2; border-top: 1px solid #e0e0e0; margin-top: 26px; color: #505050; }
.fcols { max-width: 1140px; margin: 0 auto; padding: 28px 12px 6px; display: flex; gap: 30px; flex-wrap: wrap; }
.fcol { flex: 1; min-width: 180px; }
.fcol h4 { font-size: 14px; margin: 0 0 10px; color: #2c2c2c; }
.fcol a { display: block; margin-bottom: 7px; font-size: 13.5px; }
.fcol a:hover { color: #e03c31; }
.fbot { max-width: 1140px; margin: 0 auto; border-top: 1px solid #e0e0e0; padding: 14px 12px; color: #757575; font-size: 13px; }
.float-btns { position: fixed; right: 14px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.float-btns a { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.fb-call { background: #e03c31; font-size: 22px; }
.fb-zalo { background: #0068ff; font-size: 14px; }

/* detail page */
.detail h1 { font-size: 22px; font-weight: 500; }
.stat-row { display: flex; gap: 0; border-top: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb; margin: 12px 0 6px; background: #fff; }
.stat { padding: 12px 22px 12px 0; margin-right: 22px; }
.stat .lb { color: #757575; font-size: 13px; }
.stat .vl { font-size: 17px; font-weight: 700; margin-top: 3px; }
.stat .vl.red { color: #e03c31; }
.stat-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #505050; font-size: 18px; }
.detail .addr { color: #505050; font-size: 14px; margin: 8px 0 14px; }
.detail-grid { display: flex; gap: 24px; align-items: flex-start; }
.detail-main { flex: 1; min-width: 0; }
.detail-side { flex: 0 0 300px; position: sticky; top: 84px; }
.gallery { max-width: none; margin: 0; }
.g-main { position: relative; aspect-ratio: 4/3; background: #ddd; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.g-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 13px; }
.g-hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.g-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.g-thumbs img { width: 74px; height: 56px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: .65; }
.g-thumbs img.on { opacity: 1; outline: 2px solid #e03c31; }
.g-thumbs .thumb-dead { flex: 0 0 auto; width: 74px; height: 56px; display: flex; align-items: center; justify-content: center; background: #e8e8e8; color: #888; border-radius: 4px; font-size: 10px; text-align: center; padding: 2px; }
section.blk { background: #fff; border: 1px solid #ebebeb; border-radius: 8px; padding: 18px; margin-top: 16px; }
section.blk h2 { margin: 0 0 10px; font-size: 18px; }
.desc p { line-height: 1.6; margin: 6px 0; font-size: 14.5px; }
.specs table { width: 100%; border-collapse: collapse; }
.specs td { border-bottom: 1px solid #f0f0f0; padding: 9px 6px; font-size: 14.5px; }
.specs td:first-child { color: #757575; width: 38%; }
.contact-card { background: #fff; border: 1px solid #ebebeb; border-radius: 8px; padding: 18px; }
.cc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.cc-av { background: #f2f2f2; border: 1px solid #e0e0e0; border-radius: 50%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.cc-name { font-size: 16.5px; font-weight: 700; }
.cc-sub { color: #757575; font-size: 13px; margin-top: 2px; }
.btn-call { display: block; text-align: center; background: #e03c31; color: #fff !important; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 16px; border: 0; cursor: pointer; width: 100%; }
.btn-call:hover { opacity: .92; }
.btn-zalo { display: block; text-align: center; background: #0068ff; color: #fff !important; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 15px; margin-top: 9px; }
.cc-note { color: #757575; font-size: 12.5px; line-height: 1.5; margin-top: 12px; }
.related { margin-top: 22px; }
.related h2 { font-size: 19px; }
.red { color: #e03c31; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 100; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; }
.lb-close, .lb-prev, .lb-next { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 30px; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; }

/* admin (trang quản trị dùng chung styles.css) */
.admin input, .admin select, .admin textarea { padding: 9px; margin: 4px 0; border: 1px solid #bbb; border-radius: 5px; font-size: 15px; }
.admin .row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin .note { color: #777; font-size: 13px; }
.own-item { background: #fff; border-radius: 6px; padding: 10px 12px; margin: 8px 0; }

@media (max-width: 860px) {
  nav.mainnav { display: none; }
  .detail-grid { flex-direction: column; }
  .detail-side { flex: none; width: 100%; position: static; }
}
@media (max-width: 640px) {
  h1 { font-size: 20px; }
  .detail h1 { font-size: 19px; }
  .card { flex-direction: column; padding: 12px; }
  .card-img { flex: none; width: 100%; height: auto; aspect-ratio: 4/3; }
  .hd { gap: 14px; }
  .logo { font-size: 20px; }
  .top-actions .ic, .top-actions .login-link { display: none; }
  .stat { padding-right: 12px; margin-right: 12px; }
  .stat .vl { font-size: 15.5px; }
}
