/* Masasavi · Bienes Raíces — estilos del sitio público (basados en www.masasavi.cl) */
:root {
  --navy: #0c2742; --bg: #f4f6f8; --surface: #fff; --ink: #112a46; --muted: #5b6b7c; --line: #dde3ea;
  --brass: #b8861b; --brass-d: #8f6612; --gold: #e0b04a; --wa: #1f9d55; --r: 10px;
  --head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1a2a; --surface: #13243a; --ink: #eaf0f6; --muted: #9fb0c2; --line: #25384f; --brass: #e0b04a; --brass-d: #f0c669; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 1rem/1.55 var(--body); background: var(--bg); color: var(--ink); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; }
img:not([src]) { visibility: hidden; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- indicadores del día */
.indbar { background: #08192c; color: #dbe6f2; font-size: .8rem; }
.indbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; padding-top: 7px; padding-bottom: 7px; }
.ind { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.ind b { font-weight: 600; letter-spacing: .06em; color: var(--gold); font-size: .72rem; }
.ind strong { font-weight: 600; color: #fff; }
.ind small { opacity: .7; font-size: .74rem; }
.indnote { margin-left: auto; opacity: .65; font-size: .72rem; }
.indnote a { text-decoration: none; }

/* ---------- encabezado (no fijo) */
header.top { background: var(--navy); color: #fff; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 104px; padding-top: 10px; padding-bottom: 10px; }
.logo { font: 700 1.7rem var(--head); text-decoration: none; letter-spacing: .2px; }
.logo img { height: 80px; width: auto; display: block; }
.logo-text span { color: var(--gold); }
.hcontact { display: flex; align-items: center; gap: 28px; }
.contact { font-size: .9rem; line-height: 1.4; }
.contact h2 { font: 600 .72rem var(--body); letter-spacing: .16em; color: var(--gold); margin: 0 0 4px; }
.contact a, .contact > span { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding: 1px 0; }
.contact a:hover span { text-decoration: underline; }
.contact svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: var(--gold); }
.wabtn { display: inline-flex; align-items: center; gap: 8px; background: var(--wa); color: #fff; border-radius: 99px; padding: 11px 18px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wabtn:hover { filter: brightness(1.1); }
.wabtn svg, .btn.wa svg, .wafab svg { width: 20px; height: 20px; flex: none; }

/* ---------- portada */
.hero { background: var(--navy); line-height: 0; }
.hero img { display: block; width: 100%; height: auto; max-height: 700px; object-fit: cover; object-position: left center; }

/* ---------- filtros */
.filters { position: relative; z-index: 2; margin-top: -34px; background: var(--surface); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); box-shadow: 0 10px 30px rgba(10, 30, 60, .18); }
label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; width: 100%; }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.btn { font: 600 1rem var(--body); border: 0; border-radius: 8px; padding: 12px 18px; cursor: pointer; background: var(--brass); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.btn:hover { background: var(--brass-d); }
.btn:disabled { opacity: .7; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--brass); background: var(--surface); }
.btn.wa { background: var(--wa); }
.btn.wa:hover { filter: brightness(1.08); }

/* ---------- listado */
.count { margin: 28px 0 14px; color: var(--muted); }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--brass); box-shadow: 0 8px 22px rgba(12, 39, 66, .1); }
.card-main { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.card-main:focus-visible { outline: 3px solid var(--brass); outline-offset: -3px; }
.ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #1c3a5e, #112a46); position: relative; display: grid; place-items: center; color: #7f9bbb; font: 700 1.1rem var(--head); overflow: hidden; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .ph img { transform: scale(1.03); }
.tag { position: absolute; left: 10px; top: 10px; background: #fff; color: #112a46; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; z-index: 1; }
.tag.dest { left: auto; right: 10px; background: var(--brass); color: #fff; }
.tag.rent { left: auto; right: 10px; background: #c0392b; color: #fff; }
.tag.dest + .tag.rent { top: 40px; }
.cb { padding: 14px 16px 16px; display: grid; gap: 6px; }
.cb h3 { font-size: 1.08rem; }
.meta { color: var(--muted); font-size: .9rem; }
.plabel { font: 600 .7rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--brass-d); margin-top: 6px; }

/* precio en UF + equivalente en pesos, lado a lado */
.prices { display: flex; align-items: stretch; flex-wrap: wrap; gap: 6px 14px; }
.price { font: 700 1.75rem/1.1 var(--head); color: var(--ink); display: flex; align-items: baseline; gap: 6px; }
.price .u { font-size: .95rem; font-weight: 700; color: var(--brass-d); letter-spacing: .04em; }
.clp { display: flex; flex-direction: column; justify-content: center; padding: 2px 0 2px 14px; border-left: 2px solid var(--line); line-height: 1.2; }
.clp strong { font: 600 1rem var(--body); color: var(--ink); }
.clp small { font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
.card-dl { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--bg); color: var(--ink); font: 600 .84rem var(--body); text-decoration: none; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--brass); background: var(--surface); }
.chip i { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; }
.chip i svg { width: 13px; height: 13px; stroke-width: 2.2; }
.chip.wa i { background: var(--wa); color: #fff; }
.chip.wa i svg { width: 14px; height: 14px; }
.empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 36px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 14px; }
.skel { height: 420px; border-radius: var(--r); background: linear-gradient(100deg, var(--line) 30%, var(--surface) 50%, var(--line) 70%) 0 0 / 300% 100%; animation: sh 1.4s linear infinite; }
@keyframes sh { to { background-position: -150% 0; } }

/* ---------- quiénes somos */
.about { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; }
.about-in { display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; align-items: start; }
.eyebrow { display: inline-block; font: 600 .75rem var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin-bottom: 8px; }
.about h2 { font-size: 1.8rem; }
.about p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* ---------- ficha de propiedad (página) */
.detail { padding-top: 22px; padding-bottom: 56px; }
.crumbs { margin-bottom: 16px; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.crumbs a:hover { color: var(--ink); }
.dhead { margin-bottom: 18px; }
.dtags { display: flex; gap: 6px; margin-bottom: 8px; }
.dtags .tag { position: static; border: 1px solid var(--line); }
.dhead h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.dhead .meta { margin-top: 6px; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.dhead .meta svg { width: 16px; height: 16px; stroke: var(--brass); }
.dbody { display: grid; gap: 28px; grid-template-columns: 1.45fr 1fr; align-items: start; }
.dbody > * { min-width: 0; }
.gal { position: relative; }
/* marco fijo 3:2 igual para todas las fotos; la foto se ve completa (sin recortes) sobre un fondo difuminado de sí misma */
.main-ph { position: relative; aspect-ratio: 3 / 2; border-radius: var(--r); overflow: hidden; background: #08192c; display: grid; place-items: center; color: #7f9bbb; isolation: isolate; }
.main-ph .ph-bg { position: absolute; inset: -30px; background: center / cover no-repeat; filter: blur(24px) brightness(.55) saturate(1.1); z-index: -1; }
.main-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.main-ph iframe, .main-ph video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #08192c; object-fit: contain; }
.main-ph img.loading { opacity: 0; }
.main-ph img { transition: opacity .25s; }
.zoombtn { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 6px 12px 6px 9px; background: rgba(12, 39, 66, .78); color: #fff; font: 600 .8rem var(--body); cursor: pointer; }
.zoombtn:hover { background: rgba(12, 39, 66, .95); }
.zoombtn svg { width: 16px; height: 16px; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(12, 39, 66, .72); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0 0 4px; }
.nav:hover { background: rgba(12, 39, 66, .92); }
.nav.prev { left: 10px; }
.nav.next { right: 10px; }
.cnt { position: absolute; right: 10px; bottom: 10px; background: rgba(12, 39, 66, .78); color: #fff; font-size: .8rem; padding: 3px 10px; border-radius: 99px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scroll-snap-type: x; padding-bottom: 6px; scrollbar-width: thin; }
.thumbs button { flex: 0 0 90px; height: 60px; border: 2px solid transparent; border-radius: 6px; padding: 0; overflow: hidden; cursor: pointer; background: var(--navy); color: #fff; scroll-snap-align: center; opacity: .7; display: grid; place-items: center; }
.thumbs button[aria-current="true"] { border-color: var(--brass); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs svg { width: 22px; height: 22px; }
.facts { display: flex; gap: 18px 26px; flex-wrap: wrap; align-items: flex-end; margin: 20px 0 14px; padding: 16px 0; border-block: 1px solid var(--line); }
.facts > div { display: grid; }
.facts b { display: block; font-family: var(--head); font-size: 1.1rem; }
.facts span { font-size: .82rem; color: var(--muted); }
.facts .f-main span { color: var(--brass-d); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; }
.facts .f-main b { font-size: 1.9rem; line-height: 1.1; }
.facts .f-main b .u { font-size: 1rem; color: var(--brass-d); margin-left: 5px; letter-spacing: .04em; }
.facts .f-clp { padding-left: 16px; border-left: 2px solid var(--line); }
.facts .f-clp b { font: 600 1.15rem var(--body); }
.dactions { display: flex; flex-wrap: wrap; gap: 10px; }
.sec { font-size: 1.05rem; margin: 26px 0 6px; }
.desc { white-space: pre-line; color: var(--muted); margin: 0; }
.features { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; color: var(--ink); }
.features li { display: flex; gap: 10px; align-items: baseline; }
.features li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brass); flex: none; transform: translateY(-1px); }
.planos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 20px; }
.planos .sec { grid-column: 1 / -1; margin: 0 0 2px; }
.dl { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.dl:hover { border-color: var(--brass); box-shadow: 0 6px 16px rgba(12, 39, 66, .12); }
.dl-ic { flex: 0 0 42px; height: 42px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; color: var(--gold); }
.dl-ic svg { width: 22px; height: 22px; }
.dl-tx { display: grid; line-height: 1.25; }
.dl-tx b { font: 600 .98rem var(--body); }
.dl-tx small { font-size: .76rem; color: var(--muted); }
.map iframe { width: 100%; height: 300px; border: 0; border-radius: var(--r); margin-top: 24px; }
form.visit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; position: sticky; top: 16px; }
form.visit h3 { font-size: 1.15rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.msg { font-size: .92rem; min-height: 1.2em; font-weight: 600; }
.msg.ok { color: var(--wa); }
.msg.err { color: #c0392b; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }

/* ---------- pie */
footer { background: var(--navy); color: #c9d6e4; padding: 48px 0 0; font-size: .92rem; }
.fgrid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr; gap: 32px; }
.flogo { display: inline-block; text-decoration: none; }
.flogo img { height: 64px; width: auto; display: block; }
.fbrand p { margin: 12px 0 0; max-width: 26em; opacity: .85; }
.flinks h2, .social h2, footer .contact h2 { font: 600 .72rem var(--body); letter-spacing: .16em; color: var(--gold); margin: 0 0 4px; }
.flinks a, .social a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; padding: 2px 0; }
.flinks a:hover, .social a:hover { text-decoration: underline; }
.social svg { width: 18px; height: 18px; stroke: var(--gold); }
.fbar { margin-top: 36px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .84rem; }
.fbar .wrap { padding-top: 18px; padding-bottom: 22px; opacity: .8; }

/* ---------- visor de fotos con zoom */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(5, 14, 26, .96); color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.dragging { cursor: grabbing; }
.lb-stage img { max-width: 100vw; max-height: 100dvh; width: auto; height: auto; object-fit: contain; transform-origin: center center; will-change: transform; pointer-events: none; }
.lb-stage img.anim { transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: linear-gradient(rgba(5, 14, 26, .7), transparent); }
.lb-cnt { font-weight: 600; font-size: .9rem; }
.lb-hint { opacity: .7; font-size: .82rem; margin-right: auto; }
.lb-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 2rem; line-height: 1; padding-bottom: 4px; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
.lb-tools { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 99px; background: rgba(12, 39, 66, .85); }
.lb-pct { min-width: 54px; text-align: center; font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
body.lb-open { overflow: hidden; }
@media (max-width: 700px) { .lb-hint { display: none; } .lb-nav { width: 44px; height: 44px; } .lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; } .lb-cnt { margin-right: auto; } }

/* botón flotante de WhatsApp solo en celulares (el encabezado no es fijo) */
.wafab { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff; place-items: center; box-shadow: 0 10px 24px rgba(31, 157, 85, .4); }
.wafab svg { width: 30px; height: 30px; }

@media (max-width: 900px) {
  .fgrid { grid-template-columns: 1fr 1fr; }
  .dbody { grid-template-columns: 1fr; }
  form.visit { position: static; }
}
@media (max-width: 760px) {
  .about { padding: 40px 0; }
  .about-in { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 700px) {
  .indbar { font-size: .76rem; }
  .indbar .wrap { gap: 3px 16px; }
  .indnote { margin-left: 0; width: 100%; }
  header.top .wrap { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo wa" "contact contact"; align-items: center; gap: 12px; min-height: 0; padding: 14px 20px 16px; }
  .hcontact { display: contents; }
  .logo { grid-area: logo; justify-self: start; }
  .logo img { height: 54px; }
  .wabtn { grid-area: wa; justify-self: end; padding: 10px 16px; font-size: .92rem; }
  header.top .contact { grid-area: contact; border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 12px; font-size: .88rem; }
  header.top .contact h2 { display: none; }
  header.top .contact a { padding: 3px 0; }
  .wafab:not([hidden]) { display: grid; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:last-child { grid-column: 1 / -1; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .fgrid { grid-template-columns: 1fr; } }
@media (max-width: 360px) { .wabtn span { display: none; } .wabtn { padding: 11px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card, .chip, .dl, .ph img { transition: none; } .skel { animation: none; } }
