/**
 * Phase 7 — Trang danh sách & chi tiết BĐS (bổ sung main.css, giữ token --navy, --gold…)
 */

/* ── Archive ─────────────────────────────────────────────── */
.dsnd-archive-wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding-bottom: 48px;
}

.dsnd-breadcrumb {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.dsnd-breadcrumb a { color: var(--gold); text-decoration: none; }
.dsnd-breadcrumb a:hover { text-decoration: underline; }
.dsnd-breadcrumb__sep { margin: 0 6px; opacity: .5; }
.dsnd-breadcrumb__current { color: var(--text); }

.dsnd-archive-header { margin-bottom: 20px; }
.dsnd-archive-h1 {
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}
.dsnd-archive-intro { font-size: 13px; color: var(--text-muted); }

/* Form lọc */
.dsnd-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
@media (min-width: 600px) {
  .dsnd-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .dsnd-filter-grid { grid-template-columns: repeat(3, 1fr); }
}

.dsnd-fitem { display: flex; flex-direction: column; gap: 4px; }
.dsnd-flabel { font-size: 10px; letter-spacing: .5px; text-transform: uppercase; color: var(--text-light); }
.dsnd-fitem input,
.dsnd-fitem select {
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  background: var(--white);
}
.dsnd-filter-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.dsnd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-btn);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background .2s, border-color .2s;
}
.dsnd-btn--primary {
  background: var(--navy);
  color: var(--white);
}
.dsnd-btn--primary:hover { background: #152a45; }
.dsnd-btn--ghost {
  background: var(--white);
  border-color: var(--border);
  color: var(--text);
}
.dsnd-btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.dsnd-btn--load { width: 100%; max-width: 320px; margin: 0 auto; background: var(--white); border: 1px solid var(--border); }
.dsnd-btn--block { width: 100%; }

.dsnd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dsnd-view-toggle { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--r-input); overflow: hidden; }
.dsnd-view-btn {
  padding: 6px 14px;
  font-size: 11px;
  border: none;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-sans);
}
.dsnd-view-btn.is-active { background: var(--navy); color: var(--white); }

/* Grid archive: 1 → 2 → 3 cột */
.dsnd-card-wrap.listing-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px) {
  .dsnd-card-wrap.listing-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .dsnd-card-wrap.listing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* List view */
.listing-grid--list {
  grid-template-columns: 1fr !important;
}
.listing-grid--list .lcard {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  align-items: stretch;
}
.listing-grid--list .cimg { min-height: 120px; }
.listing-grid--list .cimg-inner.norm { height: 100%; min-height: 120px; }

.dsnd-pagination { margin: 24px 0; }
.dsnd-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  justify-content: center;
  padding: 0;
}
.dsnd-pagination a,
.dsnd-pagination span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
}
.dsnd-pagination span.current { background: var(--navy); color: var(--white); border-color: var(--navy); }
.dsnd-load-wrap { text-align: center; margin-top: 8px; }

.dsnd-no-results { grid-column: 1 / -1; text-align: center; padding: 40px 16px; color: var(--text-muted); }

/* ── Single property ───────────────────────────────────────── */
.dsnd-single-property-main { padding-bottom: 88px; }

.dsnd-single-inner { max-width: 1100px; margin: 0 auto; }

.dsnd-badges-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dsnd-badge {
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--r-badge);
  background: var(--gold);
  color: var(--white);
}
.dsnd-badge--muted { background: var(--navy); }
.dsnd-badge--outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

.dsnd-single-title {
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 10px;
}
@media (min-width: 768px) {
  .dsnd-single-title { font-size: 30px; }
}

.dsnd-single-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}
.dsnd-single-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dsnd-quick-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  list-style: none;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.dsnd-quick-specs li { text-align: center; min-width: 64px; }
.dsnd-quick-specs strong { display: block; font-size: 16px; color: var(--text); }
.dsnd-quick-specs span { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }

/* Gallery */
.dsnd-gallery { margin-bottom: 28px; }
.dsnd-gallery__main {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-alt);
}
.dsnd-gallery__img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.dsnd-gallery__zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  cursor: pointer;
  font-size: 18px;
  box-shadow: var(--sh-card);
}
.dsnd-gallery__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.dsnd-gallery__thumb {
  flex: 0 0 64px;
  height: 48px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  opacity: .7;
}
.dsnd-gallery__thumb.is-active { border-color: var(--gold); opacity: 1; }
.dsnd-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }

.dsnd-gallery--empty .dsnd-gallery__placeholder {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-card);
  color: var(--text-muted);
  font-size: 13px;
}

/* Layout 2 cột */
.dsnd-single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 960px) {
  .dsnd-single-layout {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
  .dsnd-single-col--side {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
  }
}

.dsnd-prose { font-size: 14px; line-height: 1.75; color: var(--text); margin-bottom: 28px; }
.dsnd-prose p { margin-bottom: 1em; }
/* Đoạn văn / danh sách / trích dẫn — giữ khoảng cách khi post_content có <p>, Classic Editor hoặc khối .wp-block-* */
.dsnd-prose.entry-content p,
.dsnd-prose.entry-content .wp-block-paragraph { margin-bottom: 1em; }
.dsnd-prose.entry-content p:last-child,
.dsnd-prose.entry-content .wp-block-paragraph:last-child { margin-bottom: 0; }
.dsnd-prose.entry-content ul,
.dsnd-prose.entry-content ol { margin: 0.75em 0 1em; padding-left: 1.35em; }
.dsnd-prose.entry-content li { margin-bottom: 0.4em; }
.dsnd-prose.entry-content li > p { margin-bottom: 0.35em; }
.dsnd-prose.entry-content blockquote {
  margin: 1em 0;
  padding: 0.35em 0 0.35em 1em;
  border-left: 3px solid var(--border);
  font-style: normal;
}
.dsnd-prose.entry-content h2,
.dsnd-prose.entry-content h3,
.dsnd-prose.entry-content h4 { margin: 1.15em 0 0.5em; line-height: 1.35; }

.dsnd-h2 { font-size: 18px; margin: 24px 0 12px; color: var(--text); }

.dsnd-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}
.dsnd-spec-table th,
.dsnd-spec-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.dsnd-spec-table th {
  width: 38%;
  background: var(--bg-white);
  color: var(--text-muted);
  font-weight: 500;
}

.dsnd-map-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--r-card);
  padding: 20px;
  margin-bottom: 24px;
  background: var(--bg-white);
  font-size: 13px;
  color: var(--text-muted);
}
.dsnd-map-placeholder__txt small { display: block; margin-top: 8px; opacity: .85; }

.dsnd-share { margin-bottom: 24px; }
.dsnd-share__label { font-size: 12px; margin-bottom: 8px; color: var(--text-muted); }
.dsnd-share__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.dsnd-share__a {
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-sans);
  text-decoration: none;
  color: var(--text);
}
.dsnd-share__a:hover { border-color: var(--gold); color: var(--gold); }

.dsnd-side-card {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px;
  background: var(--white);
  margin-bottom: 16px;
  box-shadow: var(--sh-card);
}
.dsnd-side-title { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.dsnd-side-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.dsnd-broker-av__img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 10px;
}
.dsnd-broker-name { font-weight: 600; margin-bottom: 6px; }
.dsnd-broker-tel { color: var(--gold); font-size: 15px; text-decoration: none; }

.dsnd-related { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.dsnd-related-grid { margin-top: 16px; }

/* Sticky CTA mobile */
.dsnd-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  gap: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10, 22, 40, 0.96);
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
}
.dsnd-sticky-cta__btn {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--white);
  border-radius: var(--r-btn);
}
.dsnd-sticky-cta__btn--call { background: var(--gold); color: var(--navy); margin-right: 4px; }
.dsnd-sticky-cta__btn--zalo { background: #0068ff; margin: 0 4px; }
.dsnd-sticky-cta__btn--book { background: transparent; border: 1px solid rgba(255,255,255,.4); margin-left: 4px; }

@media (min-width: 960px) {
  .dsnd-sticky-cta { display: none; }
}

/* Lightbox */
.dsnd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dsnd-lightbox[hidden] { display: none !important; }
.dsnd-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.dsnd-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
