/* ==========================================================================
   Vértice Inmobiliaria · styles.css
   Mobile-first. Sin frameworks. Tokens en :root.
   Tipografía: Schibsted Grotesk (display) · Public Sans (texto) · Newsreader (solo citas)
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/schibsted-grotesk-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("assets/fonts/public-sans-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Color: identidad clara fija (sin modo oscuro, por decisión de marca) */
  --bg: #f4f2ed;            /* fondo cálido casi blanco */
  --surface: #fbfaf7;       /* tarjetas, paneles */
  --surface-2: #ebe7df;     /* banda tonal */
  --ink: #152238;           /* azul marino: texto principal y elementos de confianza */
  --ink-deep: #0d1728;      /* footer, overlays */
  --text: #1d2637;
  --muted: #586173;         /* 5.6:1 sobre --bg */
  --line: #d9d3c8;
  --line-strong: #bfb7a9;
  --bronze: #8a6636;        /* acento: precios, CTA, badges. 4.6:1 sobre --bg, 5.2:1 con blanco */
  --bronze-hover: #735429;
  --bronze-light: #c9a56b;  /* acento sobre fondos marinos (7:1) */
  --white: #fdfcfa;

  /* Tipografía */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --font-quote: "Newsreader", Georgia, "Times New Roman", serif;

  /* Los tamaños grandes dependen del ancho y también del alto (laptops con ventana baja) */
  --fs-h1: clamp(2.1rem, min(1.45rem + 3.5vw, 0.6rem + 7vh), 3.9rem);
  --fs-h2: clamp(1.75rem, min(1.35rem + 2.1vw, 0.7rem + 5vh), 3rem);
  --fs-h3: 1.1875rem;
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);

  /* Espacio y forma */
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1280px;
  --section: clamp(64px, min(10vw, 15vh), 136px);
  --r: 4px;                  /* un solo radio para toda la página */
  --hh: 76px;                /* altura del header */
  --hh-compact: 62px;

  /* Sombras tintadas al marino, nunca negro puro */
  --shadow-sm: 0 1px 2px rgba(21, 34, 56, 0.06), 0 2px 8px rgba(21, 34, 56, 0.04);
  --shadow-md: 0 2px 4px rgba(21, 34, 56, 0.05), 0 14px 32px -8px rgba(21, 34, 56, 0.16);
  --shadow-lg: 0 30px 80px -20px rgba(13, 23, 40, 0.45);

  /* Movimiento (curvas fuertes; sin ease-in en UI) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset mínimo ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hh-compact) + 16px);
}
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { flex-shrink: 0; }

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--r);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Tipografía ---------- */
.h1, .h2, .h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.h1 { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.03em; }
.h2 { font-size: var(--fs-h2); line-height: 1.08; }
.h3 { font-size: var(--fs-h3); line-height: 1.3; letter-spacing: -0.01em; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bronze);
  margin-bottom: 18px;
}
.lead {
  font-size: var(--fs-lead);
  color: var(--muted);
  max-width: 58ch;
  text-wrap: pretty;
}
.num { font-variant-numeric: tabular-nums lining-nums; }

.section { padding-block: var(--section); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .h2 + .lead { margin-top: 18px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.1;
  white-space: nowrap;
  user-select: none;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn .icon { width: 19px; height: 19px; }

.btn--accent { background: var(--bronze); color: var(--white); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--line { border-color: rgba(21, 34, 56, 0.28); color: var(--ink); }
.btn--light { background: var(--surface); color: var(--ink); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 0.875rem; }
.btn--block { width: 100%; }

@media (hover: hover) and (pointer: fine) {
  .btn--accent:hover { background: var(--bronze-hover); }
  .btn--ink:hover { background: #1f3150; }
  .btn--line:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
  .btn--light:hover { background: #fff; }
  .btn .icon--arrow { transition: transform 200ms var(--ease-out); }
  .btn:hover .icon--arrow { transform: translateX(3px); }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--hh);
  color: var(--white);
  transition:
    height 260ms var(--ease-out),
    background-color 260ms ease,
    color 260ms ease,
    box-shadow 260ms ease;
}
.site-header::before {
  /* velo sutil sobre el hero para legibilidad antes del scroll */
  content: "";
  position: absolute;
  inset: 0 0 -40px 0;
  background: linear-gradient(180deg, rgba(13, 23, 40, 0.45), rgba(13, 23, 40, 0));
  pointer-events: none;
  transition: opacity 260ms ease;
}
.site-header.is-scrolled,
.site-header.is-menu-open {
  height: var(--hh-compact);
  color: var(--ink);
  background: rgba(244, 242, 237, 0.97);
  box-shadow: 0 1px 0 var(--line);
}
/* El desenfoque del header solo en escritorio: en teléfonos obliga a recomponer
   cada frame del scroll sobre las fotos y se siente trabado. */
@media (min-width: 960px) and (hover: hover) {
  .site-header.is-scrolled {
    background: rgba(244, 242, 237, 0.9);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
  }
}
.site-header.is-menu-open { background: var(--bg); }
.site-header.is-scrolled::before,
.site-header.is-menu-open::before { opacity: 0; }

.header-inner {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.logo__mark { width: 30px; height: 30px; }
.logo__mark .mark-apex { fill: var(--bronze-light); transition: fill 260ms ease; }
.is-scrolled .logo__mark .mark-apex,
.is-menu-open .logo__mark .mark-apex { fill: var(--bronze); }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo__sub {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-top: 4px;
}

.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: clamp(20px, 2.4vw, 36px); }
.nav__link {
  position: relative;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 10px 0;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-cta { display: none; }

.menu-toggle {
  width: 44px; height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r);
}
.menu-toggle .icon { width: 26px; height: 26px; }
.menu-toggle .icon--close { display: none; }
.is-menu-open .menu-toggle .icon--menu { display: none; }
.is-menu-open .menu-toggle .icon--close { display: block; }

.mobile-menu {
  position: fixed;
  inset: var(--hh-compact) 0 auto 0;
  z-index: 49;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px var(--gutter) 28px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s linear 240ms;
}
.mobile-menu.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 200ms ease, transform 240ms var(--ease-out), visibility 0s;
}
.mobile-menu a:not(.btn) {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 24px; }

@media (min-width: 560px) {
  .header-cta { display: inline-flex; }
}
@media (min-width: 960px) {
  .nav { display: block; }
  .menu-toggle, .mobile-menu { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: max(560px, 100svh);
  display: flex;
  align-items: flex-end;
  color: var(--white);
  padding-top: calc(var(--hh) + 32px);
  padding-bottom: clamp(28px, 5vw, 56px);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 960px) {
  .hero { max-height: 980px; min-height: max(520px, min(100svh, 980px)); }
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(13, 23, 40, 0.62) 0%, rgba(13, 23, 40, 0.18) 60%, rgba(13, 23, 40, 0) 100%),
    linear-gradient(180deg, rgba(13, 23, 40, 0.1) 30%, rgba(13, 23, 40, 0.72) 100%);
}
.hero__content { width: 100%; }
.hero__copy { max-width: 860px; }
.hero .h1 { color: var(--white); }
.hero__sub {
  margin-top: 20px;
  font-size: var(--fs-lead);
  color: rgba(253, 252, 250, 0.86);
  max-width: 52ch;
}

/* Widget de búsqueda */
.search {
  margin-top: clamp(28px, 4vw, 44px);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr;
  padding: 6px;
  max-width: 1080px;
}
.search__field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.search__field label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.search__field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 28px 4px 0;
  font-size: 1rem; /* 16px evita el zoom en iOS */
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%23152238' d='M212.24 100.24l-80 80a6 6 0 0 1-8.48 0l-80-80a6 6 0 0 1 8.48-8.48L128 167.51l75.76-75.75a6 6 0 0 1 8.48 8.48Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 16px;
}
.search__field select:focus-visible { outline: none; }
.search__field:focus-within { box-shadow: inset 0 -2px 0 var(--bronze); }
.search__submit { margin: 6px 0 0; min-height: 54px; }
.search__submit .icon { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .search {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: stretch;
  }
  .search__field { border-bottom: 0; border-right: 1px solid var(--line); padding: 12px 22px 10px; }
  .search__field:nth-child(3) { border-right: 0; }
  .search__submit { margin: 0; padding-inline: 28px; min-height: 64px; }
}

/* Ventanas de poca altura (laptops sin pantalla completa) */
@media (min-width: 900px) and (max-height: 820px) {
  :root { --hh: 66px; }
  .hero { padding-top: calc(var(--hh) + 20px); padding-bottom: 28px; }
  .hero__sub { margin-top: 14px; font-size: 1.0625rem; }
  .search { margin-top: 24px; }
  .search__field { padding: 10px 22px 8px; }
  .search__submit { min-height: 56px; }
  .section-head { margin-bottom: 32px; }
}
@media (min-width: 900px) and (max-height: 640px) {
  .hero__sub { font-size: 1rem; max-width: 60ch; }
  .search { margin-top: 18px; }
  .search__field { padding: 8px 20px 6px; }
  .search__submit { min-height: 50px; }
}

@media (max-width: 899px) and (max-height: 740px) {
  .hero { padding-top: calc(var(--hh) + 12px); padding-bottom: 20px; }
  .hero__sub { margin-top: 12px; font-size: 1rem; }
  .search { margin-top: 20px; }
  .search__field { padding: 8px 14px 6px; }
  .search__submit { min-height: 50px; }
}

/* Entrada del hero (carga) */
@media (prefers-reduced-motion: no-preference) and (min-width: 900px) {
  .hero__media img { animation: hero-zoom 1800ms var(--ease-soft) both; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-in { animation: hero-rise 900ms var(--ease-soft) both; animation-delay: calc(var(--i, 0) * 110ms + 150ms); }
}
@keyframes hero-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes hero-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Propiedades
   ========================================================================== */
.listings { position: relative; }

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 28px;
}
.chips {
  /* Móvil: cuadrícula 2x2 a todo el ancho, sin scroll horizontal ni recortes */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
@media (min-width: 640px) {
  .chips { display: flex; flex-wrap: wrap; width: auto; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease,
    transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
@media (max-width: 639px) {
  .chip { justify-content: space-between; width: 100%; min-height: 48px; }
}
.chip__count {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 200ms ease;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip[aria-pressed="true"] .chip__count { color: var(--bronze-light); }
@media (hover: hover) and (pointer: fine) {
  .chip:not([aria-pressed="true"]):hover { border-color: var(--ink); }
}

.results-status { font-size: 0.9375rem; color: var(--muted); }
.results-status strong { color: var(--ink); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.4vw, 32px);
}
@media (min-width: 680px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Tarjeta de propiedad */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: box-shadow 300ms ease, border-color 300ms ease;
}
/* Envoltorio de grilla: aquí vive la animación de filtrado (fade + scale),
   separada del scroll-reveal que anima la tarjeta interior. */
.grid__item {
  display: flex;
  transition: opacity 240ms var(--ease-out), transform 300ms var(--ease-out);
}
.grid__item > .card { width: 100%; }
.grid__item.is-filtered-out { opacity: 0; transform: scale(0.95); pointer-events: none; }
.grid__item[hidden] { display: none; }

.card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease-soft);
}
.badge {
  position: absolute;
  top: 14px; left: 14px;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.badge--venta { background: var(--ink); color: var(--white); }
.badge--renta { background: var(--surface); color: var(--bronze); }
.badge--static { position: static; }

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 22px;
}
.card__price {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bronze);
  font-variant-numeric: lining-nums proportional-nums;
  line-height: 1.1;
}
.price-suffix {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
}
.card__title { margin-top: 10px; }
.card__zone {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.card__zone .icon { width: 17px; height: 17px; color: var(--bronze); }

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.9063rem;
  color: var(--text);
}
.specs li { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.specs .icon { width: 20px; height: 20px; color: var(--muted); }

.card__actions { margin-top: auto; padding-top: 20px; }

@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
  .card:hover .card__media img { transform: scale(1.035); }
}

/* ==========================================================================
   Por qué Vértice
   ========================================================================== */
.why { background: var(--surface-2); }
.why__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(44px, 6vw, 88px);
}
.why__intro .lead { margin-top: 18px; }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
}
.stat { display: flex; flex-direction: column; }
.stat__label { order: 2; }
.stat__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.stat__label {
  display: block;
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.feature {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding-block: 26px;
  border-top: 1px solid var(--line-strong);
}
.feature:first-child { border-top: 0; padding-top: 0; }
.feature__icon {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--bronze-light);
}
.feature__icon .icon { width: 24px; height: 24px; }
.feature p { margin-top: 8px; color: var(--muted); font-size: 0.9688rem; }

@media (min-width: 720px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .feature { grid-template-columns: 1fr; gap: 16px; padding-block: 28px; }
  .feature:nth-child(-n + 2) { border-top: 0; padding-top: 0; }
}
@media (min-width: 1100px) {
  .why__layout { grid-template-columns: 5fr 7fr; align-items: start; }
  .why__intro { position: sticky; top: calc(var(--hh-compact) + 40px); }
}

/* ==========================================================================
   Asesor
   ========================================================================== */
.agent__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.agent__media {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
  max-width: 520px;
}
.agent__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.agent__role {
  margin-top: 10px;
  font-weight: 600;
  color: var(--bronze);
}
.agent__bio { margin-top: 22px; display: grid; gap: 14px; color: var(--muted); max-width: 58ch; }
.credentials {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.credentials li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); font-weight: 500; }
.credentials .icon { width: 22px; height: 22px; color: var(--bronze); margin-top: 1px; }
.agent__contact { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

@media (min-width: 640px) { .credentials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .agent__layout { grid-template-columns: 5fr 6fr; }
  .agent__media { max-width: none; }
}

/* ==========================================================================
   Cómo funciona (timeline)
   ========================================================================== */
.process { background: var(--surface); border-block: 1px solid var(--line); }
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  --dot: 52px;
}
.timeline__track {
  position: absolute;
  left: calc(var(--dot) / 2 - 1px);
  top: calc(var(--dot) / 2);
  bottom: calc(var(--dot) / 2);
  width: 2px;
  background: var(--line);
}
.timeline__progress {
  position: absolute;
  inset: 0;
  background: var(--bronze);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1500ms var(--ease-in-out);
}
.timeline.is-drawn .timeline__progress { transform: none; }

.step {
  position: relative;
  display: grid;
  grid-template-columns: var(--dot) 1fr;
  gap: 20px;
  align-items: start;
}
.step__num {
  position: relative;
  z-index: 1;
  width: var(--dot); height: var(--dot);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition:
    background-color 400ms ease,
    border-color 400ms ease,
    color 400ms ease,
    transform 500ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 360ms + 120ms);
}
.timeline.is-drawn .step__num { background: var(--ink); border-color: var(--ink); color: var(--white); }
.step__body { padding-top: 10px; }
.step__time {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--bronze);
}
.step p { margin-top: 8px; color: var(--muted); font-size: 0.9688rem; max-width: 42ch; }

@media (min-width: 960px) {
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .timeline__track {
    left: calc(var(--dot) / 2);
    right: calc((100% - 96px) / 4 - var(--dot) / 2); /* termina en el centro del último número */
    top: calc(var(--dot) / 2 - 1px);
    bottom: auto;
    width: auto;
    height: 2px;
  }
  .timeline__progress { transform: scaleX(0); transform-origin: left; }
  .step { grid-template-columns: 1fr; gap: 24px; }
  .step__body { padding-top: 0; }
}

/* ==========================================================================
   Testimonios
   ========================================================================== */
.quotes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.quote {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.quote--featured { background: var(--ink); border-color: var(--ink); color: var(--white); }
.stars { display: flex; gap: 3px; color: var(--bronze); }
.quote--featured .stars { color: var(--bronze-light); }
.stars .icon { width: 17px; height: 17px; }
.quote blockquote p {
  font-family: var(--font-quote);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  line-height: 1.38;
  color: var(--ink);
  text-wrap: pretty;
  font-optical-sizing: auto;
}
.quote--featured blockquote p {
  color: var(--white);
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  line-height: 1.28;
}
.quote figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}
.initials {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
}
.quote--featured .initials { background: rgba(253, 252, 250, 0.12); color: var(--white); }
.quote__name { display: block; font-weight: 600; color: var(--ink); line-height: 1.3; }
.quote__meta { display: block; font-size: 0.875rem; color: var(--muted); }
.quote--featured .quote__name { color: var(--white); }
.quote--featured .quote__meta { color: rgba(253, 252, 250, 0.7); }

@media (min-width: 900px) {
  .quotes { grid-template-columns: 7fr 5fr; grid-template-rows: auto auto; gap: 24px; }
  .quote--featured { grid-row: span 2; justify-content: space-between; padding: 48px; }
}

/* ==========================================================================
   Oficina / contacto
   ========================================================================== */
.office__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.office__details {
  display: grid;
  gap: 22px;
  margin-top: 32px;
}
.office__details li { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.office__details .icon { width: 22px; height: 22px; color: var(--bronze); margin-top: 2px; }
.od-label { display: block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.od-value { display: block; color: var(--ink); font-weight: 500; }
.office__details a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.office__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.office__media {
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
}
.office__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; }

@media (min-width: 960px) {
  .office__layout { grid-template-columns: 6fr 5fr; }
}

/* ==========================================================================
   Banda CTA
   ========================================================================== */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--white);
  padding-block: clamp(96px, 12vw, 168px);
}
.cta-band__media { position: absolute; inset: 0; z-index: -2; }
.cta-band__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.cta-band::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(13, 23, 40, 0.88) 0%, rgba(13, 23, 40, 0.62) 50%, rgba(13, 23, 40, 0.2) 100%);
}
.cta-band .h2 { color: var(--white); max-width: 17ch; }
.cta-band p { margin-top: 18px; color: rgba(253, 252, 250, 0.84); max-width: 48ch; font-size: var(--fs-lead); }
.cta-band .btn { margin-top: 32px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--ink-deep);
  color: rgba(253, 252, 250, 0.72);
  padding-top: clamp(56px, 7vw, 88px);
  padding-bottom: 32px;
  font-size: 0.9375rem;
}
.footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(253, 252, 250, 0.12);
}
.site-footer .logo { color: var(--white); }
.site-footer .logo__mark .mark-apex { fill: var(--bronze-light); }
.footer__tagline { margin-top: 18px; max-width: 34ch; }
.footer__col h3 {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 14px;
}
.footer__col li + li { margin-top: 8px; }
.footer__col a { display: inline-block; padding-block: 2px; transition: color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .footer__col a:hover { color: var(--white); } }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 24px;
  font-size: 0.8438rem;
  color: rgba(253, 252, 250, 0.56);
}
@media (min-width: 720px) {
  .footer__top { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ==========================================================================
   Modal de ficha
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(13, 23, 40, 0);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: background-color 280ms ease;
}
/* margin:auto en el panel centra sin recortar el borde superior cuando el panel es más alto que la pantalla */
.modal[open] { display: grid; }
.modal::backdrop { background: transparent; }
.modal.is-open { background: rgba(13, 23, 40, 0.66); }

.modal__panel {
  position: relative;
  margin: auto;
  width: 100%;
  min-height: 100%;
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 280ms var(--ease-out), transform 360ms var(--ease-out);
}
.modal.is-open .modal__panel { opacity: 1; transform: none; }
/* Salida más rápida que la entrada */
.modal.is-closing .modal__panel { transition-duration: 180ms, 200ms; }
.modal.is-closing { transition-duration: 200ms; }

@media (min-width: 900px) {
  .modal { padding: 32px; }
  .modal__panel {
    width: min(1180px, 100%);
    min-height: 0;
    height: min(760px, calc(100dvh - 64px));
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }
}

.modal__close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 3;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: rgba(251, 250, 247, 0.94);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.modal__close:active { transform: scale(0.94); }
.modal__close .icon { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .modal__close:hover { background: #fff; } }

/* Carrusel */
.carousel {
  position: relative;
  overflow: hidden;
  background: var(--ink-deep);
  aspect-ratio: 4 / 3;
  touch-action: pan-y;
  user-select: none;
}
@media (min-width: 900px) { .carousel { aspect-ratio: auto; height: 100%; } }
.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 520ms var(--ease-in-out);
  will-change: transform;
}
.carousel__track.is-dragging { transition: none; }
.carousel__slide { flex: 0 0 100%; height: 100%; margin: 0; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.carousel__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px; height: 46px;
  margin-top: -23px;
  display: grid;
  place-items: center;
  border-radius: var(--r);
  background: rgba(251, 250, 247, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, opacity 200ms ease;
}
.carousel__btn:active { transform: scale(0.94); }
.carousel__btn--prev { left: 14px; }
.carousel__btn--next { right: 14px; }
.carousel__btn .icon { width: 22px; height: 22px; }
@media (hover: hover) and (pointer: fine) { .carousel__btn:hover { background: #fff; } }

.carousel__dots {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 4px;
}
.carousel__dot {
  width: 32px; height: 28px;
  display: grid;
  place-items: center;
}
.carousel__dot span {
  display: block;
  width: 24px; height: 3px;
  border-radius: 2px;
  background: rgba(253, 252, 250, 0.5);
  transform: scaleX(0.4);
  transition: transform 320ms var(--ease-out), background-color 320ms ease;
}
.carousel__dot[aria-current="true"] span { transform: none; background: var(--white); }
.carousel.is-single .carousel__btn,
.carousel.is-single .carousel__dots { display: none; }

/* Info de la ficha */
.modal__info {
  padding: 28px var(--gutter) 36px;
  display: flex;
  flex-direction: column;
}
.modal__info > * { flex-shrink: 0; }
@media (min-width: 900px) {
  .modal__info { padding: 44px 40px 36px; overflow-y: auto; overscroll-behavior: contain; }
}
.modal__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-right: 52px; }
.modal__ref { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.modal__title { margin-top: 16px; font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem); line-height: 1.12; }
.modal__zone { margin-top: 8px; }
.modal__price { margin-top: 20px; font-size: 2rem; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 26px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.spec-grid div { background: var(--surface); padding: 14px 14px 12px; }
.spec-grid .icon { width: 20px; height: 20px; color: var(--bronze); }
.spec-grid dd {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--ink);
  font-variant-numeric: lining-nums proportional-nums;
  line-height: 1.2;
}
.spec-grid dt span { font-size: 0.8125rem; color: var(--muted); line-height: 1.3; }
.spec-grid div { display: flex; flex-direction: column; }
.spec-grid dt { display: contents; }
.spec-grid dt .icon { order: 0; }
.spec-grid dd { order: 1; }
.spec-grid dt span { order: 2; margin-top: 2px; }

.modal__desc { margin-top: 24px; color: var(--muted); }
.modal__features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
  font-size: 0.9375rem;
}
.modal__features li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.modal__features .icon { width: 18px; height: 18px; color: var(--bronze); margin-top: 3px; }
@media (min-width: 480px) { .modal__features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.modal__actions {
  display: grid;
  gap: 10px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.modal__note { font-size: 0.8125rem; color: var(--muted); }

/* ==========================================================================
   Scroll reveal (disparo único, stagger por grupo)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition:
      opacity 800ms var(--ease-soft),
      transform 900ms var(--ease-soft);
    transition-delay: calc(var(--d, 0) * 80ms);
  }
  [data-reveal].is-in { opacity: 1; transform: none; }
}

/* ==========================================================================
   Movimiento reducido: sin desplazamientos, se conservan fundidos cortos
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .grid__item, .card, .card__media img, .carousel__track, .timeline__progress, .step__num,
  .modal__panel, .mobile-menu, .site-header, .btn, .chip {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .grid__item.is-filtered-out { transform: none; }
  .modal__panel { transform: none; }
  .modal.is-open .modal__panel { transition: opacity 150ms ease !important; }
}
