/* ==========================================================================
   Thawany Motta Imóveis — Listing Page (Imóveis)
   ========================================================================== */

/* ---------- Page Hero ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: end;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(75,45,31,.9) 0%, rgba(102,67,48,.8) 36%, rgba(115,80,60,.45) 100%),
    url('https://images.unsplash.com/photo-1505693416388-ac5ce068fe85?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
}
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.18) 100%);
}
.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 4.5rem 0 3rem;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 4vw, 4.2rem);
  max-width: 11ch;
  margin-top: 1rem;
}
.page-hero p {
  max-width: 38rem;
  color: rgba(255,255,255,.82);
  margin-top: 1rem;
}

/* ---------- Filters Bar ---------- */
.filters-bar {
  background: #fbf8f4;
  border-top: 1px solid rgba(47,36,31,.08);
  border-bottom: 1px solid rgba(47,36,31,.08);
}
.filter-btn {
  position: relative;
  width: 100%;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border: 0;
  border-right: 1px solid rgba(47,36,31,.08);
  background: transparent;
  color: var(--color-text-primary);
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  margin: 0;
}
.filter-btn.is-active {
  background: rgba(118, 80, 61, 0.08);
}
.filter-btn .label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  pointer-events: none;
  position: relative;
  z-index: 2;
}
.filter-btn .filter-value {
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.filter-btn .filter-caret {
  position: relative;
  z-index: 2;
  pointer-events: none;
  margin-left: auto;
  flex-shrink: 0;
  opacity: .7;
}
.filter-btn .tm-filter-select {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  font-weight: 600;
  padding: 0;
  margin: 0;
  cursor: pointer;
  z-index: 3;
}
.filter-btn .tm-filter-select option {
  color: var(--color-text-primary);
}
.filter-btn .tm-filter-select:focus {
  outline: none;
}
.filter-btn--checkbox {
  border-right: 0;
}
.filter-btn--checkbox.is-active,
.filter-btn--checkbox:has(.tm-filter-piscina:checked) {
  background: rgba(118, 80, 61, 0.08);
}

/* ---------- Listing Section ---------- */
.listing-section { background: #e9e4dc; }
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}
.results-count { color: var(--color-text-secondary); font-weight: 600; }
.sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 48px;
  padding: .85rem 2.75rem .85rem 1rem;
  border: 1px solid rgba(47,36,31,.12);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%232f241f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  color: var(--color-text-primary);
  border-radius: 0;
  cursor: pointer;
}
.sort-select::-ms-expand {
  display: none;
}

/* ---------- Pagination ---------- */
.listing-pagination {
  display: flex;
  justify-content: center;
  width: 100%;
}
.listing-pagination .page-numbers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.listing-pagination .page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.listing-pagination .page-numbers a,
.listing-pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 46px;
  padding: .7rem 1rem;
  border: 1px solid rgba(47, 36, 31, 0.12);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border-radius: 0;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.listing-pagination .page-numbers a:hover,
.listing-pagination .page-numbers a:focus-visible {
  background: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  color: #fff;
  outline: none;
}
.listing-pagination .page-numbers .current {
  background: var(--color-brand-dark);
  border-color: var(--color-brand-dark);
  color: #fff;
  cursor: default;
}
.listing-pagination .page-numbers .dots {
  border-color: transparent;
  background: transparent;
  min-width: 2rem;
  padding-inline: .35rem;
  color: var(--color-text-secondary);
}
.listing-pagination .page-numbers .prev,
.listing-pagination .page-numbers .next {
  padding-inline: 1.15rem;
}

/* ---------- Property Cards (listing — 16:11 ratio, body below) ---------- */
.listing-section .property-card {
  display: flex;
  flex-direction: column;
}
.property-media {
  aspect-ratio: 16 / 11;
  background: #ddd;
  flex: none;
}
.property-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1.2rem;
}
.property-title {
  font-size: 1.45rem;
  line-height: 1.02;
  margin-bottom: .5rem;
}
.property-address {
  color: var(--color-text-secondary);
  font-size: .94rem;
  margin-bottom: .8rem;
}
.property-specs {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  font-size: .84rem;
  color: var(--color-text-primary);
  margin-bottom: .9rem;
}
.property-specs span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.property-price {
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 1rem;
}
.property-actions {
  display: flex;
  gap: .7rem;
  flex-wrap: nowrap;
  margin-top: auto;
  width: 100%;
}
.property-actions .btn,
.property-actions .ghost-link {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  justify-content: center;
  text-align: center;
}
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: .8rem 1rem;
  border: 1px solid rgba(47,36,31,.12);
  font-weight: 700;
}

/* ---------- Listing Responsive ---------- */
@media (max-width: 991.98px) {
  .filter-btn { border-right: 0; border-bottom: 1px solid rgba(47,36,31,.08); }
  .results-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 767.98px) {
  .page-hero { min-height: 280px; }
  .page-hero-content { padding: 3.5rem 0 2.5rem; }
  .page-hero h1 { max-width: 12ch; }
  .property-title { font-size: 1.28rem; }
  .cta-image img { min-height: 220px; }
}

@media (max-width: 575.98px) {
  .filter-btn .label { white-space: normal; align-items: flex-start; }
  .filter-btn .filter-value { white-space: normal; }
  .property-actions { flex-direction: column; }
  .ghost-link, .property-actions .btn { width: 100%; }
}
