/* Trang chi tiết tin - phong cách sáng, sạch (chỉ dùng token var(--...)) */
.dt { --dt-line: var(--line); --dt-r: 16px; color: var(--text); padding-bottom: 28px; }
.dt h1, .dt h2, .dt h3 { font-family: var(--font); letter-spacing: -.02em; margin: 0; }
.dt a, .dt button, .dt-bar a, .dt-bar button, .dt-sheet-bg a, .dt-sheet-bg button, .dt-lightbox button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.dt-loading { padding: 60px 0; text-align: center; color: var(--muted); }
.dt-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; color: var(--muted); margin: 8px 0 14px; }
.dt-crumb a { color: inherit; text-decoration: none; }
.dt-crumb a:hover { color: var(--text); text-decoration: underline; }
.dt-crumb i { font-style: normal; opacity: .5; }

.dt-banner { padding: 12px 16px; border-radius: var(--dt-r); margin-bottom: 14px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.dt-banner.warn { background: var(--primary-soft); border-color: var(--primary-line); }
.dt-banner.err { background: var(--surface); border-color: var(--err); color: var(--err); }
.dt-banner-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dt-404 { text-align: center; padding: 60px 16px; }
.dt-404-ico { font-size: 56px; }
.dt-404 h1 { font-size: 24px; margin: 10px 0; }
.dt-404 p { color: var(--muted); }
.dt-404-act { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.dt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-gap: 40px; gap: 40px; align-items: start; }
.dt-main { display: flex; flex-direction: column; min-width: 0; }
.dt-main > * + * { margin-top: 28px; }
.dt-card { background: transparent; border: 0; border-top: 1px solid var(--dt-line); padding: 28px 0 0; }
.dt-card.dt-head { border-top: 0; padding-top: 0; }
.dt-card h2 { font-size: 21px; font-weight: 700; margin-bottom: 14px; }

/* Thư viện ảnh: lưới (desktop) + vuốt ngang (mobile) */
.dt-gallery { outline: none; }
.dt-grid { position: relative; display: grid; grid-gap: 8px; gap: 8px; height: 440px; border-radius: 20px; overflow: hidden; }
.dt-grid.g1 { grid-template-columns: 1fr; }
.dt-grid.g2 { grid-template-columns: 1fr 1fr; }
.dt-grid.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.dt-grid.g5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.dt-grid.g3 .dt-gi:first-child, .dt-grid.g5 .dt-gi:first-child { grid-row: 1 / 3; }
.dt-gi, .dt-sn { padding: 0; border: 0; margin: 0; background: var(--bg); cursor: zoom-in; display: block; overflow: hidden; position: relative; }
.dt-gi img, .dt-sn img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s, filter .2s; }
.dt-gi:hover img { filter: brightness(.93); }
.dt-gi:focus-visible, .dt-sn:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.dt-showall { position: absolute; right: 14px; bottom: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--text); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow); min-height: 40px; }
.dt-showall:hover { background: var(--bg); }
.dt-snapwrap { display: none; position: relative; }
.dt-snap { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 18px; background: var(--bg); }
.dt-snap::-webkit-scrollbar { display: none; }
.dt-sn { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; height: 280px; cursor: zoom-in; }
.dt-noimg { height: 280px; display: grid; place-items: center; color: var(--muted); background: var(--bg); border-radius: 20px; }
.dt-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .65); color: #fff; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; pointer-events: none; }

/* Tiêu đề + giá */
.dt-head h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; line-height: 1.28; margin-top: 10px; overflow-wrap: anywhere; }
.dt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-tag { background: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; }
.dt-priceline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-top: 16px; }
.dt-price { font-family: var(--font); font-size: 34px; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.dt-price small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.dt-old { color: var(--muted); font-size: 17px; }
.dt-sale { background: var(--primary-soft); color: var(--accent-ink); font-weight: 800; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; }
.dt-addr { margin: 10px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.dt-meta { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.dt-meta b { color: var(--text); }
.dt-stars { color: var(--accent-ink); letter-spacing: 1px; } .dt-stars .off { color: var(--line-strong); }

/* Thông số nhanh */
.dt-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-gap: 12px; gap: 12px; }
.dt-spec { background: var(--surface); border: 1px solid var(--dt-line); border-radius: var(--dt-r); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; min-width: 0; box-shadow: var(--shadow); }
.dt-spec span { grid-row: span 2; font-size: 24px; }
.dt-spec small { color: var(--muted); font-size: 12px; }
.dt-spec b { font-size: 15px; overflow-wrap: anywhere; }

.dt-desc { line-height: 1.75; font-size: 15.5px; overflow-wrap: anywhere; }
.dt-desc p { margin: 0 0 12px; }
.dt-desc p:last-child, .dt-desc ul:last-child { margin-bottom: 0; }
.dt-desc ul { margin: 0 0 12px; padding-left: 20px; }
.dt-desc li { margin: 3px 0; }
.dt-desc .dt-dh { margin: 18px 0 6px; font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.dt-desc .dt-dh + ul { margin-top: 0; }
.dt-desc.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.dt-more { background: none; border: 0; padding: 8px 0 2px; font: inherit; font-weight: 700; cursor: pointer; border-bottom: 2px solid var(--primary); margin-top: 8px; color: var(--text); min-height: 44px; }
.dt-attrs .ad-wrap > h2 { font-size: 21px; }

/* Tiện ích */
.dt-amen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-gap: 12px 20px; gap: 12px 20px; }
.dt-amen span { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.dt-amen i { font-style: normal; font-size: 22px; width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--bg); border-radius: 10px; }

/* Bản đồ */
.dt-maphead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.dt-maphead h2 { margin: 0; }
.dt-gm { font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; border-bottom: 2px solid var(--primary); white-space: nowrap; }
.dt-map { height: 320px; border-radius: var(--dt-r); margin-top: 14px; overflow: hidden; z-index: 0; }
.dt-nomap { color: var(--muted); font-size: 14px; }

.dt-review { padding: 14px 0; border-bottom: 1px solid var(--dt-line); }
.dt-review p { margin: 6px 0 0; overflow-wrap: anywhere; }
.dt-revform { margin-top: 14px; }
.dt-rate { display: flex; gap: 2px; margin: 6px 0; }
.dt-star { background: none; border: 0; font-size: 30px; color: var(--line-strong); cursor: pointer; padding: 0 3px; min-height: 44px; }
.dt-star.on { color: var(--accent-ink); }

/* Thẻ liên hệ (sticky) */
.dt-side { position: sticky; top: calc(var(--header-h, 60px) + 20px); }
.dt-contact { background: var(--surface); border: 1px solid var(--dt-line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; }
.dt-owner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dt-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.dt-owner b { display: block; overflow-wrap: anywhere; }
.dt-owner small { color: var(--muted); }
.dt-price-side { font-family: var(--font); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.dt-price-side small { font-size: 13px; font-weight: 500; color: var(--muted); }
.dt-row2 { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; }
.dt-zalo, .dt-call, .dt-book, .dt-btn, .dt-showphone { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; font: inherit; cursor: pointer; border-radius: 12px; min-height: 48px; box-sizing: border-box; }
.dt-zalo { border: 0; background: var(--primary); color: var(--primary-ink); font-weight: 800; font-size: 16px; padding: 12px; }
.dt-zalo:hover { background: var(--primary-d); }
.dt-call { border: 1.5px solid var(--text); background: var(--surface); color: var(--text); font-weight: 700; font-size: 16px; padding: 12px; }
.dt-call:hover { background: var(--bg); }
.dt-book { border: 0; background: var(--text); color: var(--surface); font-weight: 800; font-size: 16px; padding: 13px; width: 100%; }
.dt-book:hover { opacity: .88; }
.dt-book:disabled { opacity: .55; cursor: default; }
.dt-btn { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); font-weight: 600; font-size: 14.5px; padding: 10px 14px; min-height: 44px; }
.dt-btn:hover { background: var(--bg); }
.dt-showphone { background: transparent; border: 0; color: var(--muted); font-weight: 600; font-size: 14px; min-height: 40px; }
.dt-showphone:hover { color: var(--text); text-decoration: underline; }
.dt-msg { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--dt-line); padding-top: 14px; }
.dt-msg h3 { font-size: 15px; font-weight: 700; }
.dt-msg input, .dt-msg textarea, .dt-report select, .dt-report textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 16px; background: var(--surface); color: var(--text); }
.dt-msg textarea { resize: vertical; }
.dt-err { margin: 0; color: var(--err); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.dt-err[hidden] { display: none; }
.dt-acts { display: flex; justify-content: space-between; gap: 6px; border-top: 1px solid var(--dt-line); padding-top: 10px; }
.dt-acts button { background: none; border: 0; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 10px 4px; min-height: 44px; color: var(--muted); }
.dt-acts button:hover { color: var(--text); text-decoration: underline; }
.dt-report { display: flex; flex-direction: column; gap: 8px; }
.dt-report[hidden] { display: none; }
.dt-safe { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.dt-similar { margin-top: 44px; }
.dt-similar h2 { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.dt-simgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-gap: 16px; gap: 16px; }

/* Lightbox */
.dt-lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; background: rgba(10, 10, 10, .95); z-index: 1000; display: flex; align-items: center; justify-content: center; overscroll-behavior: contain; }
.dt-lightbox img { max-width: 100vw; max-height: 100vh; max-height: 88dvh; object-fit: contain; border-radius: 6px; }
.dt-lightbox .lb-close, .dt-lightbox .lb-nav { position: absolute; background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 26px; cursor: pointer; line-height: 1; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dt-lightbox .lb-close { top: 16px; top: max(16px, env(safe-area-inset-top)); right: 16px; font-size: 20px; }
.dt-lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.dt-lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.dt-lightbox .lb-count { position: absolute; bottom: 18px; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }

/* Hộp thoại dự phòng */
.dt-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1100; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 16px; overscroll-behavior: contain; }
.dt-modal-box { background: var(--surface); border-radius: 18px; padding: 22px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; box-sizing: border-box; }
.dt-modal-box h3 { font-size: 18px; margin: 0; }
.dt-modal-box p { margin: 0; color: var(--muted); }
.dt-modal-row { display: flex; gap: 8px; }
.dt-modal-row input { flex: 1; min-width: 0; font-size: 16px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; }
.dt-modal-box .dt-zalo { width: 100%; box-sizing: border-box; }

/* Đặt lịch xem phòng */
.dt-sheet-bg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; z-index: 1100; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; overscroll-behavior: contain; animation: dtFade .18s ease-out; }
.dt-sheet { position: relative; background: var(--surface); color: var(--text); width: 100%; max-width: 480px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 22px; box-shadow: var(--shadow-lg); box-sizing: border-box; padding: 24px; animation: dtPop .2s ease-out; }
.dt-sheet-grip { display: none; }
.dt-sheet-x { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 18px; cursor: pointer; z-index: 1; }
.dt-sheet h3 { font-size: 21px; font-weight: 700; padding-right: 44px; }
.dt-bk-sub { margin: 6px 0 16px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.dt-bk { display: flex; flex-direction: column; gap: 14px; }
.dt-fld { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.dt-fld > span, .dt-fld > legend { font-size: 13.5px; font-weight: 700; padding: 0; }
.dt-fld em { color: var(--err); font-style: normal; }
.dt-fld small { color: var(--muted); font-weight: 500; }
.dt-fld input:not([type=radio]), .dt-fld textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 16px; min-height: 48px; background: var(--surface); color: var(--text); -webkit-appearance: none; appearance: none; }
.dt-fld input[type=date] { min-height: 48px; display: block; text-align: left; }
.dt-fld input:focus, .dt-fld textarea:focus { outline: none; border-color: var(--text); box-shadow: var(--focus); }
.dt-fld textarea { resize: none; }
.dt-cnt { align-self: flex-end; font-size: 12px; }
.dt-slots { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 8px; gap: 8px; }
.dt-slots legend { grid-column: 1 / -1; margin-bottom: 2px; float: none; }
.dt-chip { position: relative; display: block; min-width: 0; }
.dt-chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.dt-chip span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; font-size: 15px; font-weight: 600; background: var(--surface); text-align: center; padding: 0 6px; }
.dt-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 800; }
.dt-chip input:focus-visible + span { box-shadow: var(--focus); }
.dt-ok { text-align: center; display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.dt-ok h3 { padding: 0; }
.dt-ok p { margin: 0; color: var(--muted); }
.dt-ok-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 32px; font-weight: 800; display: grid; place-items: center; margin: 4px auto 0; }
.dt-ok-when { color: var(--text) !important; font-weight: 700; line-height: 1.7; }
.dt-ok .dt-zalo { width: 100%; box-sizing: border-box; }
@keyframes dtFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dtPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dtUp { from { transform: translateY(100%); } to { transform: none; } }

.dt-bar { display: none; }
body.dt-has-bar .zalo-float { display: none; }

@media (max-width: 1000px) {
  .dt-layout { grid-template-columns: 1fr; grid-gap: 24px; gap: 24px; }
  .dt-side { position: static; }
  .dt-simgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dt-grid { display: none; }
  .dt-snapwrap { display: block; margin: 0 -16px; }
  .dt-snap { border-radius: 0; }
  .dt-sn { height: 0; padding-bottom: 75%; }
  .dt-sn img { position: absolute; top: 0; left: 0; }
  .dt-noimg { border-radius: 14px; }
  .dt-count { right: 14px; bottom: 14px; }
  .dt-main > * + * { margin-top: 22px; }
  .dt-card { padding-top: 22px; }
  .dt-price { font-size: 28px; }
  .dt-specs { grid-template-columns: 1fr 1fr; grid-gap: 10px; gap: 10px; }
  .dt-spec { padding: 12px; column-gap: 10px; }
  .dt-spec span { font-size: 22px; }
  .dt-amen { grid-template-columns: 1fr; }
  .dt-contact { box-shadow: var(--shadow); padding: 18px; }
  .dt-owner, .dt-price-side { }
  /* thanh liên hệ cố định dưới đáy */
  body.dt-has-bar { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .dt-bar { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--dt-line); padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); }
  .dt-bar-price { flex: none; font-weight: 800; font-size: 15px; line-height: 1.15; white-space: nowrap; }
  .dt-bar-price small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
  .dt-bar-btn { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; text-decoration: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; font: inherit; font-weight: 700; font-size: 14px; min-height: 46px; padding: 0 6px; cursor: pointer; color: var(--text); white-space: nowrap; }
  .dt-bar-btn.book { flex: 1.6 1 0; background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 800; }
  .dt-simgrid { grid-gap: 10px; gap: 10px; }
  .dt-lightbox .lb-nav { display: none; }

  /* bottom-sheet */
  .dt-sheet-bg { align-items: flex-end; padding: 0; }
  .dt-sheet { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 12px 18px 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: dtUp .25s ease-out; }
  .dt-sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; }
  .dt-sheet-x { top: 8px; }
}
@media (max-width: 380px) {
  .dt-bar-btn { font-size: 13px; }
  .dt-bar-price { font-size: 14px; }
  .dt-slots { gap: 6px; }
  .dt-chip span { font-size: 14px; }
  .dt-price { font-size: 26px; }
}
@supports not (aspect-ratio: 1) { .dt-sn { height: 0; padding-bottom: 75%; } }
