:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1a1f1c;
  --muted: #5c675f;
  --line: #e4e0d8;
  --accent: #0f6b5c;
  --accent-dark: #0a4f44;
  --accent-soft: #e6f3f0;
  --warn: #b45309;
  --sold: #6b7280;
  --apartada: #a16207;
  --ok: #047857;
  --shadow: 0 8px 28px rgba(26, 31, 28, 0.08);
  --radius: 16px;
  --max: 1100px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 0; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  color: var(--ink); font-weight: 750; letter-spacing: -.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: .95rem;
}
.nav { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; font-size: .95rem; text-decoration: none; }
.nav a:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 0; border-radius: 999px; padding: .75rem 1.15rem;
  font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none; transition: .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1ebe57; color: #fff; }
.btn-ghost {
  background: transparent; color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 35%, white);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* Hero */
.hero {
  padding: 2.5rem 0 1.5rem;
  background:
    radial-gradient(900px 420px at 90% -10%, #d7efe9 0%, transparent 55%),
    linear-gradient(180deg, #fff 0%, var(--bg) 100%);
}
.hero-grid {
  display: grid; gap: 1.5rem; align-items: center;
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: .3rem .7rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.hero h1 {
  margin: .7rem 0 .5rem; font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08; letter-spacing: -.03em;
}
.hero p.lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 38ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.25rem; }
.hero-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px); overflow: hidden; box-shadow: var(--shadow);
}
.hero-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.hero-card .meta { padding: 1rem 1.1rem 1.15rem; }
.hero-card .meta strong { display: block; font-size: 1.15rem; }
.hero-card .meta span { color: var(--muted); font-size: .92rem; }

/* Filters */
.filters {
  display: grid; gap: .75rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem;
  box-shadow: var(--shadow);
  margin: 1.25rem 0 1.5rem;
}
@media (min-width: 720px) {
  .filters { grid-template-columns: repeat(4, 1fr); align-items: end; }
}
.field label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--muted); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em;
}
.field select, .field input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem .8rem; background: #fff; color: var(--ink); font: inherit;
}
.field select:focus, .field input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, white);
  border-color: var(--accent);
}

/* Cards grid */
.section { padding: 1rem 0 2.5rem; }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.02em; }
.section-head p { margin: 0; color: var(--muted); font-size: .95rem; }

.grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(26,31,28,.12); }
.card-media { position: relative; aspect-ratio: 4/5; background: #ddd; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: .75rem; left: .75rem;
  border-radius: 999px; padding: .28rem .65rem;
  font-size: .75rem; font-weight: 800; color: #fff;
  background: var(--ok);
}
.badge.apartada { background: var(--apartada); }
.badge.vendida { background: var(--sold); }
.card-body { padding: 1rem 1.05rem 1.15rem; display: grid; gap: .45rem; flex: 1; }
.price { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--accent-dark); }
.card-title { font-weight: 750; margin: 0; font-size: 1.02rem; line-height: 1.25; }
.card-zone { color: var(--muted); font-size: .9rem; margin: 0; }
.stats {
  display: flex; flex-wrap: wrap; gap: .4rem .7rem;
  color: var(--muted); font-size: .86rem; margin-top: .2rem;
}
.stats span { display: inline-flex; align-items: center; gap: .25rem; }
.empty {
  grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem;
  color: var(--muted); background: var(--surface); border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Sell CTA */
.sell {
  margin: .5rem 0 2rem;
  background: linear-gradient(135deg, #0f6b5c, #147a4f);
  color: #fff; border-radius: calc(var(--radius) + 6px);
  padding: 1.6rem 1.3rem; box-shadow: var(--shadow);
}
.sell h2 { margin: 0 0 .4rem; font-size: 1.4rem; }
.sell p { margin: 0 0 1rem; opacity: .92; max-width: 48ch; }
.sell .btn-wa { background: #fff; color: #0b5; }
.sell .btn-wa:hover { background: #f0fff6; color: #098a45; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 1.5rem 0 2rem; color: var(--muted); font-size: .92rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
}
.footer-inner strong { color: var(--ink); }

/* Detail page */
.detail-hero {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 1.25rem 0 1.5rem;
}
.crumb { font-size: .88rem; color: var(--muted); margin-bottom: .6rem; }
.crumb a { color: var(--muted); }
.detail-top {
  display: grid; gap: 1rem;
}
@media (min-width: 900px) {
  .detail-top { grid-template-columns: 1.4fr .8fr; align-items: start; }
}
.gallery {
  display: grid; gap: .6rem;
}
.gallery-main {
  border-radius: var(--radius); overflow: hidden; background: #111;
  border: 1px solid var(--line);
}
.gallery-main img, .gallery-main video {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; max-height: 70vh;
}
.thumbs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem;
}
.thumbs button {
  border: 2px solid transparent; padding: 0; border-radius: 10px;
  overflow: hidden; cursor: pointer; background: #ddd; aspect-ratio: 1;
}
.thumbs button.active, .thumbs button:hover { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow); position: sticky; top: 4.5rem;
}
.panel .badge { position: static; display: inline-flex; margin-bottom: .6rem; }
.panel h1 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 3vw, 1.85rem); letter-spacing: -.02em; }
.panel .price { margin: .4rem 0 .7rem; }
.panel .zone { color: var(--muted); margin: 0 0 1rem; }
.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem;
  margin: 0 0 1rem;
}
.fact {
  background: var(--bg); border-radius: 12px; padding: .65rem .7rem;
}
.fact b { display: block; font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.fact span { font-weight: 750; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.chip {
  background: var(--accent-soft); color: var(--accent-dark);
  border-radius: 999px; padding: .28rem .65rem; font-size: .8rem; font-weight: 700;
}
.panel .btn { width: 100%; margin-top: .35rem; }

.detail-body { padding: 1.5rem 0 2.5rem; }
.detail-grid {
  display: grid; gap: 1rem;
}
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: 1.4fr .8fr; }
}
.block {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.block h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.features { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; }
.features li {
  display: flex; gap: .55rem; align-items: flex-start;
  padding: .45rem 0; border-bottom: 1px solid var(--line);
}
.features li:last-child { border-bottom: 0; }
.features li::before {
  content: ""; width: .55rem; height: .55rem; margin-top: .45rem;
  border-radius: 50%; background: var(--accent); flex: 0 0 auto;
}
.video-wrap {
  border-radius: var(--radius); overflow: hidden; background: #000;
  border: 1px solid var(--line);
}
.video-wrap video { width: 100%; aspect-ratio: 9/16; max-height: 720px; margin: 0 auto; object-fit: contain; }

.loading, .error {
  padding: 3rem 1rem; text-align: center; color: var(--muted);
}
.error { color: #b91c1c; }
