/* ============================================================
   SHOSTY — Listing Index & Filter Styles
   Filter bar, listing card grid, community/project pages
   ============================================================ */

/* ── Filter Bar ── */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filter-bar__field {
  flex: 1 1 180px;
  min-width: 150px;
}

.filter-bar__field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.filter-bar__field select,
.filter-bar__field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--dark-grey);
  background: var(--white);
  transition: border-color var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.filter-bar__field select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-bar__field select:focus,
.filter-bar__field input:focus {
  outline: none;
  border-color: var(--muesli);
}

.filter-bar__field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.filter-bar__actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-shrink: 0;
}

.filter-bar__clear {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
}

.filter-bar__clear:hover {
  border-color: var(--muesli);
  color: var(--dark-grey);
}

.filter-bar__count {
  font-size: 14px;
  color: var(--muted);
  padding: 10px 0;
  white-space: nowrap;
}

/* ── Listing Card Grid ── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: transform var(--ease), box-shadow var(--ease);
  text-decoration: none;
  color: var(--dark-grey);
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  color: var(--dark-grey);
}

.listing-card__img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--sand-mid);
}

.listing-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.listing-card__badge--offplan {
  background: var(--xanadu);
  color: var(--white);
}

.listing-card__badge--resale {
  background: var(--muesli);
  color: var(--white);
}

.listing-card__body {
  padding: 16px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.listing-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-card__location {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.listing-card__stats {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--dark-grey);
  margin-bottom: 12px;
}

.listing-card__stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.listing-card__price {
  margin-top: auto;
  font-size: 16px;
  font-weight: 600;
  color: var(--muesli);
}

/* ── Page Hero ── */
.page-hero {
  background: var(--sand-lt);
  padding: 48px 0 40px;
  margin-bottom: 0;
}

.page-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.page-hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.5;
}

.page-hero__breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.page-hero__breadcrumb a {
  color: var(--muted);
}

.page-hero__breadcrumb a:hover {
  color: var(--muesli);
}

.page-hero__stats {
  display: flex;
  gap: 24px;
  margin-top: 20px;
}

.page-hero__stat {
  text-align: center;
  padding: 12px 20px;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.page-hero__stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--muesli);
  display: block;
}

.page-hero__stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Community Grid (for /buy and /offplan index) ── */
.community-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.community-card {
  display: block;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--ease);
}

.community-card:hover {
  border-color: var(--muesli);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.community-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 4px;
}

.community-card__count {
  font-size: 13px;
  color: var(--muted);
}

/* ── Filter empty state ── */
.filter-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
  display: none;
}

.filter-empty svg {
  margin: 0 auto 16px;
  opacity: 0.4;
}

.filter-empty p {
  font-size: 15px;
}

/* ── Section headers ── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .community-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .filter-bar {
    padding: 16px;
    gap: 10px;
  }
  .filter-bar__field {
    flex: 1 1 100%;
  }
  .listing-grid { grid-template-columns: 1fr; gap: 16px; }
  .community-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-hero h1 { font-size: 26px; }
  .page-hero__stats { flex-wrap: wrap; gap: 12px; }
  .page-hero__stat { flex: 1 1 calc(50% - 6px); }
}

@media (max-width: 480px) {
  .community-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 32px 0 28px; }
  .page-hero h1 { font-size: 22px; }
}
