/* Inmobiliaria: editorial y elegante. Blanco roto, negro y terracota. */
:root {
  --fondo: #faf8f5; --blanco: #fff; --tinta: #1b1b1b; --suave: #6f6a64; --linea: #e7e2db;
  --terracota: #c4643f; --terracota-2: #a44f2f;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}
body { background: var(--fondo); color: var(--tinta); font-family: var(--sans); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; line-height: 1.05; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: .9rem 1.6rem; border: 0; border-radius: 999px; background: var(--terracota); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--terracota-2); transform: translateY(-2px); }
.btn--oscuro { background: var(--tinta); }
.btn--oscuro:hover { background: #000; }

.cab { position: sticky; top: 33px; z-index: 50; background: rgb(250 248 245 / .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linea); }
.cab__in { display: flex; align-items: center; gap: 2rem; height: 64px; }
.marca { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; color: var(--tinta); text-decoration: none; }
.marca span { color: var(--terracota); }
.cab nav { margin-left: auto; }
.cab__nav { display: flex; gap: 1.6rem; }
.cab__nav a { color: var(--suave); text-decoration: none; }
.cab__nav a:hover { color: var(--tinta); }
.favs { text-decoration: none; color: var(--terracota); border: 1px solid var(--linea); border-radius: 999px; padding: .35rem .8rem; font-weight: 600; }
.favs.latido { animation: latido .5s; }
@keyframes latido { 40% { transform: scale(1.25); } }
@media (max-width: 680px) { .cab__nav { display: none; } .favs { margin-left: auto; } }

.portada { position: relative; min-height: min(80svh, 720px); display: grid; align-items: end; isolation: isolate; color: #fff; }
.portada__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.portada::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgb(0 0 0 / .1) 30%, rgb(0 0 0 / .55)); }
.portada__in { padding-bottom: clamp(2rem, 6vw, 4.5rem); }
.portada h1 { font-size: clamp(2.8rem, 7vw, 5.6rem); margin-bottom: 2rem; text-shadow: 0 2px 30px rgb(0 0 0 / .3); }
.buscador { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: .5rem; padding: .6rem; background: var(--blanco); border-radius: 22px; color: var(--tinta); max-width: 820px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .6); }
.buscador label { display: grid; padding: .3rem .9rem; border-right: 1px solid var(--linea); }
.buscador label span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
.buscador select { border: 0; background: none; font-weight: 600; padding: .1rem 0; cursor: pointer; }
.buscador select:focus { outline: none; }
@media (max-width: 760px) { .buscador { grid-template-columns: 1fr 1fr; } .buscador label { border: 0; } .buscador .btn { grid-column: 1 / -1; } }

.seccion { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.catalogo__cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.2rem; margin-bottom: 2rem; }
.catalogo__cab h2 { font-size: clamp(2rem, 4vw, 3rem); }
#contador { color: var(--terracota); font-variant-numeric: tabular-nums; }
.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.segmentado { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--linea); }
.segmentado button { border: 0; background: none; padding: .45rem 1rem; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--suave); }
.segmentado button[aria-checked="true"] { background: var(--blanco); color: var(--tinta); box-shadow: 0 2px 6px rgb(0 0 0 / .08); }
.precio-max { display: grid; font-size: .85rem; color: var(--suave); min-width: 190px; }
.precio-max output { font-weight: 700; color: var(--tinta); }
.precio-max input, .hip-form input { accent-color: var(--terracota); }
.solo-favs { display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.solo-favs input { accent-color: var(--terracota); }
#orden { padding: .5rem .8rem; border: 1px solid var(--linea); border-radius: 999px; background: var(--blanco); }

.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; }
.inmueble { position: relative; background: var(--blanco); border-radius: 20px; overflow: hidden; box-shadow: 0 1px 0 var(--linea); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; animation: entrar .5s both; }
.inmueble:hover { transform: translateY(-6px); box-shadow: 0 30px 50px -30px rgb(0 0 0 / .35); }
.inmueble__abrir { all: unset; display: block; width: 100%; cursor: pointer; }
.inmueble__abrir:focus-visible { outline: 3px solid var(--terracota); outline-offset: -3px; border-radius: 20px; }
.inmueble__foto { overflow: hidden; aspect-ratio: 10 / 7; }
.inmueble__foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.inmueble:hover .inmueble__foto img { transform: scale(1.06); }
.inmueble__info { padding: 1.1rem 1.2rem 1.3rem; display: grid; gap: .3rem; }
.inmueble__precio { font-family: var(--serif); font-size: 1.6rem; }
.inmueble__precio small { font-family: var(--sans); font-size: .85rem; color: var(--suave); }
.inmueble__zona { color: var(--suave); font-size: .9rem; }
.specs { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--suave); font-size: .88rem; }
.etiqueta { position: absolute; top: 14px; left: 14px; background: var(--blanco); padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.corazon { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .9); color: var(--suave); font-size: 1.2rem; cursor: pointer; transition: transform .2s, color .2s; }
.corazon:hover { transform: scale(1.1); }
.corazon[aria-pressed="true"] { color: var(--terracota); }
.vacio { grid-column: 1 / -1; text-align: center; color: var(--suave); padding: 3rem 1rem; }
@keyframes entrar { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* Ficha en ventana modal */
.ficha { width: min(100% - 2rem, 760px); max-height: calc(100svh - 2rem); padding: 0; border: 0; border-radius: 24px; overflow: auto; background: var(--blanco); color: var(--tinta); }
.ficha[open] { animation: entrar .35s both; }
.ficha::backdrop { background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); }
.ficha img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.ficha__cerrar { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--blanco); font-size: 1.6rem; cursor: pointer; z-index: 2; }
.ficha__cuerpo { padding: 1.6rem; display: grid; gap: .7rem; }
.ficha__zona { color: var(--terracota); font-weight: 600; font-size: .9rem; }
.ficha h3 { font-size: 2rem; }
.ficha__precio { font-family: var(--serif); font-size: 1.8rem; }
.ficha__hip { background: var(--fondo); border-radius: 12px; padding: .8rem 1rem; font-size: .92rem; }
.ficha .btn { justify-self: start; }
.visita { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1rem; margin-top: .4rem; padding: 1rem; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--tinta) 14%, transparent); }
.visita__tit { grid-column: 1 / -1; font-weight: 700; }
.visita label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; }
.visita label:nth-of-type(3) { grid-column: 1 / -1; }
.visita input, .visita select { padding: .65rem .8rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--tinta) 22%, transparent); background: var(--blanco); color: var(--tinta); }
.visita [aria-invalid="true"] { border-color: var(--terracota); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terracota) 20%, transparent); }
.visita .btn { grid-column: 1 / -1; }
@media (max-width: 560px) { .visita { grid-template-columns: 1fr; } }

/* Hipoteca */
.zona-hipoteca { background: var(--tinta); color: #f3efe9; }
.hipoteca { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.ante { color: var(--terracota); font-weight: 700; text-transform: uppercase; letter-spacing: .15em; font-size: .8rem; }
.hipoteca h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin: .5rem 0; }
.sub { color: #b9b2a8; }
.hip-form { display: grid; gap: 1.3rem; margin-top: 2rem; }
.hip-form label { display: grid; grid-template-columns: 1fr auto; gap: .5rem; font-size: .95rem; color: #d8d1c7; }
.hip-form output { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.hip-form input { grid-column: 1 / -1; }
.hip-res { background: #262626; border-radius: 24px; padding: 2rem; display: grid; gap: 1rem; }
.hip-res > p:first-child { color: #b9b2a8; }
.hip-res__cuota { font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 4.2rem); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.hip-res dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.hip-res dt { font-size: .8rem; color: #b9b2a8; }
.hip-res dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.hip-barra { display: flex; height: 12px; border-radius: 999px; overflow: hidden; }
.hip-barra span { transition: flex-basis .5s; }
#h-barra-cap { background: #f3efe9; }
#h-barra-int { background: var(--terracota); }
.nota { font-size: .78rem; color: #8f887f; }
@media (max-width: 860px) { .hipoteca { grid-template-columns: 1fr; } .hip-res dl { grid-template-columns: 1fr 1fr; } }

.vender { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2rem; }
.vender h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 22ch; }
.vender p { color: var(--suave); margin-top: .7rem; max-width: 52ch; }

.pie { border-top: 1px solid var(--linea); padding: 2rem 0; color: var(--suave); font-size: .9rem; }
.pie__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
