/* ════════════════════════════════════════════════════════════════
   NBRE · estate-detail.css — trang chi tiết toàn màn hình + contact social + back-to-top
   Tách từ styles.css. THỨ TỰ NỐI (cascade): base → layout → components
   → estate-detail → editorial → detail-modules → overlays → theme-light.
   theme-light.css PHẢI nạp cuối. Đừng đảo thứ tự <link>.
   ════════════════════════════════════════════════════════════════ */
/* ── ESTATE DETAIL — "trang riêng" cho từng tài sản ──────────── */
/* khóa nền iOS-proof: position:fixed giữ Safari iPhone không cuộn lớp dưới
   (top được JS gán = -scrollY để khôi phục đúng vị trí khi đóng) */
body.no-scroll {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}
/* trang đích toàn màn hình — theo được cả sáng/tối qua biến token */
.estate-page {
  position: fixed;
  inset: 0;
  z-index: 800;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ink);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 0.45s var(--ease),
    visibility 0.45s,
    transform 0.55s var(--ease);
}
.estate-page.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
/* nội dung trượt-lên nhẹ sau lớp nền → cảm giác "chuyển trang" sang trọng */
.estate-page .ep-hero,
.estate-page .ep-content {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.5s var(--ease) 0.08s,
    transform 0.6s var(--ease) 0.08s;
}
.estate-page .ep-content {
  transition-delay: 0.16s;
}
.estate-page.is-open .ep-hero,
.estate-page.is-open .ep-content {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .estate-page,
  .estate-page .ep-hero,
  .estate-page .ep-content {
    transition-duration: 0.001s;
    transform: none;
  }
}

/* thanh trên: về trang chủ · thương hiệu · sáng-tối · đóng */
.ep-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.2rem);
  background: color-mix(in srgb, var(--ink) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.ep-home {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.2rem;
  transition: color 0.25s var(--ease);
}
.ep-home:hover {
  color: var(--gold-bright);
}
.ep-home svg {
  width: 1.15rem;
  height: 1.15rem;
}
.ep-brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  text-decoration: none;
}
.ep-bar__tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.estate-page__close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--gold-soft);
  transition:
    border-color 0.25s var(--ease),
    color 0.25s,
    transform 0.25s var(--ease);
}
.estate-page__close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: rotate(90deg);
}
.estate-page__close svg {
  width: 16px;
  height: 16px;
}

/* hero ảnh lớn + caption (chữ luôn sáng trên ảnh, kể cả light mode) */
.ep-hero {
  position: relative;
  width: 100%;
  height: clamp(320px, 56vh, 620px);
  overflow: hidden;
}
.estate-page__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) brightness(0.9);
}
.ep-hero__grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 9, 14, 0.1) 0%,
    rgba(7, 9, 14, 0) 32%,
    rgba(7, 9, 14, 0.5) 72%,
    rgba(7, 9, 14, 0.93) 100%
  );
}
.ep-hero__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 clamp(1.2rem, 4vw, 2rem) clamp(1.6rem, 4vw, 3rem);
}
.ep-hero__inner {
  max-width: 1040px;
  margin: 0 auto;
}
.ep-hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.estate-page__tier {
  --c: #f1d9a0;
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--c);
  padding: 0.4em 0.8em;
  border-radius: 2px;
  background: rgba(7, 9, 14, 0.5);
  backdrop-filter: blur(6px);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.estate-page__tier::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
  margin-right: 0.55em;
  vertical-align: middle;
}
.estate-page__loc {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.estate-page__name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.05;
  margin: 0.5rem 0 0.35rem;
  color: #fbf7ee;
}
.estate-page__view {
  color: #d8d3c8;
  font-size: 1rem;
}
.estate-page__price {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--gold-bright);
  line-height: 1;
}
.estate-page__price i {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: #c9c3b6;
  margin-left: 0.3em;
  text-transform: uppercase;
}

/* nội dung trang theo cột đọc thoải mái */
.ep-content {
  padding: clamp(2rem, 5vh, 3.4rem) 0 clamp(3rem, 8vh, 6rem);
}
.ep-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: clamp(1.2rem, 4vw, 2rem);
}
.estate-page__score {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: center;
  margin: 1.6rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.eps__total {
  font-family: var(--serif);
  color: var(--gold-bright);
  line-height: 1;
}
.eps__total b {
  font-size: 3rem;
  font-weight: 500;
}
.eps__total i {
  font-style: normal;
  font-size: 1rem;
  color: var(--muted);
}
.eps__total span {
  display: block;
  font-family: var(--sans);
  font-size: 0.56rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-top: 0.55rem;
}
.eps__bars {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
.eps__row {
  display: grid;
  grid-template-columns: 6.4rem 1fr auto;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text);
}
.eps__track {
  height: 4px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
}
.eps__track b {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}
.eps__row em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted-2);
}
.estate-page__attrs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem 1rem;
}
.epa {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.epa span {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.epa b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--text);
}
.estate-page__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.9rem;
}
.estate-page__appt {
  border: 1px solid var(--line);
  color: var(--gold-bright);
}
.estate-page__appt:hover {
  border-color: var(--gold);
}

/* mức quan tâm (Zillow-style saves) — nằm trong hero, chữ sáng */
.estate-page__saves {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #d8d3c8;
  white-space: nowrap;
}
.estate-page__saves svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: var(--gold);
}
.estate-page__saves b {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--gold-bright);
}
.estate-page__saves i {
  font-style: normal;
}

/* tài sản tương tự (gợi ý thông minh) */
.estate-page__similar {
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.ep-sim {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
}
.ep-simcard {
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  padding: 0;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  color: var(--text);
  transition:
    border-color 0.3s,
    transform 0.3s var(--ease),
    box-shadow 0.3s;
}
.ep-simcard:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.7);
}
.ep-simcard__img {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.ep-simcard__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}
.ep-simcard:hover .ep-simcard__img img {
  transform: scale(1.05);
}
.ep-simcard__loc {
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.9rem 0.9rem 0;
}
.ep-simcard__name {
  font-family: var(--serif);
  font-size: 1.18rem;
  line-height: 1.15;
  margin: 0.3rem 0.9rem 0;
}
.ep-simcard__foot {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0.55rem 0.9rem 1rem;
}
.ep-simcard__foot b {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 1.02rem;
}

/* intel: đơn giá vs trung vị khu vực + điểm khu vực */
.estate-page__intel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: start;
  margin: 1.6rem 0;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.epi-market__lab {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.epi-market__val {
  display: block;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
  margin: 0.3rem 0 0.35rem;
  color: var(--gold-bright);
}
.epi-market--below .epi-market__val {
  color: #6fe0a8;
}
.epi-market--above .epi-market__val {
  color: #f0975a;
}
.epi-market__sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 34ch;
}
.epi-scores {
  min-width: 0;
}
.epi-scores__lab {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.95rem;
}
.epi-scores__list {
  display: grid;
  gap: 0.95rem;
}
.epi-score {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 0.7rem;
  align-items: baseline;
}
.epi-score b {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--gold-bright);
  font-weight: 500;
}
.epi-score span {
  font-size: 0.78rem;
  color: var(--text);
}
.epi-score__track {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
  overflow: hidden;
  margin-top: 0.5rem;
}
.epi-score__track u {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.eps-h {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 1rem;
}

/* "Khu vực quanh đây" — tiện ích + khoảng cách */
.estate-page__nearby {
  margin: 1.8rem 0;
}
.nearby {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.4rem;
}
.nearby li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.nearby__ic {
  flex: none;
  width: 1.45rem;
  height: 1.45rem;
  color: var(--gold);
  display: grid;
  place-items: center;
}
.nearby__ic svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nearby__cat {
  flex: none;
  width: 8.4rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.nearby__name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nearby__dist {
  flex: none;
  font-style: normal;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--gold-soft);
}

/* Ưu điểm / Lưu ý */
.estate-page__pc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  margin-top: 1.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.pc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.pc li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}
.pc li::before {
  position: absolute;
  left: 0;
  top: 0;
}
.pc--pro li::before {
  content: "✦";
  color: var(--gold);
}
.pc--con li::before {
  content: "•";
  color: var(--muted-2);
  font-size: 1.2em;
  line-height: 1;
}

@media (max-width: 620px) {
  .ep-hero {
    height: clamp(280px, 42vh, 420px);
  }
  .estate-page__attrs {
    grid-template-columns: repeat(2, 1fr);
  }
  .eps__row {
    grid-template-columns: 5.4rem 1fr auto;
  }
  .estate-page__score {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .estate-page__intel {
    grid-template-columns: 1fr;
  }
  .nearby,
  .estate-page__pc,
  .ep-sim {
    grid-template-columns: 1fr;
  }
  .ep-home__t {
    display: none;
  }
  .ep-brand {
    display: none;
  } /* nhường chỗ cho VI/EN + sáng-tối trên màn nhỏ */
}

/* mức quan tâm trên thẻ danh mục */
.ecard__saves {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.ecard__saves svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: var(--gold);
  flex: none;
}
.ecard__saves b {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: 0;
}

/* node bản đồ đã lưu → ghim ♥ vàng nổi bật */
.nbnode.is-fav {
  z-index: 40;
}
.nbnode.is-fav .nbnode__core {
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 70%);
  box-shadow:
    0 0 12px 3px var(--gold),
    0 0 30px 9px rgba(200, 169, 114, 0.6);
}
.nbnode.is-fav .nbnode__ring {
  border-color: var(--gold-bright);
  opacity: 1;
}
.nbnode.is-fav::after {
  content: "♥";
  position: absolute;
  left: 50%;
  bottom: 135%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--gold-bright);
  text-shadow: 0 0 6px rgba(200, 169, 114, 0.85);
  pointer-events: none;
}

/* ── contact social row (ghost circles) ──────────────────── */
.contact__social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.4rem;
}
.social-btn {
  position: relative;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  transition:
    color 0.3s,
    border-color 0.3s,
    transform 0.25s var(--ease),
    background 0.3s;
}
.social-btn svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: currentColor;
}
.social-btn--text {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.social-btn:hover {
  color: var(--gold-bright);
  border-color: var(--gold);
  transform: translateY(-3px);
  background: rgba(200, 169, 114, 0.08);
}
.social-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(11, 14, 21, 0.92);
  color: #ece8df;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  padding: 0.32em 0.6em;
  border-radius: 3px;
  border: 1px solid rgba(200, 169, 114, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.social-btn:hover::after {
  opacity: 1;
}

/* ── back to top ─────────────────────────────────────────── */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: calc(clamp(1rem, 3vw, 2rem) + 4rem);
  z-index: 500;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  background: rgba(11, 14, 21, 0.82);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(200, 169, 114, 0.34);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.35s,
    visibility 0.35s,
    transform 0.35s var(--ease),
    border-color 0.3s;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}
.to-top svg {
  width: 1.3rem;
  height: 1.3rem;
}
@media (max-width: 560px) {
  .social-btn {
    width: 2.55rem;
    height: 2.55rem;
  }
  .social-btn svg {
    width: 1.2rem;
    height: 1.2rem;
  }
}
