/* ═══════════════════════════════════════════════════════════
   PRIMELINK PROPERTY – LISTING PAGE CSS
   listing.css  |  extends style.css
   Modern Luxury · White-based · Mobile-first
═══════════════════════════════════════════════════════════ */

/* ── EASE ALIAS (match index) ── */
:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════
   LISTING HEADER
═══════════════════════════════════════════════════════════ */
.listing-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
  margin-top: 68px;
  /* navbar height */
}

.listing-header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.listing-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.listing-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.listing-breadcrumb a:hover {
  color: var(--gold);
}

.listing-breadcrumb i {
  font-size: 0.65rem;
}

.listing-page-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 4px;
  line-height: 1.2;
}

.listing-result-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Search bar in header */
.listing-search-bar {
  flex: 1;
  max-width: 420px;
  min-width: 280px;
}

.listing-search-inner {
  display: flex;
  align-items: center;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 4px 4px 4px 16px;
  transition: var(--transition);
}

.listing-search-inner:focus-within {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(215, 166, 92, 0.1);
}

.listing-search-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-right: 4px;
}

.listing-search-input {
  border: none;
  background: none;
  flex: 1;
  font-size: 0.85rem;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text);
  outline: none;
  min-width: 0;
}

.listing-search-input::-moz-placeholder {
  color: var(--text-light);
}

.listing-search-input::placeholder {
  color: var(--text-light);
}

.listing-search-btn {
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.listing-search-btn:hover {
  background: var(--gold-dark);
}

/* ═══════════════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════════════ */
.listing-main {
  padding: 28px 0 60px;
  background: var(--bg-light);
  min-height: 80vh;
}

.listing-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

/* ═══════════════════════════════════════════════════════════
   FILTER SIDEBAR
═══════════════════════════════════════════════════════════ */
.filter-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.filter-sidebar::-webkit-scrollbar {
  width: 4px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.filter-sidebar-inner {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.fsb-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.fsb-section:last-child {
  border-bottom: none;
}

.fsb-label {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Listing Toggle */
.fsb-listing-toggle {
  /* background: var(--dark); */
  padding: 14px 18px;
}

.fsb-toggle-group {
  display: flex;
  gap: 4px;
  background: rgba(231, 231, 231, 0.502);
  border-radius: 50px;
  padding: 5px;
}

.fsb-toggle {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: transparent;
  color: rgba(29, 29, 29, 0.727);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}

.fsb-toggle.active {
  background: var(--gold);
  color: var(--dark);
}

/* Property Type Grid */
.fsb-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.fsb-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  transition: all 0.25s var(--ease);
}

.fsb-type-btn i {
  font-size: 1.1rem;
  color: var(--text-light);
  transition: color 0.2s;
}

.fsb-type-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.fsb-type-btn:hover i {
  color: var(--gold);
}

.fsb-type-btn.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

.fsb-type-btn.active i {
  color: var(--gold);
}

/* Price Presets */
.fsb-price-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.fsb-price-btn {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.fsb-price-btn:hover,
.fsb-price-btn.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Price inputs */
.fsb-price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fsb-price-sep {
  color: var(--text-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.fsb-input {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text);
  background: var(--bg-light);
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.fsb-input:focus {
  border-color: var(--gold);
  background: var(--white);
}

/* Pills (bed/bath) */
.fsb-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.fsb-pill {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.fsb-pill:hover,
.fsb-pill.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Location Chips */
.fsb-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fsb-loc-chip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.fsb-loc-chip i {
  font-size: 0.65rem;
}

.fsb-loc-chip:hover,
.fsb-loc-chip.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Amenity checkboxes */
.fsb-amenity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fsb-amenity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
}

.fsb-amenity:hover {
  background: var(--gold-pale);
  color: var(--gold-dark);
}

.fsb-amenity input[type="checkbox"] {
  accent-color: var(--gold);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.fsb-amenity i {
  font-size: 0.85rem;
  color: var(--text-light);
  width: 16px;
  flex-shrink: 0;
}

/* Sidebar Action Buttons */
.fsb-actions {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fsb-btn-apply {
  width: 100%;
  padding: 11px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.fsb-btn-apply:hover {
  background: var(--gold-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.fsb-btn-clear {
  width: 100%;
  padding: 9px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.fsb-btn-clear:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

/* ═══════════════════════════════════════════════════════════
   LISTING TOOLBAR
═══════════════════════════════════════════════════════════ */
.listing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.toolbar-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.active-filter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--gold-pale);
  border: 1px solid rgba(215, 166, 92, 0.35);
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.filter-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--gold-dark);
  font-size: 0.7rem;
  line-height: 1;
  display: flex;
  align-items: center;
  opacity: 0.7;
}

.filter-tag-remove:hover {
  opacity: 1;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sort-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.sort-select {
  padding: 8px 14px 8px 30px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--white);
  font-size: 0.8rem;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
}

.sort-select:focus {
  border-color: var(--gold);
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 3px;
}

.view-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.view-btn.active {
  background: var(--gold);
  color: white;
}

/* Mobile filter button */
.mobile-filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 50px;
  background: var(--white);
  color: var(--gold-dark);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.mobile-filter-btn:hover {
  background: var(--gold);
  color: white;
}

.filter-badge-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--dark);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   LISTING GRID
═══════════════════════════════════════════════════════════ */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch; /* ทำให้การ์ดในแถวเดียวกันสูงเท่ากันเสมอ (เดิมเป็น "start" ทำให้แต่ละใบสูงตามเนื้อหาของตัวเอง) */
}

/* ═══════════════════════════════════════════════════════════
   EQUAL-HEIGHT CARDS (grid view)
   แก้ปัญหาการ์ดสูงไม่เท่ากันเมื่อข้อมูลแต่ละประกาศไม่เท่ากัน
   (ชื่อเรื่องยาว/สั้น, มี/ไม่มี transit, มี/ไม่มี badge ต่อรองราคา ฯลฯ)
   หลักการ: การ์ด = flex column เต็มความสูงของ grid cell,
   ส่วนเนื้อหาขยายได้ (flex:1) และ footer (ราคา) ถูกดันไปชิดล่างเสมอ
═══════════════════════════════════════════════════════════ */
.listing-grid:not(.list-view) .pc {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* รูปภาพ/สไลด์: บังคับสัดส่วนคงที่ ไม่ให้ความสูงขึ้นกับขนาดรูปต้นฉบับ */
.listing-grid:not(.list-view) .pc-slider {
  aspect-ratio: 4 / 3;
  height: auto;
  width: 100%;
  flex-shrink: 0;
}

.listing-grid:not(.list-view) .pc-slide img,
.listing-grid:not(.list-view) .pc-slide video {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
}

/* เนื้อหา: เป็น flex column เพื่อดัน footer ไปด้านล่างสุดของการ์ด */
.listing-grid:not(.list-view) .pc-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ชื่อประกาศ: จำกัด 2 บรรทัดเสมอ กันกรณีชื่อสั้น/ยาวทำให้ความสูงส่วนหัวต่างกัน */
.listing-grid:not(.list-view) .pc-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* ที่ตั้ง: จำกัด 1 บรรทัด กันข้อความยาวดันเลย์เอาต์ */
.listing-grid:not(.list-view) .pc-location {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* สถิติ (ห้องนอน/ห้องน้ำ/พื้นที่) ถูกดันไปเหนือ footer เสมอ */
.listing-grid:not(.list-view) .pc-stats {
  margin-top: auto;
  padding-top: 8px;
}

/* footer ราคา: ชิดล่างสุดของการ์ดเสมอ ไม่ว่าข้างบนจะมี/ไม่มี transit หรือ badge ก็ตาม */
.listing-grid:not(.list-view) .pc-footer {
  margin-top: 10px;
}

/* List View */
.listing-grid.list-view {
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ═══════════════════════════════════════════════════════════
   PROPERTY CARD (Listing version – extends .pc from style.css)
═══════════════════════════════════════════════════════════ */
/* The base .pc styles come from style.css; only listing-specific overrides here */

/* Slider auto-play highlight */
.pc-slider.is-autoplaying .pc-dot.active {
  background: var(--gold);
}

/* Video slide */
.pc-slide video {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
}

.pc-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
}

.pc-video-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--dark);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pc-video-play-btn:hover {
  background: var(--gold);
  color: white;
  transform: scale(1.1);
}

/* Compare button on card */
.pc-compare {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 4;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.25s var(--ease);
}

.pc-slider:hover .pc-compare {
  opacity: 1;
}

.pc-compare:hover,
.pc-compare.active {
  background: var(--dark);
  color: white;
}

/* Media type chip */
.pc-media-chip {
  position: absolute;
  top: 10px;
  right: 42px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  padding: 3px 8px;
  border-radius: 50px;
  font-size: 0.6rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.pc-slider:hover .pc-media-chip {
  opacity: 1;
}

/* LIST VIEW Card */
.listing-grid.list-view .pc {
  flex-direction: row;
}

.listing-grid.list-view .pc-slider {
  width: 260px;
  min-width: 260px;
  height: 180px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.listing-grid.list-view .pc-body {
  flex: 1;
  padding: 16px 20px;
}

.listing-grid.list-view .pc-name {
  font-size: 1.1rem;
  -webkit-line-clamp: 1;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════ */
.listing-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.empty-icon {
  font-size: 3rem;
  color: var(--border);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   LOAD MORE
═══════════════════════════════════════════════════════════ */
.listing-loadmore {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ═══════════════════════════════════════════════════════════
   SPONSORED BANNER (non-intrusive)
═══════════════════════════════════════════════════════════ */
.listing-sponsored-banner {
  /* background: var(--dark-2);
  border-top: 1px solid rgba(215, 166, 92, 0.2); */
  padding: 14px 0;
  position: relative;
}

.spb-inner {
  background: var(--dark-2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 30px;
}

.spb-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(215, 166, 92, 0.12);
  border: 1px solid rgba(215, 166, 92, 0.25);
  padding: 4px 10px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

.spb-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.spb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.spb-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  font-size: 0.9rem;
}

.spb-brand {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
}

.spb-tagline {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
}

.spb-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spb-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spb-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  gap: 4px;
}

.spb-cta {
  margin-left: auto;
  flex-shrink: 0;
}

.spb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--gold);
  color: var(--dark);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.spb-btn:hover {
  background: var(--gold-light);
  color: var(--dark);
}

.spb-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.spb-close:hover {
  color: white;
}

/* ═══════════════════════════════════════════════════════════
   COMPARE FLOAT BAR
═══════════════════════════════════════════════════════════ */
.compare-float-bar {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 800;
  background: var(--dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(215, 166, 92, 0.25);
  padding: 12px 16px;
  min-width: 360px;
  max-width: calc(100vw - 32px);
  animation: slideUpIn 0.3s var(--ease);
}

@keyframes slideUpIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.cfb-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cfb-slots {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cfb-slot {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xs);
  border: 1.5px dashed rgba(215, 166, 92, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.cfb-slot.filled {
  border-style: solid;
  border-color: var(--gold);
}

.cfb-slot img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

.cfb-slot-empty-icon {
  color: rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
}

.cfb-slot-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: none;
  color: white;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cfb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfb-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.cfb-btn-compare {
  padding: 9px 18px;
  background: var(--gold);
  color: var(--dark);
  border: none;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}

.cfb-btn-compare:hover {
  background: var(--gold-light);
}

.cfb-btn-clear {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.cfb-btn-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

@media (min-width: 992px) {
  .compare-float-bar {
    bottom: 24px;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE FILTER DRAWER
═══════════════════════════════════════════════════════════ */
.mobile-filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.mobile-filter-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.mobile-filter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1600;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-filter-drawer.open {
  transform: translateY(0);
}

.mfd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mfd-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mfd-title i {
  color: var(--gold);
}

.mfd-close {
  background: var(--bg-light);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mfd-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.mfd-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.mfd-section:last-child {
  border-bottom: none;
}

.mfd-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.mfd-toggle-group {
  display: flex;
  gap: 8px;
}

.mfd-toggle {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mfd-toggle.active {
  border-color: var(--gold);
  background: var(--gold);
  color: white;
}

/* Type scroll (horizontal) */
.mfd-type-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.mfd-type-scroll::-webkit-scrollbar {
  display: none;
}

.mfd-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  width: 70px;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  transition: all 0.2s;
}

.mfd-type i {
  font-size: 1.25rem;
  color: var(--text-light);
  transition: color 0.2s;
}

.mfd-type.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

.mfd-type.active i {
  color: var(--gold);
}

/* Price grid */
.mfd-price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mfd-price-btn {
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mfd-price-btn.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Pills */
.mfd-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mfd-pill {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mfd-pill.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Location */
.mfd-loc-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mfd-loc {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mfd-loc.active {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* MFD Footer */
.mfd-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  /* safe area for iOS */
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
}

.mfd-btn-clear {
  flex: 0 0 auto;
  padding: 12px 18px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.mfd-btn-clear:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.mfd-btn-apply {
  flex: 1;
  padding: 12px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.mfd-btn-apply:hover {
  background: var(--gold-dark);
}

/* ═══════════════════════════════════════════════════════════
   SKELETON LOADING
═══════════════════════════════════════════════════════════ */
.pc-skeleton {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.skel-img {
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skel-body {
  padding: 14px 16px;
}

.skel-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 8px;
}

.skel-line:last-child {
  margin-bottom: 0;
  width: 60%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
  .listing-layout {
    grid-template-columns: 240px 1fr;
  }

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

@media (max-width: 991px) {
  /* Hide desktop sidebar on mobile */
  .filter-sidebar {
    display: none;
  }

  .listing-layout {
    grid-template-columns: 1fr;
  }

  .listing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 767px) {
  .listing-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .listing-search-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .listing-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .listing-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-count {
    display: none;
  }

  .sort-select {
    font-size: 0.75rem;
    padding: 7px 12px 7px 28px;
  }

  .spb-inner {
    flex-wrap: nowrap;
  }

  .spb-content {
    min-width: 0;
    flex: 1;
  }

  .spb-logo {
    display: none;
  }

  .spb-cta {
    display: none;
  }

  .listing-grid.list-view .pc {
    flex-direction: column;
  }

  .listing-grid.list-view .pc-slider {
    width: 100%;
    min-width: 0;
    height: 200px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
}

@media (max-width: 575px) {
  .listing-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .listing-main {
    padding: 16px 0 80px;
  }

  .listing-header {
    padding: 18px 0 14px;
  }

  .listing-page-title {
    font-size: 1.4rem;
  }

  .spb-title {
    font-size: 0.78rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   PRIMELINK PROPERTY – LISTING PAGE CSS  (additions)
   listing-additions.css
   เพิ่ม import ไฟล์นี้ต่อจาก listing.css
   หรือ merge ท้ายไฟล์ listing.css
═══════════════════════════════════════════════════════════ */

/* ── Province search dropdown (sidebar) ─────────────────── */
.fsb-province-search {
  margin-top: 8px;
  position: relative;
}

.fsb-province-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 400;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.prov-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.prov-item:hover {
  background: var(--gold-pale);
}

/* ── Quicksearch autocomplete ────────────────────────────── */
.search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 500;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.qs-group {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.qs-group:last-child {
  border-bottom: none;
}

.qs-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 14px 3px;
}

.qs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text);
  transition: background 0.15s;
}

.qs-item:hover {
  background: var(--gold-pale);
}

.qs-icon {
  color: var(--gold);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.qs-tag {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

.qs-item mark {
  background: rgba(215, 166, 92, 0.22);
  color: var(--gold-dark);
  border-radius: 2px;
  font-style: normal;
}

/* ── Search wrapper (for autocomplete positioning) ───────── */
.listing-search-wrapper {
  position: relative;
}

/* ── Transit tag on card ─────────────────────────────────── */
.pc-transit {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.pc-transit i {
  color: var(--gold);
  font-size: 0.75rem;
}

/* ── Discounted price (was missing → showed no strikethrough
   and no color contrast against the current price) ─────── */
.pc-price-original {
  color: var(--text-muted) !important;
  font-weight: 400;
  font-size: 0.8em;
  text-decoration: line-through;
  text-decoration-color: var(--text-muted);
  margin-right: 5px;
}

.pc-price-current {
  color: var(--gold-dark);
  font-weight: 700;
}

/* ── Negotiable badge ────────────────────────────────────── */
.pc-nego {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold-dark);
  background: var(--gold-pale);
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
}

/* ── Fetching / loading indicator ────────────────────────── */
.listing-fetching {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fetching-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Fetch error ─────────────────────────────────────────── */
.fetch-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Mobile filter amenities grid ────────────────────────── */
.mfd-amenity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mfd-amenity-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px 8px;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
  border: 1px solid transparent;
}

.mfd-amenity-item:hover {
  background: var(--gold-pale);
  color: var(--gold-dark);
  border-color: var(--gold-pale);
}

.mfd-amenity-item input[type="checkbox"] {
  accent-color: var(--gold);
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.mfd-amenity-item i {
  font-size: 0.85rem;
  color: var(--text-light);
  flex-shrink: 0;
}

/* ── Active filter tags ──────────────────────────────────── */
.active-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 12px;
  background: var(--gold-pale);
  border: 1px solid rgba(215, 166, 92, 0.3);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.filter-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--gold-dark);
  opacity: 0.7;
  padding: 0;
  border-radius: 50%;
  transition: opacity 0.2s;
}

.filter-tag-remove:hover {
  opacity: 1;
}

.filter-tag-remove i {
  font-size: 0.62rem;
}

/* ── Sidebar fsb-actions (apply/clear row) ───────────────── */
.fsb-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 18px;
}

.fsb-btn-apply {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: var(--gold);
  color: white;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 0.84rem;
  font-weight: 700;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  cursor: pointer;
  transition: var(--transition);
}

.fsb-btn-apply:hover {
  background: var(--gold-dark);
}

.fsb-btn-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.fsb-btn-clear:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

/* ── Province search wrapper ─────────────────────────────── */
.fsb-province-search .fsb-input {
  width: 100%;
}

/* ── Load more button improvements ──────────────────────────*/
.btn-loadmore {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.btn-loadmore:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: var(--gold-pale);
}

.btn-loadmore:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.listing-loadmore {
  display: flex;
  justify-content: center;
  padding: 28px 0 12px;
}

/* ── Responsive additions ─────────────────────────────────── */
@media (max-width: 767px) {
  .mfd-amenity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-autocomplete {
    max-height: 300px;
  }
}

@media (max-width: 575px) {
  .mfd-amenity-grid {
    grid-template-columns: 1fr;
  }

  .active-filter-tags {
    display: none; /* show only on ≥ tablet */
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   LISTING DETAIL PAGE (show.blade.php)
   ทุก class ด้านล่างนี้ (.detail-*, .dg-*, .dcc-*, .share-*, .social-link*)
   เดิมไม่มี CSS รองรับเลยแม้แต่บรรทัดเดียว — หน้า detail จึงโชว์แบบไม่มีสไตล์
   (พึ่งแต่ Bootstrap default) เขียนใหม่ทั้งหมด ใช้ design token ชุดเดียวกับ
   app.css (--gold, --dark, --shadow-*, --radius*) ให้ mood/tone ตรงกับ
   หน้าอื่นในเว็บ (gold & dark premium real estate)
═══════════════════════════════════════════════════════════════════════ */

.detail-page {
  background: var(--bg-light);
  padding: 28px 0 64px;
  min-height: 60vh;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────── */
.detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.detail-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.detail-breadcrumb a:hover {
  color: var(--gold-dark);
}

.detail-breadcrumb i {
  font-size: 0.7rem;
  color: var(--text-light);
}

.detail-breadcrumb span {
  color: var(--text);
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Layout: main + sticky sidebar ─────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

.detail-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════
   GALLERY
═══════════════════════════════════════════════════════════ */
.detail-gallery {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dg-main-wrap {
  position: relative;
  background: var(--dark);
}

.dg-main-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 560px;
}

.dg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

.dg-slide.active {
  opacity: 1;
  visibility: visible;
}

.dg-photo,
.dg-video {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
}

.dg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  z-index: 3;
}

.dg-arrow:hover {
  background: var(--gold);
  color: white;
}

.dg-arrow--prev { left: 16px; }
.dg-arrow--next { right: 16px; }

.dg-counter {
  position: absolute;
  right: 16px;
  bottom: 16px;
  background: rgba(17, 17, 17, 0.72);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  z-index: 3;
  letter-spacing: 0.02em;
}

.dg-badges {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.dg-badge {
  padding: 5px 13px;
  border-radius: 50px;
  font-size: 0.76rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-sm);
}

.dg-badge--sale { background: var(--dark); }
.dg-badge--rent { background: var(--gold); }

.dg-fav {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  z-index: 3;
  font-size: 1.05rem;
}

.dg-fav:hover { transform: scale(1.08); }
.dg-fav.active { color: #ef4444; }

/* Thumbnails strip */
.dg-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: var(--bg-card);
  scrollbar-width: thin;
}

.dg-thumbs::-webkit-scrollbar { height: 5px; }
.dg-thumbs::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.dg-thumb {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 58px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-light);
}

.dg-thumb img,
.dg-thumb-video {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  display: block;
}

.dg-thumb:hover { border-color: var(--gold-light); }
.dg-thumb.active { border-color: var(--gold); }

.dg-thumb-video-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: white;
  font-size: 1rem;
  z-index: 2;
}

.dg-thumb-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}

.dg-thumb-plan {
  position: relative;
  text-decoration: none;
}

.dg-thumb-plan-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.45);
  color: white;
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════
   INFO CARD
═══════════════════════════════════════════════════════════ */
.detail-info-card,
.detail-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}

.detail-type-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-prop-type {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-pale);
  padding: 4px 12px;
  border-radius: 50px;
  letter-spacing: 0.02em;
}

.detail-proj,
.detail-hold {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-hold {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 50px;
}

.detail-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 4px 0 12px;
}

.detail-location {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-location i {
  color: var(--gold);
  margin-top: 3px;
  flex-shrink: 0;
}

.detail-address { color: var(--text-light); }

.detail-transit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: 50px;
  width: -moz-fit-content;
  width: fit-content;
  margin-bottom: 16px;
}

.detail-transit i { color: var(--gold-dark); }
.detail-transit-dist { color: var(--text-light); }

/* Price block */
.detail-price-block {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 12px 0 20px;
}

.detail-price-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-price-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-price-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gold-dark);
  font-family: "Prompt", sans-serif;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.detail-price-value small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.detail-price-rent { color: var(--dark); }

.detail-nego {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gold-dark);
  background: var(--gold-pale);
  padding: 3px 9px;
  border-radius: 50px;
  vertical-align: middle;
}

/* Stats grid */
.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
}

.detail-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: var(--radius-xs);
}

.detail-stat i {
  font-size: 1.25rem;
  color: var(--gold);
  flex-shrink: 0;
}

.detail-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.detail-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   GENERIC SECTIONS (description / table / amenities / social / map)
═══════════════════════════════════════════════════════════ */
.detail-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--gold);
}

.detail-description {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-line;
}

.detail-readmore {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 0;
  background: none;
  border: none;
  color: var(--gold-dark);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.detail-readmore:hover { color: var(--gold); }

/* Details table */
.detail-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

.detail-table-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.88rem;
}

.detail-table-key { color: var(--text-muted); }
.detail-table-val { color: var(--text); font-weight: 600; text-align: right; }

/* Amenities */
.detail-amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.detail-amenity {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: var(--radius-xs);
  font-size: 0.84rem;
  color: var(--text);
}

.detail-amenity i {
  color: var(--gold-dark);
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Social / video links */
.detail-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 50px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  color: white;
  transition: var(--transition);
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: white;
}

.social-link--yt { background: #ff0000; }
.social-link--tk { background: #111111; }
.social-link--fb { background: #1877f2; }
.social-link--ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }

/* Map */
.detail-map-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.detail-map {
  width: 100%;
  height: 340px;
  border: none;
  display: block;
}

.detail-map-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
  background: var(--gold-pale);
}

.detail-map-link:hover { color: var(--gold); }

.btn-map-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 50px;
  background: var(--gold-pale);
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-map-link:hover {
  background: var(--gold);
  color: white;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR — Contact card
═══════════════════════════════════════════════════════════ */
.detail-contact-card,
.detail-share-card,
.detail-ppsqm-card,
.detail-collab-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.detail-contact-card {
  padding: 22px;
}

.dcc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.dcc-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dcc-avatar-icon {
  font-size: 1.8rem;
  color: var(--gold-dark);
}

.dcc-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.dcc-role {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dcc-collab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.dcc-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dcc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.dcc-btn--phone {
  background: var(--gold);
  color: white;
  box-shadow: var(--shadow-sm);
}

.dcc-btn--phone:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.dcc-btn--line {
  background: #06c755;
  color: white;
}

.dcc-btn--line:hover { background: #05a648; color: white; }

.dcc-btn--email {
  background: var(--bg-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.dcc-btn--email:hover { border-color: var(--gold); color: var(--gold-dark); }

.dcc-inquiry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dcc-textarea {
  width: 100%;
  resize: vertical;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  transition: var(--transition);
}

.dcc-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
}

.dcc-btn-send {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: var(--radius-xs);
  background: var(--dark);
  color: white;
  border: none;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.dcc-btn-send:hover { background: var(--dark-2); }

.dcc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-light);
}

.dcc-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Share card */
.detail-share-card {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-share-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.detail-share-btns {
  display: flex;
  gap: 8px;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.9rem;
}

.share-btn:hover { transform: translateY(-2px); color: white; }

.share-btn--copy { background: var(--dark); }
.share-btn--fb   { background: #1877f2; }
.share-btn--line { background: #06c755; }

/* Price-per-sqm mini card */
.detail-ppsqm-card {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.detail-ppsqm-card i {
  font-size: 1.5rem;
  color: var(--gold-dark);
  background: var(--gold-pale);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ppsqm-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.ppsqm-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Agent collab banner */
.detail-collab-card {
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--gold-pale);
  border: 1px solid var(--gold-light);
}

.detail-collab-card i {
  font-size: 1.3rem;
  color: var(--gold-dark);
  margin-top: 2px;
}

.collab-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.collab-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   RELATED LISTINGS
═══════════════════════════════════════════════════════════ */
.detail-related {
  margin-top: 48px;
}

.detail-related-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.detail-related-grid {
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1199px) {
  .detail-layout {
    grid-template-columns: 1fr 340px;
    gap: 22px;
  }
}

@media (max-width: 991px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
    order: -1; /* contact card ก่อน content บนจอเล็ก ให้ทัก/โทรได้ไวขึ้น */
  }

  .dg-main-slider {
    aspect-ratio: 4 / 3;
    max-height: 420px;
  }

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

@media (max-width: 767px) {
  .detail-page { padding: 18px 0 48px; }

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

  .detail-title { font-size: 1.25rem; }
  .detail-price-value { font-size: 1.4rem; }

  .dg-main-slider {
    aspect-ratio: 1 / 1;
    max-height: 360px;
  }

  .dg-arrow {
    width: 36px;
    height: 36px;
  }

  .detail-share-card {
    flex-wrap: wrap;
  }
}

@media (max-width: 575px) {
  .detail-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .detail-price-block {
    gap: 16px;
  }
}
