/* Portal público. Paleta Inmovo: casi negro (--ink) + verde menta (--accent); Outfit en títulos, Inter en texto. */
:root {
  --ink: #1A1A1F; --ink-2: #33333A; --accent: #2BB58F; --accent-text: #177A5E; --accent-soft: #E3F4EC;
  --text: #33333A; --muted: #5E5E66; --border: #E2E2DE; --bg: #F4F4F2;
  --radius: 14px; --shadow: 0 6px 24px rgba(26, 26, 31, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text); background: #fff; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { width: 28px; height: 35px; }

.nav { display: flex; gap: 20px; margin-left: 12px; font-weight: 600; }
.nav a:hover { color: var(--accent-text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 700; border: 0; cursor: pointer; font: inherit; font-weight: 700; }
.btn-primary { background: var(--ink); color: #fff; } .btn-primary:hover { background: var(--ink-2); }
.btn-accent { background: var(--accent); color: var(--ink); } .btn-accent:hover { background: #25a07e; }
.btn-ghost { border: 1px solid var(--border); background: #fff; color: var(--ink); }
.btn-block { width: 100%; }

/* Hero + buscador */
.hero { background: var(--bg); color: var(--ink); padding: 64px 0 88px; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(30px, 4.5vw, 48px); line-height: 1.1; margin: 0 0 10px; font-weight: 800; max-width: 680px; }
.hero p { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 600px; }
.searchbox { background: #fff; color: var(--text); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 900px; position: relative; z-index: 1; }
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.tabs label { padding: 8px 16px; border-radius: 10px 10px 0 0; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs input { display: none; }
.tabs input:checked + span { color: var(--ink); border-bottom: 3px solid var(--accent); padding-bottom: 4px; }
.search-fields { display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 12px; padding: 14px; border-top: 1px solid var(--border); }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 4px 2px; text-transform: uppercase; letter-spacing: .04em; }
.field select, .field input { width: 100%; height: 46px; border: 1px solid #d9d9d9; border-radius: 10px; padding: 0 12px; font: inherit; color: var(--text); background: #fff; }
.field select:focus, .field input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.search-fields .btn { height: 46px; align-self: end; padding: 0 28px; }

/* Secciones */
.section { padding: 48px 0; }
.section h2 { font-size: 26px; color: var(--ink); margin: 0 0 6px; font-weight: 800; }
.section .lead { color: var(--muted); margin: 0 0 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

/* Tarjeta de propiedad */
.card { border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--border); transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .photo { aspect-ratio: 4 / 3; background: var(--bg) center / cover no-repeat; position: relative; }
.card .badge { position: absolute; top: 12px; left: 12px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.card .badge.pozo { background: var(--accent); color: var(--ink); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.card .price { font-size: 20px; font-weight: 800; color: var(--ink); }
.card .title { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .meta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.card .where { color: var(--accent-text); font-weight: 700; font-size: 14px; }

.barrios { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.barrio { padding: 18px; border-radius: var(--radius); background: var(--bg); display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--ink); }
.barrio:hover { background: var(--accent-soft); }
.barrio small { color: var(--muted); font-weight: 600; }

.cta { background: var(--bg); border-radius: 20px; padding: 36px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h3 { margin: 0 0 4px; font-size: 24px; color: var(--ink); }
.cta p { margin: 0; color: var(--muted); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--bg); border-radius: var(--radius); }

/* Resultados */
.results-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); margin: 24px 0; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Buscador con mapa */
.container-wide { width: calc(100% - 32px); margin-inline: auto; }
.filterbar { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 68px; z-index: 15; }
.filterbar .container-wide { display: flex; gap: 8px; padding: 12px 0; overflow-x: auto; }
.filterbar .field select, .filterbar .field input { height: 40px; border-radius: 999px; padding: 0 14px; min-width: 150px; }
.filterbar .btn { border-radius: 999px; height: 40px; white-space: nowrap; }
.search-layout { display: block; }
.search-layout.with-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 46%); }
.search-list { padding: 20px 24px 40px; }
.results-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.results-title { margin: 0; color: var(--ink); font-size: 24px; }
.results-count { color: var(--muted); }
.search-map { position: sticky; top: 133px; height: calc(100vh - 133px); }
#search-map { width: 100%; height: 100%; }
.map-toggle, .map-close { display: none; }
.pins { position: absolute; }
.pin { position: absolute; transform: translate(-50%, -50%); background: #fff; color: var(--ink); border: 0; border-radius: 999px; padding: 5px 10px; font: 600 13px Inter, sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; }
.pin:hover, .pin.on { background: var(--ink); color: #fff; z-index: 2; transform: translate(-50%, -50%) scale(1.08); }
.pin.approx { outline: 2px dashed rgba(26,26,31,.35); outline-offset: 2px; }
.pin.selected { background: var(--ink); color: #fff; z-index: 3; box-shadow: 0 0 0 3px var(--accent); }
.result > .card { transition: box-shadow .2s, transform .2s, outline-color .2s; outline: 2px solid transparent; outline-offset: -2px; }
.result.on > .card { box-shadow: var(--shadow); transform: translateY(-2px); outline-color: var(--ink); }
/* Miniatura del pin (estilo Airbnb) */
#map-card { position: absolute; z-index: 10; transform: translate(-50%, calc(-100% - 22px)); }
#map-card.below { transform: translate(-50%, 22px); }
.map-card { width: 300px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,.28); position: relative; font-family: Inter, sans-serif; cursor: default; }
.map-card.loading { height: 250px; background: linear-gradient(90deg, #f2f2f2 25%, #e8e8e8 50%, #f2f2f2 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.map-card-link { display: block; color: inherit; text-decoration: none; position: relative; }
.map-card-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.map-card-photos::-webkit-scrollbar { display: none; }
.map-card-photo { flex: 0 0 100%; aspect-ratio: 3 / 2; background: var(--bg) center / cover no-repeat; scroll-snap-align: start; }
.map-card-media { position: relative; }
.map-card-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.map-card-nav.prev { left: 8px; } .map-card-nav.next { right: 8px; }
.map-card:hover .map-card-nav { opacity: 1; }
.map-card-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.map-card-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.map-card-title { font-weight: 700; color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.map-card-meta { color: var(--muted); font-size: 14px; }
.map-card-price { font-weight: 800; color: var(--ink); margin-top: 2px; }
@media (max-width: 900px) {
  #map-card { position: absolute; left: 12px !important; right: 12px; bottom: 76px; top: auto !important; transform: none; }
  .map-card { width: auto; display: block; }
  .map-card-nav { opacity: 1; }
}
.pin.cluster { background: var(--ink); color: #fff; min-width: 34px; height: 34px; padding: 0 8px; font-size: 14px; }

/* Ficha */
.gallery { display: grid; gap: 8px; height: 448px; border-radius: var(--radius); overflow: hidden; margin: 24px 0; }
.gallery .ph { border: 0; padding: 0; cursor: zoom-in; background: var(--bg) center / cover no-repeat; transition: filter .2s; position: relative; min-height: 0; }
.gallery .ph:hover { filter: brightness(.92); }
.gallery.g1 { grid-template-columns: 1fr; }
.gallery.g2 { grid-template-columns: 2fr 1fr; }
.gallery.g3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery.g3 .ph:first-child { grid-row: span 2; }
.gallery.g4 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery.g4 .ph:first-child { grid-row: span 2; }
.gallery.g4 .ph:last-child { grid-row: span 2; }
.gallery.g5 { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery.g5 .ph:first-child { grid-row: span 2; }

.carousel-wrap { display: none; position: relative; margin: 0 -16px 8px; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.carousel::-webkit-scrollbar { display: none; }
.carousel .slide { flex: 0 0 100%; scroll-snap-align: center; border: 0; padding: 0; background: var(--bg); aspect-ratio: 4 / 3; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-count { position: absolute; right: 12px; bottom: 12px; background: rgba(15,20,30,.7); color: #fff; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.gallery .more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,20,30,.45); color: #fff; font-weight: 800; font-size: 20px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(26, 26, 31, .96); display: flex; align-items: center; justify-content: center; padding: 76px 0 40px; box-sizing: border-box; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 116px); object-fit: contain; border-radius: 8px; user-select: none; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer; font-size: 28px; line-height: 1; border-radius: 999px; width: 52px; height: 52px; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 20px; right: 20px; font-size: 22px !important; }
.lb-prev { left: 20px; } .lb-next { right: 20px; }
.lb-count { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.85); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.listing-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; }
.listing-layout h1 { font-size: 28px; color: var(--ink); margin: 0 0 6px; line-height: 1.2; }
.facts { display: flex; gap: 22px; flex-wrap: wrap; padding: 18px 0; border-block: 1px solid var(--border); margin: 18px 0; }
.facts div { display: flex; flex-direction: column; }
.facts strong { font-size: 20px; color: var(--ink); }
.facts span { color: var(--muted); font-size: 14px; }
.box { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); position: sticky; top: 88px; }
.box .price { font-size: 28px; font-weight: 800; color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--bg); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.ig-embed { width: 100%; background: var(--bg); border-radius: var(--radius); padding: 24px; display: flex; justify-content: center; }
.ig-embed > * { max-width: 540px; } /* máximo que permite Instagram: el recuadro acompaña el ancho del mapa */
@media (max-width: 900px) { .ig-embed { padding: 0; background: none; } }
.map-tabs { display: flex; gap: 6px; margin: 28px 0 10px; }
.map-tabs button { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.map-tabs button.on { color: var(--ink); border-color: var(--accent); }
.map-frame { width: 100%; height: 380px; border: 0; border-radius: var(--radius); background: var(--bg); }
.notice { background: #fff8e6; border: 1px solid #f4d48a; color: #7a5a00; padding: 12px 16px; border-radius: 10px; margin-top: 16px; }

/* Footer */
.site-footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 40px 0; margin-top: 48px; font-size: 14px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a:hover { color: #fff; }

@media (max-width: 900px) {
  .search-layout.with-map { display: block; }
  .search-list { padding: 16px; }
  .search-map { display: none; position: fixed; inset: 0; top: 68px; height: auto; z-index: 30; background: #fff; }
  .search-map.open { display: block; }
  .map-toggle { display: inline-flex; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 25; border-radius: 999px; box-shadow: var(--shadow); }
  .map-close { display: inline-flex; position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); border-radius: 999px; box-shadow: var(--shadow); }
  .filterbar { top: 68px; }
  .nav { display: none; }
  .search-fields { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing-layout { grid-template-columns: 1fr; }
  .box { position: static; }
  .gallery { display: none; }
  .carousel-wrap { display: block; }
  .lightbox { padding: 76px 0 96px; }
  .lightbox img { max-width: 100vw; max-height: calc(100vh - 172px); border-radius: 0; }
  .lb-prev, .lb-next { bottom: 24px; top: auto; }
}

/* Página pública del agente: inmovo.com/{link} */
.agent-page { padding: 32px 0 56px; }
.agent-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.agent-head h1 { margin: 0 0 4px; font-size: 28px; color: var(--ink); }
.agent-head .muted { color: var(--muted); }
.agent-avatar { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 600; font-family: Outfit, sans-serif; }
.agent-count { margin-top: 6px; font-weight: 600; color: var(--accent-text); }
.agent-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Títulos, precios y marca en Outfit (la letra del logo) */
h1, h2, h3, .price, .map-card-price, .results-title, .facts strong { font-family: Outfit, system-ui, sans-serif; font-weight: 600; letter-spacing: -.02em; }
.hero h1 { font-weight: 600; letter-spacing: -.035em; }
