/* Web pública de inmobiliarias (web.php y web-ficha.php).
   El color de cada inmobiliaria entra por variables (--brand, --on-brand, --brand-text)
   definidas en el <head>; todo lo demás es neutro. */

:root {
  --ink: #17212b;
  --ink-2: #4a5663;
  --ink-3: #6b7683;
  --line: #e4e8ec;
  --surface: #f5f7f9;
  --white: #fff;
  --focus: #0b5fff;
  --danger: #b42318;
  --ok: #067647;
  --radius-card: 16px;
  --radius-field: 12px;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --shadow-float: 0 1px 2px rgba(23, 33, 43, .06), 0 12px 32px -8px rgba(23, 33, 43, .22);
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.015em; margin: 0; color: var(--ink); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--fill { fill: currentColor; stroke: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--soft { background: var(--surface); }
.section__title { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
.section__lead { color: var(--ink-2); margin-top: 8px; max-width: 60ch; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; text-decoration: none; line-height: 1; transition: background-color .15s, box-shadow .15s, transform .15s;
}
.btn--brand { background: var(--brand); color: var(--on-brand); }
.btn--brand:hover { box-shadow: 0 6px 18px -6px var(--brand); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--wa { background: #1fa855; color: #fff; }
.btn--wa:hover { background: #178a45; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header__in { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand-name { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; min-width: 0; }
.brand-name__mark { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.brand-name__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 10px 14px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a.nav__cta { background: var(--brand); color: var(--on-brand); font-weight: 600; margin-left: 6px; }
.nav a.nav__cta:hover { box-shadow: 0 6px 18px -6px var(--brand); }
.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--white); align-items: center; justify-content: center; }
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-x { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-x { display: block; }

/* ---------- Hero + buscador ---------- */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--brand) var(--hero-img, none) center / cover no-repeat; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--brand) 88%, #000 12%) 0%, color-mix(in srgb, var(--brand) 62%, transparent) 46%, rgba(10, 16, 22, .18) 100%),
    linear-gradient(0deg, rgba(10, 16, 22, .35), transparent 40%);
}
.hero__in { padding-top: clamp(56px, 10vw, 128px); padding-bottom: clamp(120px, 14vw, 168px); }
.hero__title { font-size: clamp(2.2rem, 5.6vw, 4.2rem); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; max-width: 16ch; color: var(--on-brand); text-wrap: balance; }
.hero__lead { margin-top: 18px; font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 46ch; color: var(--on-brand); opacity: .94; }
.hero__title, .hero__lead { animation: hero-in .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero__lead { animation-delay: .08s; }
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.search-wrap { position: relative; z-index: 5; margin-top: -88px; }
.search {
  background: var(--white); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-float);
  display: grid; grid-template-columns: auto 1.4fr 1fr 1fr auto; gap: 14px; align-items: end;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.control {
  width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-field); border: 1.5px solid var(--line);
  background: var(--white); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.control:hover { border-color: #c9d0d7; }
.control:focus { border-color: var(--brand-text); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 26%, transparent); }
select.control { appearance: none; padding-right: 40px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5663' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 20px; }
textarea.control { padding: 12px 14px; min-height: 120px; resize: vertical; line-height: 1.5; }

.segmented { display: inline-flex; padding: 4px; background: var(--surface); border-radius: 14px; border: 1.5px solid var(--line); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 11px 18px; border-radius: 10px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-size: .95rem; }
.segmented input:checked + label { background: var(--brand); color: var(--on-brand); box-shadow: 0 2px 8px -2px var(--brand); }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

.multi { position: relative; }
.multi__btn { text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.multi__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi__panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-float); padding: 10px; min-width: 260px; }
.multi__panel[hidden] { display: none; }
.multi__search { margin-bottom: 8px; min-height: 42px; }
.multi__list { max-height: 240px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.multi__list label { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.multi__list label:hover { background: var(--surface); }
.multi__list small { color: var(--ink-3); margin-left: auto; padding-left: 8px; }
.multi__list input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.multi__empty { padding: 10px 8px; color: var(--ink-3); font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 8px 7px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--ink); }
.chip:hover { border-color: var(--ink); }
.chip .icon { width: 16px; height: 16px; }
.chips__clear { font-size: .9rem; margin-left: 4px; }

/* ---------- Listado ---------- */
.results-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-top: 40px; margin-bottom: 24px; }
.results-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
.results-head p { color: var(--ink-2); margin-top: 4px; }
.sort { display: flex; align-items: center; gap: 10px; }
.sort label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.sort .control { min-height: 44px; width: auto; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.card:hover, .card:focus-within { border-color: transparent; box-shadow: var(--shadow-float); }
.card__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card__media img { transform: scale(1.04); }
.tag { position: absolute; left: 0; bottom: 14px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: .85rem; padding: 7px 14px 7px 16px; border-radius: 0 999px 999px 0; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .4); }
.tag--tipo { left: auto; right: 12px; top: 12px; bottom: auto; background: rgba(255, 255, 255, .94); color: var(--ink); border-radius: 999px; font-weight: 600; box-shadow: none; padding: 6px 12px; }
.card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.price small { font-family: var(--font-body); font-weight: 500; font-size: .85rem; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.price-extra { font-size: .88rem; color: var(--ink-2); }
.card__title { font-size: 1.02rem; font-weight: 600; font-family: var(--font-body); letter-spacing: 0; line-height: 1.35; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__place { display: flex; align-items: flex-start; gap: 6px; color: var(--ink-2); font-size: .92rem; }
.card__place .icon { margin-top: 3px; color: var(--brand-text); }
.feats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--ink-2); font-size: .92rem; }
.card__body > .place-wrap { margin-bottom: 14px; }
.feats li { display: inline-flex; align-items: center; gap: 6px; }
.card__wa { position: absolute; right: 14px; bottom: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: #1fa855; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5); transition: transform .15s; }
.card__wa:hover { transform: scale(1.08); }
.card__wa .icon { width: 22px; height: 22px; }

.empty { text-align: center; padding: 56px 20px; border: 1.5px dashed #cdd4db; border-radius: var(--radius-card); background: var(--surface); }
.empty h3 { font-size: 1.35rem; }
.empty p { color: var(--ink-2); margin: 8px auto 20px; max-width: 44ch; }

.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pager a, .pager span { min-width: 44px; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--ink); }
.pager [aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Sobre nosotros / Garantía ---------- */
.about { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.about__text { font-size: 1.1rem; line-height: 1.75; color: var(--ink-2); white-space: pre-line; max-width: 64ch; }
.about__meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-3); font-size: .95rem; }

.garantia { background: var(--ink); color: #fff; border-radius: 24px; padding: clamp(28px, 5vw, 48px); display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.garantia h2 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.garantia p { color: #cfd6dd; margin-top: 8px; max-width: 54ch; }
.garantia .btn { background: #fff; color: var(--ink); }
.garantia .btn:hover { box-shadow: 0 6px 18px -6px #fff; }
.garantia__icon { color: #fff; width: 44px; height: 44px; margin-bottom: 14px; opacity: .9; }

/* ---------- Contacto ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.contact__list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.contact__list li { display: flex; gap: 14px; align-items: flex-start; }
.contact__ico { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand-text); display: grid; place-items: center; flex: none; }
.contact__list strong { display: block; font-weight: 600; }
.contact__list a, .contact__list span { color: var(--ink-2); }
.map { margin-top: 24px; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: var(--surface); }
.map iframe { width: 100%; height: 100%; border: 0; }
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 1px 2px rgba(23, 33, 43, .04); }
.form-card h3 { font-size: 1.35rem; margin-bottom: 4px; }
.form-card > p { color: var(--ink-2); margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field-error { color: var(--danger); font-size: .88rem; min-height: 0; }
.field-error:empty { display: none; }
.control[aria-invalid="true"] { border-color: var(--danger); }
.form-note { font-size: .85rem; color: var(--ink-3); margin-top: 12px; }
.form-ok { text-align: center; padding: 24px 8px; }
.form-ok .icon { width: 56px; height: 56px; color: var(--ok); }
.form-ok h3 { margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfd6dd; padding-top: 56px; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer__logo { background: #fff; border-radius: 14px; padding: 12px 16px; display: inline-block; }
.footer__logo img { max-height: 52px; width: auto; max-width: 200px; }
.site-footer h2 { color: #fff; font-size: 1rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #cfd6dd; }
.site-footer a:hover { color: #fff; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #3a4856; display: grid; place-items: center; color: #fff; text-decoration: none; }
.social a:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.footer__bottom { border-top: 1px solid #2c3948; padding-block: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .9rem; color: #9aa6b2; }
.footer__bottom a { color: #cfd6dd; }

.fab-wa { position: fixed; right: 18px; bottom: 18px; z-index: 35; width: 58px; height: 58px; border-radius: 50%; background: #1fa855; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .55); transition: transform .15s; }
.fab-wa:hover { transform: scale(1.07); }
.fab-wa .icon { width: 30px; height: 30px; }

/* ---------- Ficha ---------- */
.crumbs { padding-block: 20px; }
.crumbs a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; color: var(--ink-2); padding: 8px 14px 8px 10px; border-radius: 999px; }
.crumbs a:hover { background: var(--surface); color: var(--ink); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; background: #fff4e5; border: 1px solid #f5c680; color: #6b3f00; margin-bottom: 20px; }

.mosaic { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: clamp(300px, 46vw, 520px); border-radius: 20px; overflow: hidden; position: relative; }
.mosaic__item { border: 0; padding: 0; background: var(--surface); overflow: hidden; position: relative; display: block; }
.mosaic__item:first-child { grid-row: 1 / span 2; }
.mosaic__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, filter .2s; }
.mosaic__item:hover img { transform: scale(1.03); }
.mosaic__item:focus-visible { outline-offset: -4px; }
.mosaic--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mosaic--2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.mosaic--2 .mosaic__item:first-child { grid-row: auto; }
.mosaic--3, .mosaic--4 { grid-template-columns: 2fr 1fr; }
.mosaic--3 .mosaic__item:nth-child(n+4), .mosaic--4 .mosaic__item:nth-child(n+4) { display: none; }
.mosaic__all { position: absolute; right: 16px; bottom: 16px; z-index: 2; background: var(--white); border: 0; border-radius: 999px; min-height: 44px; padding: 0 18px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5); }
.mosaic__all:hover { background: var(--surface); }
.mosaic__hidden { display: none; }

.ficha { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 56px); margin-top: 36px; align-items: start; padding-bottom: 72px; }
.ficha__head h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -.025em; }
.ficha__place { display: flex; align-items: center; gap: 8px; color: var(--ink-2); margin-top: 10px; font-size: 1.05rem; }
.ficha__place .icon { color: var(--brand-text); }
.ficha__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge { display: inline-flex; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: var(--brand); color: var(--on-brand); }
.badge--plain { background: var(--surface); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.facts li { padding: 16px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.facts .icon { color: var(--brand-text); width: 26px; height: 26px; margin-bottom: 6px; }
.facts strong { font-family: var(--font-display); font-size: 1.35rem; line-height: 1; }
.facts span { color: var(--ink-2); font-size: .9rem; }
.block { margin-top: 44px; }
.block h2 { font-size: 1.45rem; font-weight: 700; margin-bottom: 16px; }
.prose { color: var(--ink-2); font-size: 1.05rem; line-height: 1.8; max-width: 68ch; white-space: pre-line; }
.amen { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.amen li { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border-radius: 999px; border: 1px solid var(--line); font-weight: 500; }
.amen .icon { color: var(--brand-text); }
.video { width: 100%; border-radius: var(--radius-card); background: #000; max-height: 520px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; }

.aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.quote { background: var(--white); border: 1px solid var(--line); border-top: 6px solid var(--brand); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-float); }
.quote .price { font-size: 2.1rem; }
.quote__op { font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.quote__row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 14px; color: var(--ink-2); }
.quote__row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.quote__actions { display: grid; gap: 10px; margin-top: 18px; }
.quote form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.quote form h2 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }
.quote textarea.control { min-height: 96px; }
.garantia-mini { border-radius: 18px; padding: 20px; background: var(--ink); color: #fff; display: grid; gap: 6px; }
.garantia-mini strong { font-family: var(--font-display); font-size: 1.15rem; }
.garantia-mini p { color: #cfd6dd; font-size: .95rem; }
.garantia-mini a { color: #fff; font-weight: 600; margin-top: 6px; }
.mobile-bar { display: none; }

/* Lightbox (<dialog>) */
.lb { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; color: #fff; }
.lb::backdrop { background: rgba(8, 12, 16, .94); }
.lb__in { height: 100%; display: grid; grid-template-rows: auto 1fr; }
.lb__top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; }
.lb__count { font-weight: 600; }
.lb__stage { position: relative; display: grid; place-items: center; padding: 0 64px 24px; min-height: 0; }
.lb__stage img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 8px; }
.lb__btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.lb__btn:hover { background: rgba(255, 255, 255, .28); }
.lb__prev, .lb__next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb__prev { left: 8px; }
.lb__next { right: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .search { grid-template-columns: 1fr 1fr; }
  .search .field--seg, .search .field--btn { grid-column: 1 / -1; }
  .search .field--btn .btn { width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .ficha { grid-template-columns: 1fr; }
  .aside { position: static; }
  .about, .contact { grid-template-columns: 1fr; }
  .garantia { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column; align-items: stretch; background: var(--white); padding: 12px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .3); }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .nav a.nav__cta { margin: 8px 0 0; text-align: center; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .container { width: min(1200px, 100% - 32px); }
  .search { grid-template-columns: 1fr; padding: 16px; border-radius: 18px; }
  .segmented { display: flex; }
  .segmented label { flex: 1; text-align: center; padding-inline: 8px; }
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .mosaic, .mosaic--2, .mosaic--3, .mosaic--4 { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 300px; border-radius: 14px; }
  .mosaic__item:nth-child(n+2) { display: none; }
  .lb__stage { padding: 0 8px 16px; }
  .lb__prev { left: 4px; }
  .lb__next { right: 4px; }
  .fab-wa { bottom: 84px; }
  .has-mobile-bar .fab-wa { display: none; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 12px; align-items: center; }
  .mobile-bar .price { font-size: 1.25rem; flex: 1; min-width: 0; }
  .mobile-bar .btn { min-height: 46px; padding: 0 18px; }
  .has-mobile-bar { padding-bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .search-wrap, .fab-wa, .mobile-bar, .nav-toggle { display: none !important; }
}

/* Formulario dentro de la columna lateral de la ficha */
.quote h3 { font-size: 1.1rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; margin-bottom: 12px; }
.quote .form-grid { grid-template-columns: 1fr; gap: 12px; }
.quote .form-note { margin-top: 10px; }

/* Ajustes de revisión */
.grid > li { display: flex; }
.grid > li > .card { flex: 1; }
.card__media .card__wa { right: 12px; bottom: 12px; }
.segmented label { padding: 8px 18px; }

.form-card h3 + p { margin-bottom: 20px; }
.quote form { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- Garantía Respaldar: banner del listado, pill y calculador ---------- */
.rb { margin-top: 44px; background: linear-gradient(100deg, #0e1a24 0%, #0a3a28 58%, #00793c 100%); color: #fff; }
.rb__in { display: flex; align-items: center; gap: 24px; min-height: 92px; padding-block: 16px; }
.rb__logo { height: 34px; width: auto; flex: none; padding-right: 24px; border-right: 1px solid rgba(255, 255, 255, .28); }
.rb__text { flex: 1; margin: 0; line-height: 1.4; color: #d6e6dd; }
.rb__text strong { display: block; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.rb__cta { flex: none; background: #fff; color: #0e1a24; border-radius: 999px; padding: 13px 24px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: box-shadow .15s, transform .15s; }
.rb__cta:hover { box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .6); transform: translateY(-1px); }
.rb + .section { padding-top: 0; }

.tag--apto { left: 12px; top: 12px; bottom: auto; background: #fff; color: #00552a; border-radius: 999px; padding: 6px 12px 6px 9px; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .3); }
.tag--apto .icon { width: 1.15em; height: 1.15em; color: #00793c; }
.badge--apto { background: #e6f4ec; color: #00552a; border: 1px solid #bfe0cd; align-items: center; gap: 6px; }
.badge--apto .icon { width: 1.15em; height: 1.15em; color: #00793c; }


@media (max-width: 820px) {
  .rb__in { flex-wrap: wrap; gap: 12px 20px; }
  .rb__logo { border-right: 0; padding-right: 0; height: 28px; }
  .rb__text { flex-basis: 100%; order: 3; }
  .rb__cta { margin-left: auto; padding: 11px 20px; }
  .rb__text strong { font-size: 1.05rem; }
}

.quote--form { border-top-width: 1px; box-shadow: none; }

/* El banner respeta el ancho del buscador y de las tarjetas */
.rb { background: none; margin-top: 44px; }
.rb__in { background: linear-gradient(100deg, #0e1a24 0%, #0a3a28 58%, #00793c 100%); border-radius: 20px; padding: 18px 28px; min-height: 92px; }
.rb + .section { padding-top: 0; }
@media (max-width: 820px) { .rb__in { padding: 18px 20px; } }

/* Calculador de garantía (ficha) */
.calc { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 24px 20px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, rgba(0, 150, 80, .55) 0%, rgba(0, 150, 80, 0) 55%), linear-gradient(160deg, #0d1822 0%, #12261f 100%); box-shadow: 0 18px 40px -18px rgba(0, 60, 35, .65); }
.calc__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.calc__logo { height: 30px; width: auto; max-width: 62%; }
.calc__apto { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px 6px 9px; border-radius: 999px; background: #fff; color: #00552a; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.calc__apto .icon { width: 1.2em; height: 1.2em; color: #00793c; }
.calc h2 { margin: 0; font-family: var(--font-body); font-size: .98rem; font-weight: 500; letter-spacing: 0; color: #cfe3d8; }
.calc__monto { margin: 6px 0 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.7rem, 5vw, 3.3rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: #fff; }
.calc__monto span { font-size: .55em; margin-right: 6px; font-weight: 700; vertical-align: .32em; }
.calc__cuotas { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(46, 209, 127, .16); color: #7ef0b3; font-weight: 700; }
.calc__cuotas .icon { width: 1.2em; height: 1.2em; }
.calc__list { list-style: none; margin: 18px 0 20px; padding: 16px 0 0; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; gap: 8px; color: #e4efe9; font-size: .93rem; }
.calc__list li { display: flex; align-items: flex-start; gap: 10px; }
.calc__list .icon { width: 1.15em; height: 1.15em; margin-top: 2px; color: #4ade9a; }
.calc__cta { display: flex; align-items: center; justify-content: center; gap: 10px; background: #2fd17f; color: #04291a; border-radius: 14px; min-height: 52px; padding: 0 18px; font-weight: 800; font-size: 1.02rem; text-decoration: none; transition: background-color .15s, transform .15s, box-shadow .15s; }
.calc__cta .icon { width: 1.35em; height: 1.35em; }
.calc__cta:hover { background: #4be296; transform: translateY(-1px); box-shadow: 0 12px 24px -12px #2fd17f; }
.calc__cta:focus-visible { outline-color: #fff; }
.calc__nota { margin: 12px 0 0; color: #9fb4a9; font-size: .78rem; line-height: 1.45; }
/* Header con logo: si la inmobiliaria cargó uno, reemplaza el monograma y el nombre */
.brand-name__logo { display: none; max-height: 44px; max-width: min(220px, 52vw); width: auto; height: auto; object-fit: contain; }
.brand-name.has-logo .brand-name__logo { display: block; }
.brand-name.has-logo .brand-name__mark { display: none; }
.brand-name.has-logo .brand-name__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
