:root {
  /* ---- paleta de marca — manual de marca Compra Renta v1.0 ---- */
  --c-ink: #1C2C46;
  --c-paper: #E5E6DF;
  --c-paper-raised: #EDEEE7;
  --c-paper-inset: #DBDDD2;
  --c-steel: #737E8C;
  --c-steel-line: #C6CBD1;
  --c-blueprint: #2E5384;
  --c-blueprint-soft: #7FA3CC;
  --c-copper: #C98A3D;
  --c-copper-soft: #E0AD70;
  --c-verify: #4B5D43;

  /* ---- tokens semánticos ---- */
  --navy: var(--c-ink);
  --bg: var(--c-paper);
  --card: var(--c-paper-raised);
  --card-inset: var(--c-paper-inset);
  --text: var(--c-ink);
  --muted: #53574F;
  --faint: #797D73;
  --border: var(--c-steel-line);
  --blue: var(--c-blueprint);
  --blue-light: var(--c-blueprint-soft);
  --copper: var(--c-copper);
  --copper-light: var(--c-copper-soft);
  --ok: var(--c-verify);
  --danger: #A8371E;
  --on-accent: #F3F3EE;

  --radius-sm: 2px;
  --radius: 3px;
  --radius-lg: 5px;

  --font-display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --font-sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
  line-height: 1.12;
  margin: 0 0 .5rem;
}

a { color: inherit; text-decoration: none; }

a, button, .card, .nav-toggle { cursor: pointer; }

.mono, .specs, .sidebar-price, .info-row strong {
  font-family: var(--font-mono);
}

.label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
  font-weight: 700;
  font-size: .9rem;
}
.skip-link:focus {
  left: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* Scroll reveal (progressive enhancement — .reveal only added by JS) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
header.site .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}
nav.main ul {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: .92rem;
}
nav.main a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
nav.main a:hover { color: var(--blue); }
nav.main a.active { color: var(--text); font-weight: 700; border-bottom-color: var(--copper); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--card); }

@media (max-width: 800px) {
  nav.main { display: none; }
  nav.main.open { display: block; width: 100%; }
  nav.main.open ul { flex-direction: column; gap: 4px; padding: 16px 0; }
  nav.main.open a { display: block; padding: 10px 4px; }
  header.site .container { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
}

/* Hero */
.hero {
  padding: 64px 0 40px;
  background: linear-gradient(170deg, var(--c-ink) 0%, var(--c-blueprint) 160%);
  color: var(--on-accent);
}
.hero .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 10px;
}
.hero .eyebrow { color: var(--c-copper-soft); }
.hero h1 { font-size: 2.6rem; color: var(--on-accent); }
.hero h1 strong { color: var(--c-copper-soft); display: block; }
.hero p.lead { color: #C7CDDC; max-width: 460px; margin: 16px 0 24px; }
.hero img, .hero-media img { width: 100%; border-radius: var(--radius-lg); display: block; object-fit: cover; }

.hero-carousel {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.hero-carousel .hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: heroCarousel 15s infinite;
}
@keyframes heroCarousel {
  0% { opacity: 0; }
  4%, 16% { opacity: 1; }
  20%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-carousel .hero-slide { animation: none; opacity: 0; }
  .hero-carousel .hero-slide:first-child { opacity: 1; }
}

@media (max-width: 800px) {
  .hero .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
}

.hero-compact { padding: 48px 0 28px; }
.hero-compact .lead { max-width: 620px; }

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.chip {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--on-accent);
  border-radius: var(--radius-lg);
  padding: 7px 16px;
  font-size: .84rem;
  font-weight: 600;
  transition: border-color .2s var(--ease), color .2s var(--ease), background-color .2s var(--ease);
}
.chip:hover { border-color: var(--c-copper-soft); color: var(--c-copper-soft); }

.stats-strip { padding: 40px 0; }
.stats-strip .stats-grid { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; }

.listing-section { padding-top: 0; }
.filters-sticky { position: sticky; top: 12px; z-index: 10; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--copper);
  color: var(--on-accent);
  padding: 12px 22px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .92rem;
  border: none;
  transition: background-color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--copper-light); }
.btn:active { transform: scale(.98); }
.btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.outline:hover { background: var(--card); border-color: var(--blue); color: var(--blue); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Sections */
section { padding: 48px 0; }
.section-tag {
  color: var(--blue);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}
.section-head { text-align: center; max-width: 620px; margin: 0 auto 36px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}
.stats-grid h2 { font-family: var(--font-display); color: var(--blue); font-size: 2.4rem; font-variant-numeric: tabular-nums; }
.stats-grid p { color: var(--muted); margin: 0; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: 1fr; } }

/* Cards / grid listing */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 950px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) { .cards-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(28,44,70,.05);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(28,44,70,.10);
  border-color: var(--blue-light);
}
.card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--card-inset); display: block; }
.card .body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.05rem; margin: 0; }
.card .meta { color: var(--muted); font-size: .85rem; }
.card .specs { font-size: .82rem; color: var(--text); letter-spacing: -0.01em; }
.card-price { font-family: var(--font-mono); font-weight: 600; color: var(--blue); font-size: .95rem; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card .tags { align-self: flex-start; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tag-neutral { background: #E1E7EE; color: var(--blue); }
.tag-ok { background: #E2E6DF; color: var(--ok); }
.tag-plan { background: #F3E6D3; color: #8A5A20; }
.tag-soldout { background: #F2E1DC; color: var(--danger); }

.card-media { position: relative; }
.sold-out-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.card-map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  pointer-events: none;
}
.fav-btn {
  position: absolute;
  top: 10px; left: 10px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fav-btn-active { color: #f2c94c; }
.fav-btn-inline {
  position: static;
  width: 42px; height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: #94a3b8;
  font-size: 1.4rem;
  text-shadow: none;
}
.fav-btn-inline.fav-btn-active { color: #f2c94c; border-color: #f2c94c; }
.fav-btn-inline:hover { border-color: #94a3b8; }
.fav-btn-inline.fav-btn-active:hover { border-color: #f2c94c; }
.card-map iframe { width: 100%; height: 130px; border: 0; display: block; }
.card .footer-link {
  margin-top: auto;
  font-weight: 700;
  color: var(--blue);
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s var(--ease);
}
.card:hover .footer-link { gap: 8px; }

.card-btn {
  margin-top: auto;
  display: block;
  text-align: center;
  background: var(--blue);
  color: #fff;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background-color .2s var(--ease);
}
.card:hover .card-btn, .card:focus-visible .card-btn { background: var(--copper); }

/* Filters */
.filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 32px;
  align-items: end;
}
.filters > div { flex: 1 1 170px; }
.filters .range-filter { flex: 1 1 220px; }
.filters .btn { flex: 0 0 auto; }
.filters label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.filters select, .filters input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s var(--ease);
}
.filters select:hover, .filters input[type="number"]:hover { border-color: var(--blue-light); }
@media (max-width: 900px) { .filters { flex-direction: column; align-items: stretch; } .filters .btn { width: 100%; } }

/* Dual-thumb range slider */
.range-values { font-family: var(--font-mono); font-size: .82rem; font-weight: 500; color: var(--blue); margin-bottom: 8px; }
.range-slider { position: relative; height: 20px; }
.range-slider-bg::before {
  content: '';
  position: absolute;
  top: 8px; left: 0; right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.range-slider .range-track {
  position: absolute;
  top: 8px; height: 4px;
  background: var(--blue);
  border-radius: 2px;
  z-index: 1;
}
.range-slider input[type="range"] {
  position: absolute;
  left: 0; right: 0; top: 0;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 2;
}
.range-slider input[type="range"]::-webkit-slider-runnable-track { -webkit-appearance: none; background: transparent; height: 20px; }
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 16px; height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(28,44,70,.3);
  cursor: pointer;
}
.range-slider input[type="range"]::-moz-range-track { background: transparent; height: 20px; }
.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(28,44,70,.3);
  cursor: pointer;
}

/* Ficha detalle */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 18px;
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.back-link:hover { color: var(--blue); gap: 10px; }

.ficha-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.ficha-sidebar { position: sticky; top: 12px; }
.sidebar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.sidebar-price { font-size: 1.5rem; font-weight: 600; color: var(--blue); }
.sidebar-sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.sidebar-heading { font-family: var(--font-display); font-weight: 700; font-size: .9rem; margin: 18px 0 4px; }
.sidebar-card .alert-ok, .sidebar-card .alert-err { margin-top: 16px; }
.sidebar-btn { display: block; width: 100%; text-align: center; margin-top: 10px; }
.sidebar-card form label { display: block; font-weight: 600; font-size: .8rem; margin: 12px 0 4px; }
.sidebar-card form input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s var(--ease);
}
.sidebar-card form input:hover { border-color: var(--blue-light); }

.ficha-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.ficha-title-row h1 { color: var(--text); }
.ficha-block { margin-top: 32px; }
.ficha-block h2 { font-size: 1.2rem; margin-bottom: 12px; }
.ficha-block p { color: var(--text); }
.ficha-address { color: var(--muted); margin-bottom: 14px; }

.info-rows { border-top: 1px solid var(--border); }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.info-row span { color: var(--muted); }
.info-row strong { font-weight: 500; text-align: right; }

.download-box {
  background: var(--card-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.download-box p { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }

.breadcrumb { margin-top: 40px; font-size: .84rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { color: var(--text); font-weight: 600; }

@media (max-width: 900px) {
  .ficha-layout { grid-template-columns: 1fr; }
  .ficha-sidebar { position: static; }
}

.ficha-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin: 24px 0; aspect-ratio: 16/8; }
.ficha-media { position: relative; height: 100%; }
.ficha-gallery img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--card-inset);
  display: block;
  cursor: zoom-in;
  transition: opacity .2s var(--ease);
}
.ficha-gallery img:hover, .ficha-gallery img:focus-visible { opacity: .88; }
.ficha-gallery .thumbs { display: grid; grid-template-rows: 1fr 1fr; gap: 10px; height: 100%; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,44,70,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 2000;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-overlay img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  transition: background-color .2s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.22); }
@media (max-width: 800px) { .ficha-gallery { grid-template-columns: 1fr; } }

.ficha-map {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.ficha-map iframe { width: 100%; height: 280px; border: 0; display: block; }

/* CTA band */
.cta-band {
  background: linear-gradient(170deg, var(--c-ink) 0%, var(--c-blueprint) 160%);
  color: var(--on-accent);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}
.cta-band h2, .cta-band h3 { color: var(--on-accent); }
.cta-band p { color: #C7CDDC; }
.cta-band .btn { background: var(--copper); color: var(--on-accent); }
.cta-band .btn:hover { background: var(--copper-light); }
.cta-band .btn.outline { background: transparent; border: 1px solid rgba(255,255,255,.35); color: #fff; }
.cta-band .btn.outline:hover { background: rgba(255,255,255,.1); border-color: #fff; }

/* WhatsApp flotante */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(28,44,70,.28);
  z-index: 999;
  transition: transform .15s var(--ease), background-color .2s var(--ease);
}
.whatsapp-float:hover { background: #1ebe5a; transform: scale(1.06); }
.whatsapp-float:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float { transition: none; }
  .whatsapp-float:hover { transform: none; }
}

/* Forms */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 560px;
}
.form-card label { display: block; font-weight: 600; font-size: .85rem; margin: 14px 0 6px; }
.form-card input, .form-card textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s var(--ease);
}
.form-card input:hover, .form-card textarea:hover { border-color: var(--blue-light); }
.form-card textarea { min-height: 90px; }
.alert-ok, .alert-err {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: .9rem;
}
.alert-ok { background: #E2E6DF; color: var(--ok); }
.alert-err { background: #F2E1DC; color: var(--danger); }
.alert-ok svg, .alert-err svg { flex-shrink: 0; margin-top: 2px; }

/* Footer */
footer.site {
  background: var(--navy);
  color: #B9C1D4;
  padding: 48px 0 24px;
  margin-top: 40px;
}
footer.site .grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
}
footer.site h3 { color: #fff; }
footer.site p { font-size: .88rem; color: #8D96AC; }
footer.site .grid a:hover { color: #fff; }
.foot-bottom {
  border-top: 1px solid #354363;
  margin-top: 30px;
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .02em;
  color: #71798E;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 700px) { footer.site .grid { grid-template-columns: 1fr; } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.scroll-status {
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
  padding: 24px 0;
}
