:root {
  --ink: #0b111b;
  --text: #f3efe8;
  --muted: #d6d0c6;
  --gold: #c8a15a;
  --gold-strong: #b88a3e;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
}

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

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
svg use, .cats svg, .emblem svg, .btn svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Barra superior ---------- */
.topbar {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 2rem;
  padding: 1.4rem clamp(1rem, 5vw, 5rem);
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark { width: 44px; height: 44px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-weight: 600; letter-spacing: .22em; font-size: 1.05rem; }
.brand-text small { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; gap: 2.5rem; margin-left: auto; margin-right: .5rem; }
.nav a { font-size: .95rem; padding: .3rem 0; border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav a:hover, .nav a[aria-current] { border-color: var(--gold); }

.whatsapp {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .65rem 1.2rem; border-radius: 4px;
  background: rgba(12, 12, 12, .78); border: 1px solid rgba(243, 239, 232, .18); color: #fff; font-size: .88rem; font-weight: 500;
  transition: background .2s;
}
.whatsapp:hover { background: #000; }

.menu { display: grid; gap: 5px; width: 40px; height: 40px; place-content: center; background: none; border: 0; cursor: pointer; }
.menu span { display: block; width: 22px; height: 2px; background: var(--text); }
.whatsapp svg { width: 18px; height: 18px; }

/* ---------- Hero dividido ---------- */
.hero { position: relative; min-height: max(100vh, 680px); overflow: hidden; }

.panel { position: absolute; inset: 0; display: flex; flex-direction: column; }
/* Borde orgánico: mismos puntos que la polyline .divider en index.html */
.panel-left  { clip-path: polygon(0 0, 60% 0, 58% 7%, 59% 13%, 56.5% 21%, 57.5% 29%, 55% 38%, 56% 46%, 53.5% 56%, 54.5% 64%, 51.5% 74%, 52.5% 82%, 49.5% 91%, 50% 100%, 0 100%); }
.panel-right { clip-path: polygon(60% 0, 58% 7%, 59% 13%, 56.5% 21%, 57.5% 29%, 55% 38%, 56% 46%, 53.5% 56%, 54.5% 64%, 51.5% 74%, 52.5% 82%, 49.5% 91%, 50% 100%, 100% 100%, 100% 0); }

.scene { position: absolute; inset: 0; }
.scene svg, .scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Cada foto ocupa solo el ancho visible de su panel, así no se amplía de más */
.panel-left .scene  { right: 39%; }
.panel-right .scene { left: 48%; }
.panel-left .scene img  { object-position: 50% 60%; }
.panel-right .scene img { object-position: 40% 50%; }
.scene::after { content: ""; position: absolute; inset: 0; }
.panel-left .scene::after  { background: linear-gradient(90deg, rgba(8,13,22,.75) 0%, rgba(8,13,22,.25) 55%), linear-gradient(0deg, rgba(8,13,22,.85) 0%, transparent 40%); }
.panel-right .scene::after { background: linear-gradient(270deg, rgba(14,10,6,.15) 0%, rgba(14,10,6,.7) 60%), linear-gradient(0deg, rgba(14,10,6,.85) 0%, transparent 40%); }

.content {
  position: relative; z-index: 1;
  margin-top: 22vh; max-width: 26rem;
}
.panel-left .content  { margin-left: 16%; }
.panel-right .content { margin-left: 61.5%; max-width: 24rem; }

.emblem {
  display: inline-block; width: 48px; height: 48px; margin-bottom: 1rem;
  position: relative; padding-bottom: 6px;
}
.emblem svg { width: 100%; height: 100%; stroke-width: 1.2; }
.emblem::after {
  content: ""; position: absolute; left: 0; bottom: -10px; width: 110px; height: 1px;
  background: linear-gradient(90deg, var(--gold) 0 45%, transparent 45% 62%, var(--gold) 62% 100%);
}

.content h1, .content h2 {
  font-family: var(--serif); font-weight: 700; line-height: 1.02;
  font-size: clamp(2.4rem, 3.6vw, 3.4rem); margin: 1.4rem 0 .9rem;
}
.content p { font-size: 1.05rem; line-height: 1.55; color: var(--muted); max-width: 23rem; }

.btn {
  display: inline-flex; align-items: center; gap: .9rem; margin-top: 1.8rem;
  padding: 1rem 2.6rem; border-radius: 4px;
  font-size: .88rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  transition: background .2s, transform .2s;
}
.btn svg { width: 18px; height: 18px; stroke-width: 1.8; }
.btn:hover { transform: translateY(-2px); }
.btn-green  { background: #2c4424; border: 1px solid #8a9a5b; }
.btn-green:hover  { background: #36532c; }
.btn-bronze { background: #6e4a22; border: 1px solid var(--gold); }
.btn-bronze:hover { background: #835a2b; }

/* Categorías */
.cats {
  position: relative; z-index: 1; list-style: none;
  display: flex; margin-top: auto; margin-bottom: 6vh;
}
.panel-left .cats  { margin-left: 3%; width: 42%; }
.panel-right .cats { margin-left: 53%; width: 45%; }
.cats li { flex: 1; }
.cats li + li { border-left: 1px solid rgba(243, 239, 232, .15); }
.cats span {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  padding: .4rem .3rem; font-size: .9rem; text-align: center; transition: color .2s;
}
.cats svg { width: 30px; height: 30px; }
.cats span { cursor: default; }

.divider { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.divider polyline { fill: none; stroke: rgba(0, 0, 0, .55); stroke-width: 6; stroke-linejoin: round; filter: blur(2px); }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1180px) {
  .nav { gap: 1.6rem; padding-right: 0; }
  .cats span { font-size: .78rem; }
  .cats svg { width: 26px; height: 26px; }
}

/* ---------- Móvil: paneles apilados ---------- */
@media (max-width: 860px) {
  .topbar { position: relative; background: var(--ink); padding: 1rem; gap: 1rem; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: center; gap: 1.8rem; margin: 0; }
  .whatsapp { margin-left: auto; padding: .55rem .9rem; font-size: .8rem; }
  .brand-mark { width: 36px; height: 36px; }

  .hero { min-height: 0; }
  .panel { position: relative; clip-path: none; min-height: 88vh; padding: 0 1rem; }
  .panel-left { border-bottom: 2px solid var(--gold); }
  .panel-left .content, .panel-right .content { margin: 12vh 0 0; max-width: none; }
  .panel-right .scene::after { background: linear-gradient(0deg, rgba(14,10,6,.9) 0%, rgba(14,10,6,.45) 60%); }
  .panel-left .cats, .panel-right .cats { margin: auto 0 2rem; width: 100%; flex-wrap: wrap; row-gap: 1.2rem; }
  .cats li { flex: 1 0 33%; }
  .cats li + li { border-left: 0; }
  .divider { display: none; }
  .panel-left .scene, .panel-right .scene { left: 0; right: 0; }

  .menu { order: 2; }
  .nav { display: none; }
  .menu-open .nav { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: .5rem 0 1rem; }
}

@media (max-width: 480px) {
  .topbar { flex-wrap: nowrap; }
  .brand-text small { display: none; }
  .whatsapp { font-size: 0; gap: 0; padding: .55rem; }
  .menu-open .topbar { flex-wrap: wrap; }
}

/* ---------- Páginas internas (próximamente) ---------- */
.soon { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 7rem 1rem 3rem; text-align: center; }
.soon .scene { inset: 0; }
.soon .scene::after { background: rgba(8, 10, 14, .62); }
.soon-box { position: relative; z-index: 1; max-width: 34rem; display: flex; flex-direction: column; align-items: center; }
.soon-box h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.05; margin: .4rem 0 1rem; }
.soon-box .kicker { font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.soon-box p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.soon-box .back { margin-top: 1.4rem; font-size: .9rem; color: var(--muted); border-bottom: 1px solid transparent; }
.soon-box .back:hover { color: var(--text); border-color: var(--gold); }

/* ---------- Catálogo de casas ---------- */
.cat-hero { position: relative; min-height: 52vh; display: flex; align-items: flex-end; padding: 8rem clamp(1rem, 5vw, 5rem) 3rem; }
.cat-hero .scene::after { background: linear-gradient(0deg, rgba(11,17,27,1) 0%, rgba(11,17,27,.55) 55%, rgba(11,17,27,.4) 100%); }
.cat-hero-box { position: relative; z-index: 1; max-width: 40rem; }
.cat-hero .kicker { font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.cat-hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; margin: .4rem 0 .8rem; }
.cat-hero p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

.catalogo { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 4rem; }

.tarifas { display: grid; grid-template-columns: auto 1fr; gap: 1rem 2.5rem; align-items: center; padding: 1.5rem 1.8rem; border: 1px solid rgba(200,161,90,.35); border-radius: 8px; background: #121a26; }
.tarifas div { display: flex; flex-direction: column; }
.tarifas span { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.tarifas strong { font-family: var(--serif); font-size: 2rem; line-height: 1.1; }
.tarifas small { color: var(--muted); font-size: .8rem; }
.tarifas ul { list-style: none; color: var(--muted); font-size: .88rem; line-height: 1.7; border-left: 1px solid rgba(243,239,232,.12); padding-left: 2rem; }
.tarifas li::before { content: "✓ "; color: var(--gold); }

.filtros { display: flex; flex-wrap: wrap; gap: .6rem; margin: 2.2rem 0 1.6rem; }
.chip { font: inherit; font-size: .88rem; color: var(--text); background: transparent; border: 1px solid rgba(243,239,232,.25); border-radius: 999px; padding: .5rem 1.1rem; cursor: pointer; transition: background .2s, border-color .2s; }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a1208; font-weight: 600; }

.modelos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.6rem; }
.modelo { display: flex; flex-direction: column; background: #121a26; border: 1px solid rgba(243,239,232,.08); border-radius: 10px; overflow: hidden; }
.modelo[hidden] { display: none; }

.modelo-media { position: relative; aspect-ratio: 4 / 3; background: #fff; }
.modelo-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.modelo-media .planta { object-fit: contain; padding: .6rem; opacity: 0; }
.modelo-media.show-plan .planta { opacity: 1; }
.modelo-media.show-plan img:not(.planta) { opacity: 0; }
.m2 { position: absolute; top: .8rem; left: .8rem; background: #2c4424; color: #fff; font-weight: 600; font-size: .85rem; padding: .35rem .7rem; border-radius: 4px; }
.ver-planta { position: absolute; right: .8rem; bottom: .8rem; font: inherit; font-size: .8rem; font-weight: 500; color: #fff; background: rgba(12,12,12,.78); border: 1px solid rgba(243,239,232,.25); border-radius: 4px; padding: .45rem .8rem; cursor: pointer; }
.ver-planta:hover { background: #000; }

.modelo-body { display: flex; flex-direction: column; flex: 1; padding: 1.3rem 1.4rem 1.5rem; }
.modelo h3 { font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; margin-bottom: .8rem; }
.ficha { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; font-size: .86rem; margin-bottom: .9rem; }
.ficha dt { color: var(--gold); }
.ficha dd { color: var(--muted); }
.detalles { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.detalles li { font-size: .78rem; color: var(--text); background: rgba(243,239,232,.07); border-radius: 4px; padding: .3rem .55rem; }
.precios { display: grid; gap: .8rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(243,239,232,.1); }
.precios div { display: flex; flex-direction: column; }
.precios span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.precios strong { font-size: 1.15rem; font-weight: 600; }
.precios strong { color: var(--gold); font-size: 1.4rem; }
.modelo .btn { margin-top: 1.2rem; justify-content: center; padding: .85rem 1.2rem; }

.nota { margin-top: 2rem; text-align: center; font-size: .82rem; color: var(--muted); }
.nota + .nota { margin-top: .6rem; }
.catalogo .back { color: var(--muted); }
.catalogo .back:hover { color: var(--text); }

@media (max-width: 860px) {
  .cat-hero { padding-top: 3rem; min-height: 40vh; }
  .tarifas { grid-template-columns: 1fr; }
  .tarifas ul { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid rgba(243,239,232,.12); padding-top: .8rem; }
}
@media (max-width: 420px) {
  .modelos { grid-template-columns: 1fr; }
  .tarifas strong { font-size: 1.5rem; }
}

/* ---------- Propiedades (corretaje) ---------- */
.prop { display: flex; flex-direction: column; background: #121a26; border: 1px solid rgba(243,239,232,.08); border-radius: 10px; overflow: hidden; }
.prop[hidden] { display: none; }
.prop-media { position: relative; display: block; aspect-ratio: 4 / 3; border: 0; padding: 0; cursor: pointer; background: #0b111b; }
.prop-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.prop-media:hover img { transform: scale(1.03); }
.prop-fotos { position: absolute; right: .8rem; bottom: .8rem; font-size: .78rem; color: #fff; background: rgba(12,12,12,.75); border-radius: 4px; padding: .35rem .65rem; }
.prop-estado { position: absolute; top: .8rem; right: .8rem; font-size: .8rem; font-weight: 600; color: #1a1208; background: var(--gold); border-radius: 4px; padding: .35rem .7rem; }
.prop-codigo { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: .4rem; }
.prop h3 { font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; margin-bottom: .9rem; }
.prop .precios small, .ficha-precio span { color: var(--muted); font-size: .8rem; }
.prop .btn { margin-top: 1.2rem; justify-content: center; padding: .85rem 1.2rem; border: 1px solid #8a9a5b; font: inherit; font-size: .88rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text); cursor: pointer; }
.catalogo .nota a:not(.back) { color: var(--gold); border-bottom: 1px solid currentColor; }

.ficha-prop { width: min(980px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); margin: auto; padding: 0; border: 1px solid rgba(243,239,232,.12); border-radius: 12px; background: #121a26; color: var(--text); overflow: auto; }
.ficha-prop::backdrop { background: rgba(5,8,12,.82); }
.ficha-cerrar { position: absolute; top: .7rem; right: .7rem; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(12,12,12,.75); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.galeria { position: relative; aspect-ratio: 16 / 10; background: #05080c; }
.galeria-principal { width: 100%; height: 100%; object-fit: contain; }
.galeria-nav { position: absolute; top: 50%; translate: 0 -50%; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(12,12,12,.7); color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.galeria-nav:hover, .ficha-cerrar:hover { background: #000; }
.galeria-nav.prev { left: .8rem; } .galeria-nav.next { right: .8rem; }
.galeria-contador { position: absolute; left: .8rem; bottom: .8rem; font-size: .8rem; background: rgba(12,12,12,.75); border-radius: 4px; padding: .3rem .6rem; }
.galeria-minis { display: flex; gap: .5rem; padding: .7rem; overflow-x: auto; background: #0b111b; }
.galeria-minis button { flex: 0 0 96px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; cursor: pointer; background: none; opacity: .6; }
.galeria-minis button[aria-current] { border-color: var(--gold); opacity: 1; }
.galeria-minis img { width: 100%; height: 100%; object-fit: cover; }
.ficha-body { padding: 1.6rem clamp(1.2rem, 4vw, 2.4rem) 2rem; }
.ficha-body h2 { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.1; margin: .3rem 0 .8rem; }
.ficha-precio { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.ficha-precio strong { font-size: 1.7rem; color: var(--gold); }
.ficha-body p { color: var(--muted); line-height: 1.7; margin: 1rem 0; }
.destacados { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem 1.5rem; }
.destacados li { line-height: 1.5; padding-left: 1.4rem; position: relative; }
.destacados li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); }
.ficha-body .btn { margin-top: 1.2rem; }
@media (max-width: 600px) { .galeria { aspect-ratio: 4 / 3; } .ficha-prop { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; } }

/* Videos en la galería */
.galeria-escena { position: absolute; inset: 0; }
video.galeria-principal { display: block; background: #05080c; }
.galeria-minis button { position: relative; }
.galeria-minis .es-video::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.3rem; background: rgba(0,0,0,.35); text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* Venta + arriendo */
.prop .precios { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.prop .precios div + div strong { color: var(--text); }
.ficha-precios { display: flex; flex-wrap: wrap; gap: .8rem 2.5rem; margin-bottom: 1rem; }
.ficha-precios .ficha-precio { flex-direction: column; align-items: flex-start; gap: .1rem; margin: 0; }
.ficha-precios .ficha-precio span:first-child { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ficha-precios .ficha-precio + .ficha-precio strong { color: var(--text); }
.chip-arriendo { border-color: rgba(200,161,90,.6); }

/* Enlace a la otra sección (venta / arriendo) */
.prop-otra { display: inline-block; margin-top: .9rem; font-size: .85rem; color: var(--gold); border-bottom: 1px solid transparent; }
.prop-otra:hover { border-color: currentColor; }
.prop .prop-otra { align-self: flex-start; }

/* Legibilidad del texto sobre fotos claras */
.content h1, .content h2, .content p, .cats span { text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 2px 18px rgba(0,0,0,.45); }
