/* Tokens importados de references/tokens.json */
:root {
  --ivory: #F7F3E9; --forest: #15382C; --ink: #26382F; --muted: #59685F;
  --line: #DADDD1; --white: #FFFCF4; --dark: #10271F;
  --serif: Georgia, "Iowan Old Style", "DejaVu Serif", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "DejaVu Sans", Roboto, sans-serif;
  /* margen lateral: 17px a 318, ~21px a 390 */
  --m: clamp(16px, 5.35vw, 22px);
  --r-ctl: 12px; --r-panel: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); line-height: 1.35; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #2f8a62; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App móvil ---------- */
.app { max-width: 480px; margin: 0 auto; background: var(--white); min-height: 100dvh; position: relative; overflow-x: hidden; }
@media (min-width: 700px) { body { background: var(--ivory); } .app { box-shadow: 0 0 0 1px var(--line); } }
.view { display: none; min-height: 100dvh; flex-direction: column; }
.view.on { display: flex; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--m); height: 49px; flex: none;
  font-weight: 800; font-size: 11px; letter-spacing: .02em; color: var(--forest); background: var(--white); text-transform: uppercase; }
.top .vip { margin-right: 22%; }
.top .back { all: unset; cursor: pointer; margin-right: 8px; font-size: 16px; }
.top .brand { display: flex; align-items: center; gap: 6px; }

.eyebrow { font-size: 11px; color: var(--muted); margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; letter-spacing: -.005em; }
.btn { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 46px; border: 0; border-radius: var(--r-ctl);
  padding: 0 15px; background: var(--forest); color: #fff; font-weight: 800; font-size: 13.5px; text-align: left; }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--forest); border: 1px solid var(--forest); }
.link { all: unset; cursor: pointer; color: var(--forest); font-weight: 800; font-size: 13px; display: inline-block; padding: 8px 0; }
.link:focus-visible { outline: 3px solid #2f8a62; outline-offset: 2px; }

/* chips */
.chips { display: flex; gap: 6px; padding: 0 var(--m); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 30px; padding: 0 9px; border-radius: 10px; border: 1px solid var(--line); background: #F4F1E6; color: var(--forest);
  font-weight: 800; font-size: 11.5px; white-space: nowrap; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ---------- Vista 1: Propiedad ---------- */
.v-prop .photo { aspect-ratio: 318 / 336; width: 100%; flex: none; background: #bda88c url(/vip/assets/fachada.webp) center/cover; display: block; border: 0; padding: 0; }
.v-prop .info { padding: clamp(22px, 8vw, 30px) calc(var(--m) + 1px) 0; }
.v-prop h1 { font-size: clamp(22px, 7vw, 26px); margin-top: 7px; }
.price { font-weight: 800; font-size: clamp(18px, 5.8vw, 21px); color: var(--forest); margin: 8px 0 0; }
.v-prop .acts { padding: clamp(24px, 8vw, 36px) calc(var(--m) + 1px) 0; }
.v-prop .acts .link { margin-top: 18px; }
.demo-note { padding: 18px calc(var(--m) + 1px) 24px; font-size: 11px; color: var(--muted); margin-top: auto; }

/* ---------- Vista 2: Explorar ambientes ---------- */
.v-rec { background: var(--white); }
.amb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px var(--m) 12px; }
.v-rec h2 { font-size: clamp(21px, 6.6vw, 25px); padding: 0; }
.seg { display: flex; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #F4F1E6; }
.seg button { border: 0; background: transparent; min-height: 30px; padding: 0 9px; font-weight: 800; font-size: 11px; color: var(--forest); }
.seg button[aria-pressed="true"] { background: var(--forest); color: #fff; }
.viewer { position: relative; flex: 1; min-height: 340px; margin-top: 14px; background: #2a2f2b; overflow: hidden; touch-action: pan-y; }
.hero { position: absolute; inset: 0; margin: 0; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .25s; }
.hero img.fade { opacity: 0; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 38%; background: linear-gradient(to top, rgba(16,39,31,.78), rgba(16,39,31,0)); pointer-events: none; }
.hero figcaption { position: absolute; left: var(--m); right: var(--m); bottom: 16px; z-index: 1; color: #fff; display: grid; gap: 2px; }
.hero figcaption b { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 7vw, 28px); letter-spacing: -.005em; }
.hero figcaption span { font-size: 11px; opacity: .85; }
.hero .next { position: absolute; right: 12px; bottom: 14px; z-index: 2; min-height: 34px; padding: 0 12px; border: 1px solid rgba(255,255,255,.7); border-radius: 12px; background: rgba(16,39,31,.55); color: #fff; font-weight: 800; font-size: 12px; backdrop-filter: blur(4px); }
.stage { position: absolute; inset: 0; background: #cfe0e8 url(/vip/assets/casa-3d.webp) center/cover; overflow: hidden; touch-action: none; margin: 0; }
.stage[hidden] { display: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.static canvas { visibility: hidden; }
.stage .floors { position: absolute; left: 0; right: 0; top: 10px; z-index: 2; }
.stage .floors .chip { background: rgba(255,252,244,.92); backdrop-filter: blur(4px); }
.stage .floors .chip[aria-pressed="true"] { background: var(--forest); }
.v-rec .cap { padding: 15px var(--m) 0; }
.cap .t { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.cap .h { font-size: 11px; color: var(--muted); margin: 0; }
.v-rec .foot { padding: 20px var(--m) 36px; }
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(16,39,31,.92); display: grid; place-content: center; padding: 16px; gap: 10px; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 78dvh; border-radius: 12px; }
.lb p { color: #fff; font-size: 12px; margin: 0; text-align: center; }
.lbx { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(255,255,255,.15); color: #fff; font-size: 24px; }
/* ---------- Vista 3: Barrio ---------- */
.v-bar h2 { font-size: clamp(20px, 6.6vw, 25px); padding: 8px var(--m) 14px; }
.map { position: relative; margin-top: 15px; width: 100%; aspect-ratio: 318 / 302; overflow: hidden; background: #cfd8c2; flex: none; }
.map .scene { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 385 / 464; transform: translateY(-50%); background: url(/vip/assets/barrio.webp) center/100% 100% no-repeat; }
@media (min-width: 700px) { .map { aspect-ratio: 480 / 400; } }
.pin { position: absolute; transform: translate(-50%, -50%); border: 0; background: transparent; padding: 0; width: 44px; height: 44px; border-radius: 50%; }
.pin::before { content: ""; position: absolute; inset: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(21,56,44,.0); box-shadow: 0 0 0 0 rgba(255,236,150,.0); transition: all .25s; }
.pin.on::before { inset: 11px; border-color: #fff; background: var(--forest); box-shadow: 0 0 0 4px rgba(255,236,150,.85), 0 2px 8px rgba(0,0,0,.35); }
.pin .tag { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); white-space: nowrap; background: var(--forest); color: #fff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 9px; display: none; }
.pin.on .tag { display: block; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene .zone { opacity: 0; transition: opacity .3s; }
.scene .zone.on { opacity: 1; }
.v-bar .panel { margin: 19px var(--m) 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 16px; background: #F4F1E6; }
.panel h3 { font-family: var(--serif); font-weight: 700; font-size: 15px; margin: 0 0 7px; }
.panel p { margin: 0 0 4px; font-size: 11.5px; }
.panel p.s { font-size: 10.5px; color: var(--muted); }
.panel ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.panel li { font-size: 11.5px; padding-top: 6px; border-top: 1px solid var(--line); }
.panel li b { color: var(--forest); }
.badge { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--white); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.badge.dash { border-style: dashed; }
.v-bar .cta { padding: 28px var(--m) 20px; }
.otra { margin: 4px var(--m) 36px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--white); }
.otra h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.otra .row { display: flex; gap: 12px; align-items: center; }
.otra .thumb { width: 64px; height: 64px; border-radius: 12px; background: url(/vip/assets/casa-3d.webp) 30% 40%/cover; flex: none; }
.otra .n { font-family: var(--serif); font-size: 16px; margin: 0; }
.otra .pr { font-size: 12.5px; font-weight: 800; color: var(--forest); margin: 2px 0 0; }
.cmp { margin-top: 10px; font-size: 11.5px; }
.cmp table { width: 100%; border-collapse: collapse; }
.cmp th, .cmp td { text-align: left; padding: 5px 4px; border-top: 1px solid var(--line); font-weight: 400; vertical-align: top; }
.cmp th { color: var(--muted); font-size: 10.5px; width: 34%; }

/* ---------- Hoja inferior ---------- */
.scrim { position: fixed; inset: 0; background: rgba(16,39,31,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; transform: translate(-50%, 105%); transition: transform .28s ease;
  background: var(--white); border-radius: var(--r-panel) var(--r-panel) 0 0; z-index: 21; padding: 10px var(--m) 24px; box-shadow: 0 -10px 40px rgba(0,0,0,.2); visibility: hidden; }
.sheet.on { transform: translate(-50%, 0); visibility: visible; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 22px; }
.sheet .lead { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.sheet .x { position: absolute; right: 10px; top: 14px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 22px; color: var(--muted); }
.f { display: block; margin: 0 0 11px; }
.f > span { display: block; font-size: 11px; font-weight: 800; color: var(--forest); margin-bottom: 4px; }
.f input[type=text], .f input[type=tel], .f select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: #fff; padding: 0 12px; font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 12px; }
legend { font-size: 11px; font-weight: 800; color: var(--forest); padding: 0 4px; }
.chk { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; padding: 5px 0; min-height: 32px; }
.chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); flex: none; }
.sub { margin: 0 0 6px 30px; }
.sub select { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; padding: 0 8px; background: #fff; }
.err { color: #9b2c1f; font-size: 12px; min-height: 16px; margin: 0 0 8px; }
.ok-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-size: 24px; margin: 6px 0 12px; }
.sum { margin: 12px 0 18px; padding: 12px; border-radius: 14px; background: #F4F1E6; font-size: 12.5px; }
.sum dt { font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; margin-top: 7px; }
.sum dt:first-child { margin-top: 0; }
.sum dd { margin: 1px 0 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 9px 14px; border-radius: 12px; font-size: 12px; z-index: 40; max-width: 90vw; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Inicio /vip ---------- */
.home { max-width: 720px; margin: 0 auto; padding: 28px var(--m) 60px; }
.home h1 { font-size: clamp(26px, 6vw, 38px); color: var(--forest); margin: 8px 0 4px; }
.home .sub2 { color: var(--muted); margin: 0 0 24px; }
.home .card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; margin-bottom: 16px; }
.home .card h2 { font-size: 20px; margin-bottom: 6px; }
.home .qr { width: 160px; height: 160px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.home a.l { color: var(--forest); font-weight: 800; word-break: break-all; }
.home .grid { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.kick { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--forest); }
@media (max-width: 359px) { .two { grid-template-columns: 1fr; gap: 0; } }


.amb-head { padding: 6px var(--m) 12px; }
.v-rec .cap { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mini { flex: none; min-height: 34px; padding: 0 11px; border: 1px solid var(--forest); border-radius: 12px; background: transparent; color: var(--forest); font-weight: 800; font-size: 11.5px; }

.hero .play { position: absolute; left: var(--m); top: 14px; z-index: 2; min-height: 36px; padding: 0 13px; border: 1px solid rgba(255,255,255,.75); border-radius: 12px; background: rgba(16,39,31,.62); color: #fff; font-weight: 800; font-size: 12px; backdrop-filter: blur(4px); }
.lb video { max-width: 100%; max-height: 78dvh; border-radius: 12px; background: #000; }
.lb video[hidden] { display: none; }
