/* Clayton Lux v4 — portada en video y sección 4 (apartamentos) con tarjetas de vidrio. */

/* ---------- Portada en video ---------- */
.portada__foto--video video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; display: block; }
.sello-ref { position: absolute; right: var(--margen); bottom: calc(12% + 18px); z-index: 2; font-size: .72rem; letter-spacing: .08em;
  color: rgba(255,255,255,.82); background: rgba(20,22,20,.38); padding: 5px 10px; border-radius: 999px; }
.galeria figure video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Sección 4 · tokens de las dos versiones ---------- */
.s4 {
  --W: 1448; --H: 1086; --s: 1; --sr: 1; --gut: 24px;
  --f: "Jost", "Helvetica Neue", Arial, sans-serif;
  --tc: 255,255,255; --t1: .14; --bblur: 34px; --bsat: 115%; --cardr: 14px; --hair: .055; --shad: .38;
  --txt: #fff; --txt-55: #92a5be; --lab: #cdd1da; --chip: rgba(255,255,255,.065);
  --acento: #2f6fe8; --acento-ico: #6ea2ee; --acento-hover: #2860cc;
  --seg-borde: #404e63; --seg-on: #404e63; --boton-atras: #071120;
  --s4-mapa-1: #20496e; --s4-mapa-2: #3d739e; --s4-mapa-3: #5d95c2; --s4-mapa-4: #2c5d85; --s4-pin: #dfe9f3;
  --link: #cfdcec; --chip-txt: #dce7f5; --hdr: #eaf1fc; --nota: #9fb4ce;
}
/* Colores de Clayton: Jost, acento dorado de la fachada, vidrio cálido */
.s4[data-estilo="clayton"] {
  --tc: 245,240,230; --t1: .13;
  --txt-55: #d9c7a6; --lab: #e9e1d2; --chip: rgba(245,240,230,.08);
  --acento: #a8834f; --acento-ico: #d2b285; --acento-hover: #8f6e3f;
  --seg-borde: rgba(245,240,230,.38); --seg-on: rgba(168,131,79,.9);
  --s4-mapa-1: #3a3a32; --s4-mapa-2: #6b6252; --s4-mapa-3: #a8834f; --s4-mapa-4: #5a4f48; --s4-pin: #f5f0e6;
  --link: #f0e4cc; --chip-txt: #f5f0e6; --hdr: #f5f0e6; --nota: #e2d3b6;
}

/* ---------- Escenario ---------- */
.s4 { position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; background: #1b1814; color: var(--txt);
  font-family: var(--f); -webkit-font-smoothing: antialiased; isolation: isolate; }
.s4 * { font-family: inherit; }
.s4-ref { position: absolute; left: calc(34px * var(--s)); bottom: calc(170px * var(--s) + 22px); z-index: 3; margin: 0; max-width: 220px; font-size: 10.5px; line-height: 1.4; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.s4-plano { position: absolute; left: 28%; top: 9%; width: 71%; height: 84%;
  object-fit: contain; object-position: 50% 50%; pointer-events: none; transition: opacity .25s ease; }
.s4-plano.cambiando { opacity: 0; }
.s4-oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* ---------- Zonas (coordenadas del lienzo de 1448 × 1086) ---------- */
.s4-main { position: absolute; inset: 0; top: var(--cab, 0px); right: calc((394px + var(--gut)) * var(--sr)); }
.s4-z { position: absolute; zoom: var(--s); pointer-events: none; }
.s4-z > * { pointer-events: auto; }
.s4-ztl { left: 0; top: 0; width: 700px; height: 340px; zoom: calc(var(--s) * 1.3); }
.s4-ztr { right: 0; top: 0; width: 330px; height: 230px; }

.s4-marca { position: absolute; left: 31px; top: 33px; margin: 0; display: flex; align-items: center; gap: 10px; font: 400 16px/19px var(--f); }
.s4-marca svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 1.6; }
.s4-seg { position: absolute; left: 31px; top: 72px; height: 35.5px; display: flex; align-items: center; padding: 1.5px; box-sizing: border-box;
  border-radius: 10px; border: calc(1.5px / 1.3) solid var(--seg-borde); background: rgba(0,0,0,.12); }
.s4-seg button { height: 30.5px; padding: 0 15.4px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: 400 13px/1 var(--f); cursor: pointer;
  transition: color .16s ease, background .16s ease; }
.s4-seg button.on { background: var(--seg-on); border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .s4-seg button:not(.on):hover { background: rgba(255,255,255,.08); } }
.s4-info { position: absolute; left: 31px; top: 136px; margin: 0; display: grid; gap: 12px; }
.s4-info dt { font: 400 14px/19px var(--f); color: var(--lab); }
.s4-info dd { margin: 0; font: 400 16px/22px var(--f); color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.s4-seo { position: absolute; left: 31px; top: 300px; font: 400 12px/1.3 var(--f); color: var(--link); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.s4-seo svg, .s4-viewlink svg { width: 15px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.s4-viewlink { position: absolute; left: 0; top: 32px; font: 400 14.5px/21px var(--f); color: var(--link); text-decoration: none; transition: color .16s ease; }
.s4-viewlink i { font-style: normal; }
@media (hover: hover) and (pointer: fine) { .s4-viewlink:hover, .s4-seo:hover { color: #fff; } }
.s4-mini { position: absolute; left: 110px; top: 30px; width: 162px; height: 172px; margin: 0; display: grid; place-items: center; }
.s4-mini img { max-width: 140px; max-height: 150px; width: auto; height: auto; opacity: .88; transition: opacity .2s ease; }
.s4-mini .br { position: absolute; width: 20px; height: 20px; border: 0 solid rgba(255,255,255,.28); }
.s4-mini .br1 { left: -22px; top: -8px; border-left-width: 1.4px; border-top-width: 1.4px; }
.s4-mini .br2 { right: -22px; top: -8px; border-right-width: 1.4px; border-top-width: 1.4px; }
.s4-mini .br3 { left: -22px; bottom: -8px; border-left-width: 1.4px; border-bottom-width: 1.4px; }
.s4-mini .br4 { right: -22px; bottom: -8px; border-right-width: 1.4px; border-bottom-width: 1.4px; }

.s4-stats { position: absolute; left: calc(34px * var(--s)); bottom: calc(40px * var(--s) + 14px); margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; zoom: var(--s); }
.s4-stats li { width: 70px; height: 34px; box-sizing: border-box; border-radius: 8px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.075); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.s4-stats svg { width: 18px; height: 18px; fill: none; stroke: #dbe6f4; stroke-width: 1.6; }
.s4-stats b { font: 500 13px/1 var(--f); color: #e7eefa; }
.s4-tools { position: absolute; right: calc(22px * var(--s)); bottom: calc(28px * var(--s) + 14px); display: flex; gap: 10px; align-items: flex-end; zoom: var(--s); }
.s4-tool, .s4-card { background: rgba(var(--tc), var(--t1)); backdrop-filter: blur(var(--bblur)) saturate(var(--bsat)); -webkit-backdrop-filter: blur(var(--bblur)) saturate(var(--bsat));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,var(--hair)), 0 22px 54px rgba(3,9,19,var(--shad)); border: 0; }
.s4-tool { width: 78px; height: 58px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  color: #dbe6f4; text-decoration: none; font: 400 11.5px/1 var(--f); transition: background .18s ease; position: relative; overflow: hidden; }
.s4-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
@media (hover: hover) and (pointer: fine) { .s4-tool:hover { background: rgba(var(--tc), .24); } }
.s4-mapa { width: 96px; box-shadow: none; border: 2px solid rgba(255,255,255,.85); justify-content: flex-end; padding-bottom: 6px; box-sizing: border-box; }
.s4-mapa svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.s4-mapa span { position: relative; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* ---------- Riel derecho con las tres tarjetas ---------- */
.s4-rail { position: absolute; top: var(--cab, 0px); bottom: 0; right: calc(var(--gut) * var(--sr)); width: calc(394px * var(--sr)); overflow: hidden; }
.s4-railin { zoom: var(--sr); width: 394px; display: flex; flex-direction: column; padding-top: 25px; }
.s4-card { position: relative; width: 394px; border-radius: var(--cardr); box-sizing: border-box; }
.s4-card h3 { position: absolute; left: 20.5px; top: 19px; margin: 0; font: 500 15.5px/1 var(--f); letter-spacing: -.02em; text-transform: uppercase; color: var(--hdr); }
.s4-rule { position: absolute; left: 20.2px; right: 18px; height: 1px; background: rgba(255,255,255,.255); }
.c1 { height: 285.4px; }
.s4-precio { position: absolute; left: 20.5px; top: 19.9px; margin: 0; font: 400 27.5px/1 var(--f); letter-spacing: -.01em; }
.s4-dir { position: absolute; left: 20.5px; top: 59px; margin: 0; font: 400 15.5px/1 var(--f); color: #fff; opacity: .92; }
.s4-specs > div { position: absolute; top: 109px; display: grid; gap: 11px; }
.s4-specs b { font: 400 24.5px/1 var(--f); }
.s4-specs b.s4-ori { font-size: 17px; line-height: 24.5px; white-space: nowrap; }
.s4-specs span { font: 400 14px/1 var(--f); color: var(--txt-55); }
.s4-vd { position: absolute; top: 102.5px; height: 62.6px; width: 1px; background: rgba(255,255,255,.175); }
.s4-chips { position: absolute; left: 20.5px; right: 18px; top: 180.1px; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 9.7px 9.3px; }
.s4-chips li { height: 36px; border-radius: 8px; background: var(--chip); display: flex; align-items: center; gap: 8px; padding: 0 12px; font: 400 13.5px/1 var(--f); color: var(--chip-txt); }
.s4-chips svg { width: 15px; height: 15px; fill: none; stroke: var(--acento-ico); stroke-width: 1.8; }

.c2 { height: 300px; margin-top: 25.6px; }
.s4-campos { position: absolute; left: 16px; right: 16px; top: 66px; display: grid; grid-template-columns: 104px 1fr 112px; }
.s4-campos > * { display: grid; gap: 9px; padding: 0 11px; border-left: 1px solid rgba(255,255,255,.175); }
.s4-campos .lab { font: 400 13.5px/1 var(--f); color: var(--txt-55); }
.s4-campos b, .s4-campos input, .s4-campos select { font: 400 13.5px/1.2 var(--f); color: #fff; }
.s4-campos input, .s4-campos select { width: 100%; min-width: 0; height: 26px; padding: 0 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 6px;
  background: rgba(0,0,0,.18); color-scheme: dark; box-sizing: border-box; }
.s4-texto { position: absolute; left: 20.5px; right: 20px; top: 136px; margin: 0; font: 400 14.5px/1.45 var(--f); color: var(--lab); }
.s4-botones { position: absolute; left: 16px; right: 16px; top: 205px; display: grid; grid-template-columns: 185.2fr 162.1fr; gap: 13px; }
.s4-btn { height: 40.3px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 7px; font: 500 12.5px/1 var(--f);
  color: #fff; text-decoration: none; transition: background .18s ease; }
.s4-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.s4-btn--pri { background: var(--acento); }
.s4-btn--sec { border: 1px solid rgba(255,255,255,.16); }
@media (hover: hover) and (pointer: fine) { .s4-btn--pri:hover { background: var(--acento-hover); } .s4-btn--sec:hover { background: rgba(255,255,255,.08); } }
.s4-nota { position: absolute; left: 20px; right: 16px; top: 262px; margin: 0; display: flex; align-items: center; gap: 7px; font: 400 12.5px/1 var(--f); color: var(--nota); }
.s4-nota svg { width: 14px; height: 14px; fill: none; stroke: var(--acento-ico); stroke-width: 1.8; flex: none; }

.c3 { height: 421.5px; margin-top: 22.3px; }
.s4-sims { position: absolute; left: 0; right: 0; top: 49.5px; }
.s4-sim { width: 100%; height: 124px; box-sizing: border-box; padding: 21px 20px; display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: transparent; border: 0; border-top: 1px solid rgba(255,255,255,.255); color: #fff; cursor: pointer; transition: background .18s ease; }
.s4-sim img { width: 104px; height: 74px; border-radius: 8px; object-fit: cover; flex: none; background: #ddd; }
.s4-simtxt { display: grid; gap: 4px; }
.s4-simtxt b { font: 500 18px/24px var(--f); }
.s4-simtxt span { font: 400 13.5px/20px var(--f); color: var(--chip-txt); }
.s4-simtxt .m { font: 400 12.5px/18px var(--f); color: var(--txt-55); }
@media (hover: hover) and (pointer: fine) { .s4-sim:hover { background: rgba(255,255,255,.05); } }

.s4 a:focus-visible, .s4 button:focus-visible, .s4 input:focus-visible, .s4 select:focus-visible { outline: 2px solid #7fb0ff; outline-offset: 2px; border-radius: 6px; }

/* ---------- Celular: video arriba libre, tarjetas en carrusel ---------- */
@media (max-width: 640px) {
  .s4 { height: auto; min-height: 100svh; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto auto; padding: 76px 0 96px; --s: .82; --sr: 1; }
  .s4-main { display: contents; }
  .s4-z, .s4-stats, .s4-tools { position: static; zoom: 1; }
  .s4-ztl { grid-row: 1; grid-column: 1 / -1; width: auto; height: auto; padding: 0 16px; display: grid; gap: 12px; }
  .s4-ztl > * { position: static; }
  .s4-seg { overflow-x: auto; width: max-content; max-width: 100%; height: 34px; }
  .s4-seg button { height: 29px; padding: 0 10px; font-size: 12.5px; }
  .s4-info { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
  .s4-info div:last-child { grid-column: 1 / -1; }
  .s4-ztr { display: none; }
  .s4-plano { position: static; grid-row: 2; grid-column: 1 / -1; width: 100%; height: 100%; min-height: 300px; max-height: 48vh; padding: 6px 8px; box-sizing: border-box; }
  .s4-stats { grid-row: 3; grid-column: 2; align-self: end; display: grid; gap: 6px; padding: 0 16px 0 0; margin-bottom: 10px; }
  .s4-tools { grid-row: 3; grid-column: 1; justify-self: start; align-self: end; padding-left: 16px; margin-bottom: 10px; }
  .s4-tools .s4-tool { width: 64px; height: 50px; }
  .s4-tools .s4-mapa { width: 74px; }
  .s4-stats li { width: auto; gap: 7px; padding: 0 9px; }
  .s4-rail { position: static; grid-row: 4; grid-column: 1 / -1; width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .s4-rail::-webkit-scrollbar { display: none; }
  .s4-railin { zoom: var(--sm, .82); flex-direction: row; gap: 12px; padding: 0 16px; width: max-content; align-items: flex-end; }
  .s4-card { scroll-snap-align: center; height: 300px; margin-top: 0 !important; }
  .c3 .s4-sim { height: 83px; padding: 12px 16px; }
  .c3 .s4-sim img { width: 82px; height: 58px; }
  .c3 .s4-simtxt b { font-size: 16px; line-height: 20px; }
  .c3 .s4-simtxt .m { display: none; }
  .s4-ref { left: 50%; transform: translateX(-50%); bottom: 74px; max-width: none; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .s4 *, .s4 *::before, .s4 *::after { transition: none !important; animation: none !important; } }
