.detail-page {
  background: #f4f8f6;
}

/* UX Loop Demo v2 detail final cascade */
.detail-page {
  background:
    radial-gradient(circle at 12% 0%, rgba(200,168,91,.08), transparent 30rem),
    #f5f7f4;
  color: #122f36;
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
}

.detail-topbar {
  min-height: 66px;
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid #e4ebe6;
  box-shadow: 0 8px 24px rgba(18,47,54,.055);
}

.detail-topbar .nav a {
  color: #53676b;
  font-size: 14px;
  font-weight: 600;
}

.detail-shell {
  width: min(1180px, calc(100% - 32px));
  padding: 18px 0 72px;
}

.breadcrumb {
  color: #66797d;
  font-size: 13px;
  font-weight: 500;
}

.breadcrumb a {
  color: #122f36;
  font-weight: 700;
}

.detail-hero {
  overflow: hidden;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 0;
  padding: 0;
  border: 1px solid #e4ebe6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(18,47,54,.09);
}

.detail-gallery {
  min-height: 100%;
}

.detail-main-image {
  min-height: 610px;
  border-radius: 0;
  background: #143941;
}

.detail-main-image img {
  object-fit: cover;
}

.detail-main-image.image-failed {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(18,47,54,.12), rgba(200,168,91,.20)),
    #143941;
}

.detail-main-image.image-failed::before {
  content: "3T Apartment";
  z-index: 1;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #122f36;
  font-size: 14px;
  font-weight: 750;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  background: #fff;
}

.detail-thumb {
  width: 100%;
  height: 70px;
  border-radius: 12px;
  border-color: transparent;
}

.detail-thumb.active {
  border-color: #c8a85b;
}

.detail-summary {
  position: static;
  align-content: center;
  gap: 16px;
  padding: 28px;
  background: #fff;
}

.detail-status-row {
  align-items: center;
}

.detail-code {
  color: #66797d;
  font-size: 12px;
  font-weight: 650;
}

.detail-kicker {
  color: #b48b34;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.detail-summary h1 {
  color: #123c7a;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -.028em;
}

.detail-location {
  color: #66797d;
  font-size: 15px;
  font-weight: 450;
}

.detail-price-card {
  align-items: end;
  border-color: #ead9a8;
  border-radius: 16px;
  background: #fff9eb;
}

.detail-price {
  color: #111827;
  font-size: 34px;
  font-weight: 850;
}

.detail-usd {
  color: #8b989b;
  font-size: 13px;
  font-weight: 400;
}

.detail-price-card > span {
  color: #8b6d28;
  font-size: 11px;
  font-weight: 800;
}

.detail-mini-facts {
  overflow: hidden;
  gap: 0;
  border: 1px solid #e4ebe6;
  border-radius: 16px;
}

.detail-mini-fact {
  border: 0;
  border-right: 1px solid #e4ebe6;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.detail-mini-fact:last-child {
  border-right: 0;
}

.detail-mini-fact strong {
  color: #122f36;
  font-size: 17px;
  font-weight: 820;
}

.detail-mini-fact span {
  color: #66797d;
  font-size: 12px;
  font-weight: 450;
}

.detail-assurance div {
  border-color: #e4ebe6;
  border-radius: 14px;
  background: #fbfcfb;
}

.detail-assurance strong {
  font-weight: 760;
}

.detail-assurance span,
.detail-note {
  color: #66797d;
  font-weight: 400;
}

.detail-actions .btn {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 750;
}

.detail-body {
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.detail-section,
.detail-side-card,
.detail-empty {
  border-color: #e4ebe6;
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(18,47,54,.065);
}

.detail-section,
.detail-side-card {
  padding: 22px;
}

.detail-section h2,
.detail-side-card h2 {
  color: #123c7a;
  font-size: 21px;
  font-weight: 820;
  letter-spacing: -.018em;
}

.detail-section h2::after,
.detail-side-card h2::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 8px;
  border-radius: 999px;
  background: #c8a85b;
}

.detail-section .sub,
.detail-side-card .sub {
  color: #66797d;
  font-size: 14px;
  font-weight: 400;
}

.detail-seo-overview {
  margin: 0 0 16px;
  color: #263f45;
  font-size: 15.5px;
  font-weight: 520;
  line-height: 1.72;
}

.detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  border-color: #edf1ee;
  border-radius: 14px;
  background: #fbfcfb;
}

.detail-item strong {
  color: #66797d;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
}

.detail-item span {
  color: #122f36;
  font-weight: 780;
}

.cost-box {
  border-color: #ead9a8;
  border-radius: 14px;
  background: #fff9eb;
  color: #34464b;
}

.related-card {
  border-color: #e4ebe6;
  border-radius: 14px;
  background: #fff;
}

.related-card.image-failed::before {
  content: "";
  width: 128px;
  height: 92px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(18,47,54,.10), rgba(200,168,91,.18)), #e2ebe5;
}

.related-card strong {
  color: #123c7a;
  font-weight: 760;
}

.detail-checklist li {
  color: #34464b;
  font-weight: 450;
}

@media (max-width: 1020px) {
  .detail-hero,
  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-main-image {
    min-height: 460px;
  }

  .detail-summary,
  .detail-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .detail-shell {
    width: min(100% - 20px, 720px);
    padding-top: 12px;
  }

  .detail-topbar {
    min-height: 58px;
    padding: 0 12px;
  }

  .detail-hero {
    border-radius: 16px;
  }

  .detail-main-image {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .detail-thumbs {
    grid-template-columns: repeat(4, 1fr);
  }

  .detail-thumb {
    height: 54px;
  }

  .detail-summary {
    padding: 18px;
  }

  .detail-summary h1 {
    font-size: 25px;
  }

  .detail-price {
    font-size: 28px;
  }

  .detail-actions,
  .detail-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .detail-lead-success {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  .detail-lead-success-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-lead-success-actions .btn {
    width: 100%;
  }

  .detail-lead-success .btn {
    width: 100%;
  }

  .detail-mini-facts {
    grid-template-columns: 1fr;
  }

  .detail-mini-fact {
    border-right: 0;
    border-bottom: 1px solid #e4ebe6;
  }

  .detail-mini-fact:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 460px) {
  .related-card,
  .related-card.image-failed {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .related-card.image-failed::before {
    width: 96px;
    height: 74px;
  }
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  background: rgba(244, 248, 246, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201, 214, 207, .72);
}

.detail-topbar .brand {
  color: var(--ink);
  text-decoration: none;
}

.detail-topbar .nav {
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.detail-topbar .nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.detail-topbar .nav a:hover {
  background: rgba(221, 200, 148, .2);
}

.detail-lead-success {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 118;
  width: min(680px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(48, 139, 91, .28);
  border-radius: 16px;
  background: rgba(247, 255, 250, .98);
  color: var(--primary);
  box-shadow: 0 18px 48px rgba(18, 52, 59, .18);
  padding: 13px 14px 13px 16px;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.detail-lead-success.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.detail-lead-success strong {
  display: block;
  margin-bottom: 2px;
  color: var(--success);
  font-size: 15px;
  font-weight: 900;
}

.detail-lead-success span {
  display: block;
  color: #51696d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.detail-lead-success-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-lead-success-actions .btn {
  min-height: 42px;
  white-space: nowrap;
}

.detail-lead-success-close {
  position: absolute;
  top: -10px;
  right: -8px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(48, 139, 91, .24);
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(18, 52, 59, .14);
}

.detail-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
  gap: 22px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-gallery {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.detail-main-image,
.photo-modal-panel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #102f36;
}

.detail-main-image {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 500px;
  touch-action: pan-y;
}

.detail-main-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #102f36;
}

.detail-image-count {
  position: absolute;
  left: 14px;
  bottom: 14px;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(10, 33, 38, .78);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.detail-photo-cta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, .95);
  color: var(--primary);
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.detail-main-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(16, 47, 54, 0), rgba(16, 47, 54, .34));
  pointer-events: none;
}

.detail-image-count,
.detail-photo-cta,
.detail-nav {
  z-index: 2;
}

.detail-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--primary);
  font-size: 30px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.detail-nav.prev { left: 12px; }
.detail-nav.next { right: 12px; }

.detail-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 2px 2px;
  scrollbar-width: thin;
}

.detail-thumb {
  flex: 0 0 92px;
  height: 68px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  background-color: #dfe8e2;
}

.detail-thumb.active {
  border-color: var(--accent);
}

.detail-summary {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 4px 4px 4px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  position: sticky;
  top: 88px;
}

.detail-heading {
  display: grid;
  gap: 9px;
}

.detail-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.detail-status-row,
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.detail-code {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.detail-summary h1 {
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.13;
  letter-spacing: 0;
}

.detail-price-card {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  padding: 15px;
  border: 1px solid #d8c48f;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8e6, #fffdf8);
}

.detail-price-card > span {
  flex: 0 0 auto;
  color: #836727;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: right;
}

.detail-price {
  font-size: 32px;
}

.lead-fast-field {
  padding: 14px;
  border: 1px solid rgba(18, 52, 59, .12);
  border-radius: 14px;
  background: #f8faf9;
}

.lead-fast-field label {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.lead-fast-field input {
  min-height: 52px;
  font-size: 17px;
  font-weight: 850;
}

.lead-extra {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.lead-extra summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

.lead-extra summary::-webkit-details-marker {
  display: none;
}

.lead-extra summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  line-height: 1;
}

.lead-extra[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.lead-extra[open] summary::after {
  content: "−";
}

.lead-extra > .field {
  padding: 12px;
}

.detail-usd {
  color: var(--muted);
  font-weight: 900;
}

.detail-location {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.4;
}

.detail-mini-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-mini-fact {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
}

.detail-mini-fact strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.detail-mini-fact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.detail-assurance {
  display: grid;
  gap: 8px;
}

.detail-assurance div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.detail-assurance strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.detail-assurance span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.detail-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 22px;
}

.photo-modal.open {
  display: grid;
  place-items: center;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 26, 30, .82);
}

.photo-modal-panel {
  width: min(1100px, 100%);
  height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  z-index: 1;
  touch-action: pan-y;
}

.photo-modal-panel img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #102f36;
}

.photo-modal-close,
.photo-modal-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.photo-modal-close {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  font-size: 28px;
  line-height: 1;
}

.photo-modal-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 30px;
}

.photo-modal-nav.prev { left: 14px; }
.photo-modal-nav.next { right: 14px; }

.photo-modal-footer {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
}

.photo-modal-footer span {
  color: var(--ink);
  font-weight: 950;
}

.photo-modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.photo-modal-thumb {
  flex: 0 0 82px;
  height: 62px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.photo-modal-thumb.active {
  border-color: var(--accent);
}

@media (max-width: 1180px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  }

  .detail-main-image {
    min-height: 500px;
  }

  .detail-summary h1 {
    font-size: 28px;
  }

  .detail-price-card {
    align-items: start;
    flex-direction: column;
  }

  .detail-price-card > span {
    text-align: left;
  }
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 18px;
}

.detail-section,
.detail-side-card,
.detail-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-section,
.detail-side-card {
  padding: 18px;
}

.detail-section h2,
.detail-side-card h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.detail-section .sub,
.detail-side-card .sub {
  margin: 0 0 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.detail-item strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-item span {
  display: block;
  margin-top: 4px;
  font-weight: 900;
  color: var(--ink);
}

.cost-box {
  border-radius: 8px;
  padding: 14px;
  background: #fff7e7;
  border: 1px solid #f0d9a6;
  line-height: 1.55;
}

.detail-tags {
  min-height: 42px;
}

.detail-side {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 88px;
}

.detail-checklist {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-checklist li {
  display: flex;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.detail-checklist li::before {
  content: "✓";
  color: var(--accent-strong);
  font-weight: 950;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: inherit;
  text-decoration: none;
}

.related-card img {
  width: 128px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  background: #dfe8e2;
}

.related-card strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.related-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.detail-empty {
  margin-top: 24px;
  padding: 26px;
  text-align: center;
}

@media (max-width: 1020px) {
  .detail-hero,
  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-summary,
  .detail-side {
    position: static;
  }

  .detail-summary {
    padding: 4px 2px 0;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .detail-shell {
    width: min(100% - 20px, 720px);
    padding-top: 12px;
  }

  .detail-topbar .nav {
    display: none;
  }

  .detail-gallery {
    min-height: 0;
  }

  .detail-main-image {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .detail-main-image img {
    object-fit: contain;
  }

  .detail-thumb {
    flex-basis: 84px;
    height: 64px;
  }

  .detail-summary h1 {
    font-size: 23px;
  }

  .detail-price {
    font-size: 26px;
  }

  .related-grid,
  .detail-actions,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-mini-facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-section,
  .detail-side-card,
  .detail-hero {
    padding: 14px;
  }

  .photo-modal {
    padding: 10px;
  }

  .photo-modal-panel {
    height: min(680px, calc(100vh - 20px));
  }
}

@media (max-width: 460px) {
  .detail-mini-facts {
    grid-template-columns: 1fr 1fr;
  }

  .related-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .related-card img {
    width: 104px;
    height: 78px;
  }
}

/* UX Loop Demo v2 detail final end-cascade */
.detail-page { background: radial-gradient(circle at 12% 0%, rgba(200,168,91,.08), transparent 30rem), #f5f7f4; color: #122f36; font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif; }
.detail-topbar { min-height: 66px; background: rgba(255,255,255,.95); border-bottom: 1px solid #e4ebe6; box-shadow: 0 8px 24px rgba(18,47,54,.055); }
.detail-shell { width: min(1180px, calc(100% - 32px)); padding: 18px 0 72px; }
.breadcrumb { color: #66797d; font-size: 13px; font-weight: 500; }
.detail-hero { overflow: hidden; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 0; padding: 0; border: 1px solid #e4ebe6; border-radius: 18px; background: #fff; box-shadow: 0 18px 48px rgba(18,47,54,.09); }
.detail-main-image { min-height: 610px; border-radius: 0; background: #143941; }
.detail-main-image img { object-fit: cover; }
.detail-main-image.image-failed { display: grid; place-items: center; background: linear-gradient(135deg, rgba(18,47,54,.12), rgba(200,168,91,.20)), #143941; }
.detail-main-image.image-failed::before { content: "3T Apartment"; z-index: 1; padding: 10px 15px; border-radius: 999px; background: rgba(255,255,255,.88); color: #122f36; font-size: 14px; font-weight: 750; }
.detail-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px; background: #fff; }
.detail-thumb { width: 100%; height: 70px; border-radius: 12px; border-color: transparent; }
.detail-thumb.active { border-color: #c8a85b; }
.detail-summary { position: static; align-content: center; gap: 16px; padding: 28px; background: #fff; }
.detail-code { color: #66797d; font-size: 12px; font-weight: 650; }
.detail-kicker { color: #b48b34; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.detail-summary h1 { color: #123c7a; font-size: clamp(28px, 3vw, 40px); font-weight: 820; line-height: 1.08; letter-spacing: -.028em; }
.detail-location { color: #66797d; font-size: 15px; font-weight: 450; }
.detail-price-card { align-items: end; border-color: #ead9a8; border-radius: 16px; background: #fff9eb; }
.detail-price { color: #111827; font-size: 34px; font-weight: 850; }
.detail-usd { color: #8b989b; font-size: 13px; font-weight: 400; }
.detail-mini-facts { overflow: hidden; gap: 0; border: 1px solid #e4ebe6; border-radius: 16px; }
.detail-mini-fact { border: 0; border-right: 1px solid #e4ebe6; border-radius: 0; background: #fff; text-align: center; }
.detail-mini-fact:last-child { border-right: 0; }
.detail-actions .btn { min-height: 46px; border-radius: 12px; font-weight: 750; }
.detail-photo-cta { min-height: 44px; }
.detail-body { grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
.detail-section, .detail-side-card, .detail-empty { border-color: #e4ebe6; border-radius: 18px; box-shadow: 0 8px 22px rgba(18,47,54,.065); }
.detail-section, .detail-side-card { padding: 22px; }
.detail-section h2, .detail-side-card h2 { color: #123c7a; font-size: 21px; font-weight: 820; letter-spacing: -.018em; }
.detail-section h2::after, .detail-side-card h2::after { content: ""; display: block; width: 46px; height: 3px; margin-top: 8px; border-radius: 999px; background: #c8a85b; }
.detail-seo-overview { margin: 0 0 16px; color: #263f45; font-size: 15.5px; font-weight: 520; line-height: 1.72; }
.detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.detail-item { border-color: #edf1ee; border-radius: 14px; background: #fbfcfb; }
.detail-item span { color: #122f36; font-weight: 780; }
.cost-box { border-color: #ead9a8; border-radius: 14px; background: #fff9eb; color: #34464b; }
.related-card { border-color: #e4ebe6; border-radius: 14px; background: #fff; }
.related-card.image-failed::before { content: ""; width: 128px; height: 92px; border-radius: 12px; background: linear-gradient(135deg, rgba(18,47,54,.10), rgba(200,168,91,.18)), #e2ebe5; }
.related-card strong { color: #123c7a; font-weight: 760; }

@media (max-width: 1020px) {
  .detail-hero, .detail-body { grid-template-columns: 1fr; }
  .detail-main-image { min-height: 460px; }
  .detail-summary, .detail-side { position: static; }
}

@media (max-width: 760px) {
  .detail-shell { width: min(100% - 20px, 720px); padding-top: 12px; }
  .detail-topbar { min-height: 58px; padding: 0 12px; }
  .detail-hero { border-radius: 16px; }
  .detail-main-image { min-height: 0; aspect-ratio: 4 / 3; }
  .detail-thumbs { grid-template-columns: repeat(4, 1fr); }
  .detail-thumb { height: 54px; }
  .detail-summary { padding: 18px; }
  .detail-summary h1 { font-size: 25px; }
  .detail-price-card { align-items: center; text-align: center; }
  .detail-price { font-size: 28px; }
  .detail-actions, .detail-grid, .related-grid { grid-template-columns: 1fr; }
  .detail-mini-facts { grid-template-columns: 1fr; }
  .detail-mini-fact { border-right: 0; border-bottom: 1px solid #e4ebe6; }
  .detail-mini-fact:last-child { border-bottom: 0; }
}

@media (max-width: 460px) {
  .related-card, .related-card.image-failed { grid-template-columns: 96px minmax(0, 1fr); }
  .related-card.image-failed::before { width: 96px; height: 74px; }
}

/* Detail gallery hotfix: thumbnails stay on one horizontal scroll row. */
.detail-thumbs {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  background: #fff;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.detail-thumb {
  flex: 0 0 112px !important;
  width: 112px !important;
  height: 72px !important;
  border-radius: 12px;
  scroll-snap-align: start;
}

@media (max-width: 760px) {
  .detail-thumb {
    flex-basis: 86px !important;
    width: 86px !important;
    height: 58px !important;
  }
}

/* Mobile photo modal fit hotfix: keep the close button inside the phone viewport. */
@media (max-width: 760px) {
  .photo-modal {
    padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }

  .photo-modal.open {
    align-items: stretch;
    justify-items: stretch;
  }

  .photo-modal-panel {
    width: 100%;
    height: calc(100dvh - max(16px, env(safe-area-inset-top, 0px)) - max(16px, env(safe-area-inset-bottom, 0px)));
    min-height: 0;
    overflow: hidden;
    border-radius: 14px;
  }

  .photo-modal-panel img {
    min-height: 0;
    max-height: 100%;
  }

  .photo-modal-close {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 120;
    width: 44px;
    height: 44px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .24);
  }

  .photo-modal-footer {
    max-height: 118px;
    overflow: hidden;
  }
}

/* Detail conversion CTA: keeps the contact action visible while customers read the room detail. */
.detail-sticky-contact {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom, 0px));
  z-index: 112;
  width: min(720px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 14px 13px 16px;
  border: 1px solid rgba(200, 168, 91, .28);
  border-radius: 18px;
  background: rgba(255, 255, 255, .97);
  color: #122f36;
  box-shadow: 0 18px 48px rgba(18, 47, 54, .18);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  backdrop-filter: blur(14px);
}

.detail-sticky-contact[hidden] {
  display: none;
}

.detail-sticky-contact.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.detail-sticky-copy {
  min-width: 0;
}

.detail-sticky-copy strong,
.detail-sticky-copy span {
  display: block;
}

.detail-sticky-copy strong {
  color: #123c7a;
  font-size: 15px;
  font-weight: 900;
}

.detail-sticky-copy span {
  margin-top: 2px;
  color: #51696d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.detail-sticky-contact .btn {
  min-height: 44px;
  white-space: nowrap;
  border-radius: 12px;
  font-weight: 850;
}

.detail-sticky-form {
  min-width: min(390px, 100%);
}

.detail-sticky-fields {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.detail-sticky-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(18, 47, 54, .16);
  border-radius: 12px;
  background: #fff;
  color: #122f36;
  padding: 0 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  outline: 0;
}

.detail-sticky-form input:focus {
  border-color: rgba(18, 47, 54, .36);
  box-shadow: 0 0 0 4px rgba(18, 47, 54, .1);
}

.detail-sticky-form .form-error {
  min-height: 16px;
  margin: 5px 0 0;
  color: #b23030;
  font-size: 12px;
  font-weight: 800;
}

@media (min-width: 1021px) {
  .detail-shell {
    padding-bottom: 128px;
  }
}

@media (max-width: 760px) {
  .detail-shell {
    padding-bottom: 120px;
  }

  .detail-sticky-contact {
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: min(100% - 20px, 520px);
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
    border-radius: 16px;
  }

  .detail-sticky-copy strong {
    font-size: 14px;
  }

  .detail-sticky-copy span {
    font-size: 12.5px;
  }

  .detail-sticky-contact .btn {
    width: 100%;
  }

  .detail-sticky-form,
  .detail-sticky-fields {
    width: 100%;
  }

  .detail-sticky-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .detail-lead-success {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
  }

  .detail-lead-success-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-lead-success-actions .btn,
  .detail-lead-success .btn {
    width: 100%;
  }

  .detail-seo-overview {
    font-size: 15px;
    line-height: 1.65;
  }
}

.detail-sticky-contact,
.detail-sticky-contact.show {
  display: none !important;
}

@media (min-width: 1021px) {
  .detail-shell {
    padding-bottom: 72px;
  }
}

@media (max-width: 760px) {
  .detail-shell {
    padding-bottom: 72px;
  }
}

/* Conversion CTA polish */
.detail-actions .btn.primary,
.detail-mobile-cta .btn.primary {
  box-shadow: 0 14px 26px rgba(15, 65, 70, .18);
}

.has-detail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.detail-auto-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-zalo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: #fff;
  color: #0b5963;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  box-shadow: 0 2px 8px rgba(4, 38, 44, .22);
}

.detail-actions .btn.primary .detail-auto-icon,
.detail-mobile-cta .btn.primary .detail-auto-icon {
  stroke-width: 2.25;
}

.detail-actions .btn.light,
.detail-mobile-cta .btn.light {
  border-color: rgba(194, 143, 54, .45);
  background: #fff7e6;
  color: #8a611d;
  font-weight: 800;
}

.detail-price-card {
  box-shadow: 0 14px 32px rgba(15, 65, 70, .08);
}

.detail-mobile-cta {
  display: none;
}

@media (max-width: 760px) {
  .detail-page {
    padding-bottom: 86px;
  }

  .detail-shell {
    padding-bottom: 120px;
  }

  .detail-mobile-cta {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 55;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(15, 65, 70, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 38px rgba(15, 65, 70, .18);
    backdrop-filter: blur(12px);
  }

  .detail-mobile-cta .btn {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 850;
  }
}
