/* ═══════════════════════════════════════════════════════════
   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: start;
}

/* 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;
}

/* ── 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 */
  }
}

