/* Casa Norte — demo del agente inmobiliario de ZENITH
   Paleta tomada de Bogotá: la niebla fría de la mañana, el verde de los cerros y el ladrillo
   a la vista. El ladrillo se reserva para los precios; el verde de WhatsApp, solo para WhatsApp. */

:root {
  --niebla: #EDF0EE;
  --niebla-2: #E1E6E3;
  --blanco: #FBFCFB;
  --eucalipto: #183A33;
  --cerro: #2F5D50;
  --ladrillo: #A84A32;
  --grafito: #1D2421;
  --piedra: #5F6A66;
  --linea: #CBD3CF;

  --wa-verde: #25D366;
  --wa-cabecera: #008069;
  --wa-fondo: #EFEAE2;
  --wa-salida: #D9FDD3;
  --wa-texto: #111B21;
  --wa-meta: #667781;

  --f: 'Bricolage Grotesque', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-foto: 18px;
  --r-control: 12px;
  --sombra-flotante: 0 18px 50px -12px rgba(24, 58, 51, .35);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--niebla); color: var(--grafito);
  font-family: var(--f); font-size: 16px; line-height: 1.55;
  font-optical-sizing: auto; font-variation-settings: 'opsz' 14;
}
/* height:auto es obligatorio: sin él, el atributo height del <img> le gana a aspect-ratio y las
   fotos salían verticales (y en celular la del hero tapaba toda la primera pantalla). */
img { max-width: 100%; height: auto; display: block; }
button, select, textarea, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cerro); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
/* La cabecera es fija: sin esto, al saltar a una sección su título queda debajo de ella */
section[id], footer[id] { scroll-margin-top: 84px; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; color: var(--eucalipto); }
h1 { font-size: clamp(2.5rem, 6.2vw, 5rem); font-variation-settings: 'opsz' 96; letter-spacing: -.035em; line-height: .98; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-variation-settings: 'opsz' 72; }
h3 { font-size: 1.12rem; font-variation-settings: 'opsz' 24; letter-spacing: -.01em; line-height: 1.25; }

/* ─────────── Botones ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.3rem; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn--primary { background: var(--eucalipto); color: var(--blanco); }
.btn--primary:hover { background: var(--cerro); }
.btn--quiet { background: transparent; color: var(--eucalipto); border-color: var(--linea); }
.btn--quiet:hover { border-color: var(--eucalipto); }
.btn--dark { background: var(--eucalipto); color: var(--blanco); }
.btn--dark:hover { background: var(--cerro); }
.btn--light { background: var(--blanco); color: var(--eucalipto); }
.btn--light:hover { background: var(--niebla); }

/* ─────────── Barra del demo ─────────── */
/* Delgada y cerrable: tiene que avisar sin que la página parezca un prototipo. */
.demo-bar {
  position: relative; z-index: 30; display: flex; align-items: center; justify-content: center; gap: .4rem 1.25rem; flex-wrap: wrap;
  padding: .5rem 3rem .5rem var(--gutter); background: #0F2622; color: #C9D6D1; font-size: .84rem; line-height: 1.35; text-align: center;
}
.demo-bar p { margin: 0; }
.demo-bar__pill { display: inline-block; margin-right: .35rem; padding: .1rem .55rem; border-radius: 999px; background: rgba(200, 169, 110, .18); color: #E4CD9E; font-weight: 600; font-size: .78rem; }
.demo-bar__cta { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.demo-bar__close { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #C9D6D1; cursor: pointer; display: grid; place-items: center; }
.demo-bar__close:hover { background: rgba(255, 255, 255, .1); }
.demo-bar__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 600px) { .demo-bar__txt { display: none; } .demo-bar { justify-content: flex-start; text-align: left; } }

/* ─────────── Cabecera ─────────── */
/* Transparente sobre la foto del hero y sólida al bajar, como en los portales grandes del sector. */
.site-header {
  position: fixed; left: 0; right: 0; top: var(--bar-h, 0px); z-index: 20;
  display: flex; align-items: center; gap: 2rem; padding: 1rem var(--gutter);
  color: #fff; background: transparent; border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  top: 0; color: var(--grafito); background: rgba(251, 252, 251, .96);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom-color: var(--niebla-2); box-shadow: 0 6px 24px -18px rgba(24, 58, 51, .5);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand__mark { width: 40px; height: 40px; flex: none; }
.brand__mark rect { fill: var(--eucalipto); }
.brand__mark path { fill: var(--niebla); }
.site-header:not(.is-solid) .brand__mark rect { fill: #fff; }
.site-header:not(.is-solid) .brand__mark path { fill: var(--eucalipto); }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 750; font-size: 1.3rem; letter-spacing: -.03em; font-variation-settings: 'opsz' 36; }
.brand__sub { margin-top: .28rem; font-size: .74rem; font-weight: 500; letter-spacing: .02em; opacity: .75; }
.site-header.is-solid .brand__name { color: var(--eucalipto); }
.site-nav { display: flex; gap: 1.75rem; margin-left: auto; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: .98rem; color: inherit; opacity: .88; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { opacity: 1; border-bottom-color: currentColor; }
.header-chat {
  display: inline-flex; align-items: center; gap: .55rem; padding: .62rem 1.1rem; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .1); color: #fff; font-size: .92rem; font-weight: 600;
}
.header-chat:hover { background: rgba(255, 255, 255, .2); }
.site-header.is-solid .header-chat { border-color: var(--eucalipto); background: var(--eucalipto); color: #fff; }
.site-header.is-solid .header-chat:hover { background: var(--cerro); }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--wa-verde); box-shadow: 0 0 0 3px rgba(37, 211, 102, .25); }
@media (max-width: 960px) { .site-nav { display: none; } .header-chat { margin-left: auto; } }
@media (max-width: 420px) {
  .brand__sub { display: none; }
  .header-chat { font-size: 0; gap: 0; padding: .7rem; }
  .header-chat::after { content: 'Escribir'; font-size: .85rem; margin-left: .45rem; }
}

/* ─────────── Hero ─────────── */
.hero { position: relative; min-height: min(860px, 100svh); display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: var(--eucalipto); }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Degradado desde abajo y la izquierda: el texto se lee sin tapar la foto donde importa */
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 30, 26, .82) 0%, rgba(10, 30, 26, .55) 45%, rgba(10, 30, 26, .1) 80%),
              linear-gradient(0deg, rgba(10, 30, 26, .6) 0%, rgba(10, 30, 26, 0) 45%);
}
.hero__inner { position: relative; z-index: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 150px var(--gutter) clamp(36px, 5vw, 64px); }
.hero__copy { max-width: 40rem; }
.hero__kicker { margin: 0 0 1rem; font-size: 1rem; font-weight: 500; color: #D8E4DF; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
.hero__lead { max-width: 36rem; margin: 1.1rem 0 0; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #E1EAE6; }

.search { margin-top: clamp(26px, 3.5vw, 40px); max-width: 60rem; background: var(--blanco); color: var(--grafito); border-radius: 20px; padding: .55rem .55rem .8rem; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6); }
.search__tabs { display: flex; gap: .25rem; padding: .25rem .25rem .6rem; }
.search__tabs label { cursor: pointer; position: relative; }
.search__tabs input { position: absolute; opacity: 0; pointer-events: none; }
.search__tabs span { display: inline-block; padding: .5rem 1.15rem; border-radius: 999px; font-weight: 600; color: var(--piedra); }
.search__tabs input:checked + span { background: var(--eucalipto); color: #fff; }
.search__tabs input:focus-visible + span { outline: 3px solid var(--cerro); outline-offset: 2px; }
.search__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: .5rem; align-items: stretch; }
.field { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .9rem; border-radius: 14px; background: var(--niebla); border: 1px solid transparent; }
.field:focus-within { border-color: var(--cerro); background: #fff; }
.field__label { font-size: .78rem; font-weight: 600; color: var(--piedra); }
.field select {
  appearance: none; -webkit-appearance: none; border: 0; background-color: transparent; padding: 0 1.2rem 0 0;
  font-weight: 600; font-size: 1rem; color: var(--grafito); cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%232F5D50' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 12px;
}
.btn--search { border-radius: 14px; background: var(--ladrillo); color: #fff; padding: 0 1.6rem; min-height: 58px; font-size: 1rem; }
.btn--search:hover { background: #8F3D28; }
.btn--search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search__chat { display: block; margin: .7rem .6rem 0; border: 0; background: none; padding: 0; color: var(--wa-cabecera); font-weight: 600; font-size: .92rem; cursor: pointer; text-align: left; }
.search__chat:hover { text-decoration: underline; text-underline-offset: 3px; }

.hero__facts { display: flex; flex-wrap: wrap; gap: .75rem 2.75rem; margin: clamp(22px, 3vw, 34px) 0 0; padding: 0; list-style: none; }
.hero__facts li { display: flex; flex-direction: column; }
.hero__facts strong { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; font-variation-settings: 'opsz' 36; }
.hero__facts span { font-size: .88rem; color: #C9D6D1; }

/* La notificación de WhatsApp de un domingo en la noche: el argumento del demo, en una imagen */
.notif {
  position: absolute; z-index: 1; top: 170px; width: 330px;
  right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  display: flex; gap: .7rem; padding: .8rem .9rem; border-radius: 18px; background: rgba(251, 252, 251, .94); color: var(--grafito);
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.notif__icon { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--wa-verde); display: grid; place-items: center; }
.notif__icon svg { width: 24px; height: 24px; fill: #fff; }
.notif__body { display: flex; flex-direction: column; min-width: 0; font-size: .88rem; line-height: 1.35; }
.notif__top { display: flex; justify-content: space-between; gap: .5rem; }
.notif__top span { color: var(--piedra); font-size: .8rem; white-space: nowrap; }
.notif__msg { margin-top: .15rem; }

@media (max-width: 1100px) { .notif { display: none; } }
@media (max-width: 860px) {
  /* En celular el texto va sobre toda la foto, no solo sobre la izquierda: el degradado de
     escritorio dejaba el párrafo blanco encima de la parte clara de la imagen. */
  .hero::after { background: linear-gradient(180deg, rgba(10, 30, 26, .55) 0%, rgba(10, 30, 26, .78) 45%, rgba(10, 30, 26, .88) 100%); }
  .hero { min-height: 0; }
  .hero__inner { padding-top: 120px; }
  .search__fields { grid-template-columns: 1fr 1fr; }
  .btn--search { grid-column: 1 / -1; }
  .hero__facts { gap: .75rem 1.75rem; }
  .hero__facts strong { font-size: 1.15rem; }
}
@media (max-width: 480px) {
  .search__fields { grid-template-columns: 1fr; }
  .hero__facts li:last-child { display: none; }
}


/* ─────────── Listado ─────────── */
.listings { max-width: var(--max); margin: 0 auto; padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(56px, 7vw, 104px); }
.listings__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.tabs { display: inline-flex; padding: 4px; background: var(--niebla-2); border-radius: 999px; }
.tabs button {
  border: 0; background: transparent; padding: .55rem 1.1rem; border-radius: 999px; cursor: pointer;
  font-weight: 600; color: var(--piedra);
}
.tabs button[aria-selected="true"] { background: var(--blanco); color: var(--eucalipto); box-shadow: 0 1px 3px rgba(24, 58, 51, .12); }
.tabs__count { font-variant-numeric: tabular-nums; opacity: .7; }
.listings__status { min-height: 1.5em; margin: 1.1rem 0 1.5rem; color: var(--piedra); }
.listings__status button { border: 0; background: none; padding: 0; color: var(--eucalipto); font-weight: 600; text-decoration: underline; cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.prop { display: flex; flex-direction: column; }
.prop__photo { position: relative; overflow: hidden; border-radius: var(--r-foto); background: var(--niebla-2); }
.prop__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.prop__tag {
  position: absolute; top: 12px; left: 12px; padding: .25rem .65rem; border-radius: 999px;
  background: rgba(251, 252, 251, .94); font-size: .8rem; font-weight: 600; color: var(--eucalipto);
}
.prop__place { margin: .95rem 0 .15rem; font-size: .9rem; color: var(--piedra); }
.prop h3 { margin-bottom: .45rem; }
.prop__price { margin: 0; font-size: 1.45rem; font-weight: 700; color: var(--ladrillo); letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-variation-settings: 'opsz' 36; }
.prop__price small { font-size: .9rem; font-weight: 500; color: var(--piedra); letter-spacing: 0; }
.prop__adm { margin: 0; font-size: .85rem; color: var(--piedra); }
.specs { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: .8rem 0 1rem; padding: 0; list-style: none; font-size: .92rem; color: var(--grafito); }
.specs li { display: inline-flex; align-items: center; gap: .35rem; }
.specs svg { width: 18px; height: 18px; fill: none; stroke: var(--cerro); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.prop__ask {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: .45rem;
  border: 0; background: none; padding: .35rem 0; cursor: pointer; font-weight: 600; color: var(--wa-cabecera);
}
.prop__ask svg { width: 20px; height: 20px; fill: currentColor; }
.prop__ask:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─────────── Funciones del agente ─────────── */
.agent {
  max-width: var(--max); margin: 0 auto; padding: clamp(56px, 7vw, 104px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px);
  border-top: 1px solid var(--linea);
}
.agent__intro { align-self: start; position: sticky; top: 104px; }
.agent__intro p { color: var(--piedra); max-width: 42ch; margin: 1.1rem 0 0; font-size: 1.05rem; }
.agent__intro .btn { margin-top: 1.75rem; }
.skills { list-style: none; margin: 0; padding: 0; }
.skill {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 1rem; align-items: start;
  padding: 1.35rem 0; border-bottom: 1px solid var(--linea);
}
.skill:first-child { padding-top: 0; }
.skill__icon { width: 30px; height: 30px; margin-top: 2px; fill: none; stroke: var(--eucalipto); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.skill p { margin: .35rem 0 0; color: var(--piedra); max-width: 52ch; }
.try {
  align-self: center; border: 1.5px solid var(--eucalipto); background: transparent; color: var(--eucalipto);
  border-radius: 999px; padding: .5rem 1rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.try:hover { background: var(--eucalipto); color: var(--blanco); }

@media (max-width: 860px) {
  .agent { grid-template-columns: 1fr; }
  .agent__intro { position: static; }
  .skill { grid-template-columns: 32px minmax(0, 1fr); }
  .try { grid-column: 2; justify-self: start; margin-top: .2rem; }
}

/* ─────────── Propietarios ─────────── */
.owners {
  max-width: var(--max); margin: 0 auto clamp(56px, 7vw, 104px); display: grid; grid-template-columns: 1fr 1fr;
  background: var(--eucalipto); color: #DCE6E1; border-radius: 28px; overflow: hidden;
  margin-inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}
.owners__img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.owners__text { padding: clamp(28px, 5vw, 64px); align-self: center; }
.owners h2 { color: #fff; }
.owners p { max-width: 42ch; margin: 1rem 0 1.75rem; font-size: 1.05rem; }
@media (max-width: 860px) {
  .owners { grid-template-columns: 1fr; border-radius: 22px; }
  .owners__img { min-height: 0; aspect-ratio: 16 / 9; }
}

/* ─────────── Pie ─────────── */
.site-footer { background: #0F2622; color: #B9C8C2; font-size: .95rem; padding-bottom: 84px; }
.footer-cta {
  max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1.25rem 2rem; padding: clamp(40px, 5vw, 64px) var(--gutter); border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-cta h2 { color: #fff; font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.footer-cta p { margin: .5rem 0 0; color: #B9C8C2; }
.btn--wa { background: var(--wa-verde); color: #0B3D22; padding-inline: 1.5rem; }
.btn--wa:hover { background: #3BE078; }
.btn--wa svg { width: 22px; height: 22px; fill: currentColor; }
.footer-main { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 2rem clamp(24px, 4vw, 56px); padding: clamp(40px, 5vw, 60px) var(--gutter); }
.brand--footer { color: #fff; }
.brand--footer .brand__mark rect { fill: #fff; }
.brand--footer .brand__mark path { fill: #0F2622; }
.footer-brand p { margin: 1rem 0 1.2rem; max-width: 30ch; line-height: 1.55; }
.social { display: flex; gap: .5rem; }
.social__item { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); display: grid; place-items: center; }
.social__item svg { width: 18px; height: 18px; fill: none; stroke: #DCE6E1; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.footer-col h3 { color: #fff; font-size: 1rem; font-variation-settings: 'opsz' 18; margin-bottom: .9rem; letter-spacing: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.footer-col a, .footer-col button { color: #B9C8C2; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.footer-col a:hover, .footer-col button:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-contact li { line-height: 1.5; }
.footer-legal {
  max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.2rem var(--gutter); border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: #8FA39B;
}
.footer-legal p { margin: 0; }
.footer-legal__links { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.footer-zenith {
  max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .6rem 1.5rem; padding: 1rem var(--gutter) 0; font-size: .85rem; color: #8FA39B;
}
.footer-zenith p { margin: 0; max-width: 70ch; }
.footer-zenith a { color: #E4CD9E; }
.footer-zenith__cta { font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .footer-main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-main { grid-template-columns: 1fr; } }


/* ─────────── Lanzador de WhatsApp ─────────── */
.wa-launcher { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: flex-end; gap: .75rem; }
.wa-launcher--oculto { opacity: 0; pointer-events: none; transform: translateY(12px); }
.wa-launcher { transition: opacity .2s ease, transform .2s ease; }
.wa-fab {
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  display: grid; place-items: center; background: var(--wa-verde); color: #fff;
  box-shadow: 0 10px 28px -6px rgba(37, 211, 102, .55), 0 4px 10px rgba(0, 0, 0, .12);
}
.wa-fab svg { width: 34px; height: 34px; fill: #fff; }
.wa-tip {
  margin: 0 0 8px; max-width: 230px; padding: .7rem .9rem; border-radius: 14px 14px 4px 14px;
  background: var(--blanco); color: var(--grafito); font-size: .9rem; line-height: 1.35; box-shadow: var(--sombra-flotante);
}

/* ─────────── Chat ─────────── */
.chat {
  position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; align-items: stretch; gap: 14px; height: min(700px, calc(100dvh - 36px));
}
.wa {
  width: 400px; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: var(--wa-fondo); box-shadow: 0 30px 80px -20px rgba(17, 27, 33, .45);
  color: var(--wa-texto); font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; font-size: 15px;
}
.wa__head { display: flex; align-items: center; gap: .55rem; padding: .6rem .5rem .6rem .9rem; background: var(--wa-cabecera); color: #fff; }
/* Iniciales en vez del logo: el contacto es una persona del equipo, no la marca */
.wa__avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: #DCE6E1; color: var(--eucalipto); font-family: var(--f); font-weight: 700; font-size: .95rem; letter-spacing: .02em;
}
.wa__who { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.25; }
.wa__who strong { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa__who span { font-size: .8rem; opacity: .88; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .22); }
.icon-btn--dark:hover { background: var(--niebla-2); }
.wa__back { display: none; }

/* Fondo con casas y llaves en vez del patrón de WhatsApp: reconocible, pero propio */
.wa__body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 8px;
  background-color: var(--wa-fondo);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d7cfc3' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 30l12-10 12 10v14H14z M22 44v-8h8v8'/%3E%3Ccircle cx='86' cy='26' r='6'/%3E%3Cpath d='M91 30l12 12m-4-4l3-3m-7-1l3-3'/%3E%3Cpath d='M70 86h26v-16l-13-9-13 9z'/%3E%3Cpath d='M18 92c4-8 14-8 18 0'/%3E%3C/g%3E%3C/svg%3E");
}
.day { align-self: center; margin: 4px auto 12px; width: fit-content; padding: .3rem .75rem; border-radius: 8px; background: rgba(255, 255, 255, .92); font-size: .78rem; color: var(--wa-meta); box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.notice { margin: 0 auto 12px; max-width: 92%; padding: .45rem .75rem; border-radius: 8px; background: #FFEECD; color: #54656F; font-size: .8rem; text-align: center; line-height: 1.35; }

.msg { display: flex; margin: 2px 0; }
.msg + .msg--in, .msg--out + .msg--out { margin-top: 2px; }
.msg--in + .msg--out, .msg--out + .msg--in { margin-top: 10px; }
.msg--out { justify-content: flex-end; }
.bubble {
  position: relative; max-width: 82%; padding: .4rem .55rem .35rem .6rem; border-radius: 8px;
  background: #fff; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); line-height: 1.38; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg--out .bubble { background: var(--wa-salida); }
.bubble__text { white-space: normal; }
.bubble__text a { color: #027EB5; }
.bubble__meta { float: right; margin: .35rem 0 -.1rem .7rem; font-size: .7rem; color: var(--wa-meta); display: inline-flex; align-items: center; gap: 3px; line-height: 1; }
.ticks { width: 16px; height: 11px; fill: none; stroke: #8696A0; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ticks.read { stroke: #53BDEB; }

.typing { display: inline-flex; gap: 4px; padding: .55rem .7rem; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696A0; animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6; } }

/* Tarjetas de inmueble dentro del chat */
.cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin: 2px 0 4px; scroll-snap-type: x mandatory; }
.card { flex: 0 0 min(250px, 78%); scroll-snap-align: start; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card__body { padding: .55rem .7rem .3rem; }
.card__price { font-weight: 700; font-size: 1.02rem; color: var(--wa-texto); }
.card__price small { font-weight: 400; color: var(--wa-meta); font-size: .78rem; }
.card__title { margin: .1rem 0; font-size: .86rem; line-height: 1.3; }
.card__specs { font-size: .78rem; color: var(--wa-meta); }
.card__actions { display: flex; border-top: 1px solid #E9EDEF; margin-top: .5rem; }
.card__actions button { flex: 1; border: 0; background: none; padding: .6rem .3rem; color: #027EB5; font-size: .85rem; font-weight: 500; cursor: pointer; }
.card__actions button + button { border-left: 1px solid #E9EDEF; }
.card__actions button:hover { background: #F5F6F6; }

.confirm { margin: 4px 0 6px; max-width: 86%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.confirm__head { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; background: #E7F8EC; color: #0B6B3A; font-weight: 600; font-size: .9rem; }
.confirm__head svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.confirm__body { padding: .55rem .75rem .7rem; font-size: .87rem; line-height: 1.4; }
.confirm__when { font-weight: 600; }
.confirm__body p { margin: .25rem 0 0; color: #54656F; }

.wa__chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 10px 4px; background: var(--wa-fondo); scrollbar-width: none; }
.wa__chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid #D1D7DB; background: #fff; color: var(--wa-cabecera); border-radius: 999px; padding: .38rem .75rem; font-size: .84rem; cursor: pointer; white-space: nowrap; }
.chip:hover { background: #F0F2F5; }

.wa__composer { display: flex; align-items: flex-end; gap: 8px; padding: 6px 10px 10px; background: var(--wa-fondo); }
.wa__composer textarea {
  flex: 1; resize: none; border: 0; border-radius: 22px; padding: .7rem 1rem; max-height: 120px; min-height: 44px;
  background: #fff; line-height: 1.35; font-size: 15px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); font-family: inherit;
}
.wa__composer textarea:focus-visible { outline: 2px solid var(--wa-cabecera); outline-offset: 0; }
.wa__send { width: 46px; height: 46px; flex: none; border: 0; border-radius: 50%; background: var(--wa-cabecera); display: grid; place-items: center; cursor: pointer; }
.wa__send svg { width: 22px; height: 22px; fill: #fff; margin-left: 2px; }
.wa__send:disabled { opacity: .55; cursor: default; }

/* ─────────── Panel del asesor ─────────── */
.crm {
  width: 330px; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: var(--blanco); box-shadow: 0 30px 80px -20px rgba(17, 27, 33, .35); font-size: .92rem;
}
.crm__head { display: flex; align-items: flex-start; gap: .5rem; padding: 1rem 1rem .85rem 1.2rem; border-bottom: 1px solid var(--niebla-2); }
.crm__head h2 { font-size: 1.2rem; font-variation-settings: 'opsz' 24; letter-spacing: -.01em; }
.crm__head p { margin: .15rem 0 0; font-size: .82rem; color: var(--piedra); }
.crm__head .icon-btn { margin-left: auto; color: var(--piedra); }
.crm__body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem 1.4rem; }
.crm__empty { color: var(--piedra); line-height: 1.5; }
.temp { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 999px; font-weight: 600; font-size: .82rem; }
.temp::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.temp--frío { background: #E6ECEF; color: #4A6572; }
.temp--tibio { background: #FBEFD9; color: #95620E; }
.temp--caliente { background: #F7E1DA; color: var(--ladrillo); }
.crm__block { margin-top: 1.1rem; }
.crm__block h3 { font-size: .82rem; font-weight: 600; color: var(--piedra); letter-spacing: 0; margin-bottom: .35rem; font-variation-settings: 'opsz' 14; }
.crm dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; }
.crm dt { color: var(--piedra); }
.crm dd { margin: 0; font-weight: 600; color: var(--grafito); overflow-wrap: anywhere; }
.crm ul { margin: 0; padding-left: 1.1rem; }
.crm li { margin: .2rem 0; }
.crm__first { padding: .6rem .75rem; border-radius: 10px; background: var(--niebla); line-height: 1.4; }
.crm__first strong { color: var(--eucalipto); }
.badge-off { display: inline-block; margin-top: .25rem; padding: .12rem .5rem; border-radius: 999px; background: var(--eucalipto); color: #fff; font-size: .76rem; font-weight: 600; }

/* ─────────── Chat en celular: pantalla completa ─────────── */
@media (max-width: 760px) {
  .chat { inset: 0; right: 0; bottom: 0; height: 100dvh; gap: 0; }
  .wa { width: 100%; border-radius: 0; }
  .wa__back { display: grid; margin-left: -.4rem; }
  .wa__close { display: none; }
  .crm { position: absolute; inset: 0; width: 100%; border-radius: 0; z-index: 2; }
}
