@font-face {
  font-family: Rubik;
  src: url(fonts/rubik-variablefont-wght.ttf);
}

@font-face {
  font-family: Poppins;
  src: url(fonts/poppins-thin.ttf);
}

@font-face {
  font-family: "Poppins Bold";
  src: url(fonts/poppins-bold.ttf);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --caney-cream: #fcf6f0;
  --caney-page: #f1ece6;
  --caney-surface: #fff9f2;
  --caney-card: #fffdfa;
  --caney-border: rgba(123, 98, 82, 0.14);
  --caney-border-strong: rgba(123, 98, 82, 0.22);
  --caney-text: #353232;
  --caney-muted: #7f6558;
  --caney-copy: #6c625b;
  --caney-shadow: 0 12px 28px rgba(63, 48, 38, 0.07);
  --caney-shadow-hover: 0 18px 34px rgba(63, 48, 38, 0.1);
}

body {
  background: var(--caney-page);
  color: var(--caney-text);
  font-family: Poppins, sans-serif;
}

header {
  background: rgba(252, 246, 240, 0.96);
  border-bottom: 1px solid rgba(123, 98, 82, 0.08);
}

nav {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1rem 1.5rem 0.95rem;
}

nav a {
  display: flex;
  justify-content: center;
}

nav img {
  display: block;
  width: auto;
  height: 108px;
  max-width: min(100%, 360px);
  transition: opacity 180ms ease, transform 180ms ease;
}

nav img:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

h1 {
  max-width: 1240px;
  margin: 1.8rem auto 0.75rem;
  padding: 0 1.5rem;
  color: var(--caney-text);
  font-family: Poppins, sans-serif;
  font-size: clamp(2.2rem, 4.2vw, 3.7rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-align: center;
}

.toolbar,
.filters,
.property-listing,
.empty-msg,
.pager {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
  padding-bottom: 0.85rem;
}

.filter-toggle,
.filters button,
.view-details {
  border: none;
  border-radius: 999px;
  background: #e6ccaa;
  color: var(--caney-text);
  cursor: pointer;
  font-family: "Poppins Bold", sans-serif;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 50px;
  padding: 0.85rem 1.35rem;
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.12);
}

.filter-toggle:hover,
.filters button:hover,
.view-details:hover {
  background: #dac09d;
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(127, 101, 88, 0.18);
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
  padding-bottom: 1.5rem;
}

.filters > div {
  background: var(--caney-card);
  border: 1px solid var(--caney-border);
  border-radius: 18px;
  box-shadow: var(--caney-shadow);
  padding: 1rem;
}

.filters .btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.filters label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--caney-muted);
  font-family: "Poppins Bold", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.filters select,
.filters input[type="number"] {
  width: 100%;
  border: 1px solid rgba(123, 98, 82, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--caney-text);
  font-family: Rubik, sans-serif;
  font-size: 0.98rem;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.filters select:focus,
.filters input[type="number"]:focus {
  border-color: rgba(127, 101, 88, 0.35);
  box-shadow: 0 0 0 4px rgba(230, 204, 170, 0.2);
}

.filters button {
  min-height: 48px;
  padding: 0.8rem 1rem;
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.1);
}

.property-listing {
  display: grid;
  gap: 1.35rem;
  padding-top: 0.8rem;
  padding-bottom: 0.6rem;
}

.property-item {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  background: var(--caney-surface);
  border: 1px solid var(--caney-border);
  border-radius: 24px;
  box-shadow: var(--caney-shadow);
  padding: 1.35rem;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.property-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--caney-shadow-hover);
  border-color: var(--caney-border-strong);
}

.property-image {
  width: 240px;
  height: 240px;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
  display: block;
  background: #f5efe8;
}

.property-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
}

.property-info h2 {
  margin: 0 0 0.4rem;
  color: var(--caney-text);
  font-family: Poppins, sans-serif;
  font-size: clamp(1.7rem, 2vw, 2.35rem);
  font-weight: 300;
  line-height: 1.1;
}

.property-info p {
  color: var(--caney-copy);
  font-family: Rubik, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.property-info p strong {
  color: var(--caney-text);
}

.view-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 190px;
  margin-top: 0.9rem;
  padding: 0.9rem 1.45rem;
  text-decoration: none;
  font-size: 0.95rem;
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.12);
}

.empty-msg {
  color: var(--caney-copy);
  font-family: Rubik, sans-serif;
  font-size: 1rem;
  text-align: center;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  padding-top: 1rem;
  padding-bottom: 2.6rem;
}

.pager .view-details {
  align-self: center;
  margin-top: 0;
}

@media (max-width: 1100px) {
  nav img {
    height: 92px;
  }

  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .property-item {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .property-image {
    width: 220px;
    height: 220px;
  }
}

@media (max-width: 820px) {
  nav {
    padding: 0.8rem 1rem 0.85rem;
  }

  nav img {
    height: 76px;
  }

  h1 {
    margin-top: 1.4rem;
    padding: 0 1rem;
    letter-spacing: 0.04em;
  }

  .toolbar,
  .filters,
  .property-listing,
  .empty-msg,
  .pager {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .toolbar {
    justify-content: center;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .property-item {
    grid-template-columns: 1fr;
    gap: 1.1rem;
    padding: 1rem;
  }

  .property-image {
    width: 100%;
    max-width: 420px;
    height: auto;
    aspect-ratio: 1 / 1;
    justify-self: center;
  }

  .property-info {
    text-align: center;
    align-items: center;
  }

  .property-info h2 {
    font-size: 1.8rem;
  }

  .view-details {
    align-self: center;
    width: min(100%, 320px);
  }

  .pager {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .filters .btns {
    grid-template-columns: 1fr;
  }

  .filter-toggle {
    width: 100%;
  }

  .property-info h2 {
    font-size: 1.55rem;
  }

  .property-info p {
    font-size: 0.95rem;
  }
}

/* --- Phase 5: sector aggregate pages --- */

/* Kept in the accessibility tree and in the anchor text for crawlers, but
   out of sight: chips show only the zone name, while the full phrase
   ("Apartamentos en venta en Bella Vista, Santo Domingo") is what a crawler
   and a screen reader read. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Quick Venta / Alquiler filter, above "Zonas destacadas". Same pill
   language as the sector chips; the active one is filled, and clicking it
   again clears the filter. */
.op-filter {
  max-width: 1100px;
  margin: 0 auto 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}
.op-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--caney-card);
  border: 1px solid var(--caney-border);
  border-radius: 999px;
  color: var(--caney-text);
  font-family: "Poppins Bold", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease,
              border-color 180ms ease, box-shadow 180ms ease;
}
.op-btn:hover,
.op-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--caney-border-strong);
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.14);
}
.op-btn.is-active {
  background: #e6ccaa;
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.18);
}
.op-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(230, 204, 170, 0.42);
  color: var(--caney-muted);
  font-size: 0.72rem;
}
.op-btn.is-active .op-count {
  background: rgba(255, 255, 255, 0.7);
  color: var(--caney-text);
}

@media (max-width: 600px) {
  .op-filter { gap: 0.5rem; }
  .op-btn { padding: 0.55rem 1rem; font-size: 0.85rem; }
}

.sector-nav {
  max-width: 1100px;
  margin: 0 auto 1.75rem;
  padding: 1.35rem 1.5rem;
  background: #faf5ef;
  border: 1px solid var(--caney-border);
  border-radius: 20px;
  box-shadow: var(--caney-shadow);
}
.sector-nav h2 {
  margin: 0 0 1rem;
  font-family: Poppins, sans-serif;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--caney-muted);
  text-align: center;
}
.sector-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.sector-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem 0.55rem 1.1rem;
  background: var(--caney-card);
  border: 1px solid var(--caney-border);
  border-radius: 999px;
  color: var(--caney-text);
  font-family: Poppins, sans-serif;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease,
              border-color 180ms ease, box-shadow 180ms ease;
}
.sector-chip:hover,
.sector-chip:focus-visible {
  transform: translateY(-2px);
  background: #e6ccaa;
  border-color: var(--caney-border-strong);
  box-shadow: 0 10px 18px rgba(127, 101, 88, 0.14);
}
.sector-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: rgba(230, 204, 170, 0.42);
  color: var(--caney-muted);
  font-family: "Poppins Bold", sans-serif;
  font-size: 0.75rem;
}
.sector-chip:hover .sector-chip-count,
.sector-chip:focus-visible .sector-chip-count {
  background: rgba(255, 255, 255, 0.65);
  color: var(--caney-text);
}

@media (max-width: 600px) {
  .sector-nav { padding: 1.1rem 1rem; border-radius: 16px; margin-bottom: 1.25rem; }
  .sector-chip { font-size: 0.9rem; padding: 0.5rem 0.65rem 0.5rem 0.95rem; }
}

.sector-intro { max-width: 1100px; margin: 0 auto 14px; padding: 0 18px; }

.sector-table {
  width: calc(100% - 36px);
  max-width: 1100px;
  margin: 0 auto 28px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95rem;
}
.sector-table caption {
  text-align: left;
  padding: 0 0 8px;
  font-weight: bold;
}
.sector-table th,
.sector-table td { border: 1px solid #e7ddd2; padding: 8px 12px; text-align: left; }
.sector-table thead th { background: #faf5ef; }
.sector-table tbody tr:nth-child(even) td { background: #fdfaf7; }
.sector-table a { color: #7f6558; }

@media (max-width: 700px) {
  /* A six-column comparison table cannot fit a phone. Let cells wrap (that
     alone cuts the scroll width from ~1400px to ~580px) and keep horizontal
     scrolling as the fallback, with an inset edge shadow so it is visible
     that there is more table to the right. */
  .sector-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
    box-shadow: inset -14px 0 14px -14px rgba(0, 0, 0, 0.35); }
  .sector-table th,
  .sector-table td { padding: 6px 8px; font-size: 0.85rem; }
}
