:root {
  --ink: #102238;
  --muted: #66758a;
  --navy: #0b2545;
  --blue: #1667c5;
  --teal: #cf7048;
  --aqua: #dff6f7;
  --line: #dce5ef;
  --surface: #ffffff;
  --wash: #f3f7fb;
  --success: #147d64;
  --shadow: 0 18px 50px rgba(15, 40, 70, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--wash); color: var(--ink); }
button, input, select { font: inherit; }
button, select, input { border-radius: 10px; }
button { cursor: pointer; }

.topbar { position: sticky; top: 0; z-index: 50; min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px clamp(18px, 4vw, 54px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand { display: flex; min-width: 0; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-logo { flex: 0 0 auto; width: min(245px, 39vw); height: 84px; object-fit: cover; object-position: center; }
.brand-product { display: grid; min-width: 0; gap: 4px; padding-left: 20px; border-left: 1px solid var(--line); color: var(--ink); }
.brand-product strong { font-size: clamp(1.05rem, 1.45vw, 1.5rem); font-weight: 800; letter-spacing: -.025em; }
.brand-tagline { color: var(--muted); font-size: .81rem; line-height: 1.35; }
.header-stock-summary { color: var(--blue); font-size: .76rem; font-weight: 750; }
.header-advisor { text-decoration: none; white-space: nowrap; background: var(--blue); font-size: .86rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.update-pill { color: var(--muted); font-size: .82rem; }
.button { border: 0; padding: 11px 16px; background: var(--navy); color: white; font-weight: 750; box-shadow: 0 8px 18px rgba(11,37,69,.18); }
.button:hover { background: #133b6b; }
.button-ghost { background: white; color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.button-ghost:hover { background: var(--wash); }

.app-shell { width: min(1600px, 100%); margin: auto; padding: 20px clamp(14px, 3vw, 42px) 34px; }
.intro-strip { position: relative; min-height: 250px; display: grid; align-items: center; margin-bottom: 18px; overflow: hidden; border-radius: 22px; background: var(--navy); color: white; box-shadow: var(--shadow); isolation: isolate; }
.intro-strip::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(4,24,49,.95) 0%, rgba(7,40,76,.82) 36%, rgba(8,44,74,.24) 68%, rgba(4,20,35,.12) 100%); }
.intro-copy { position: relative; z-index: 1; width: min(62%, 850px); padding: clamp(28px, 4vw, 54px); align-self: center; }
.intro-copy h1 { margin: 5px 0 8px; max-width: 700px; font-size: clamp(1.7rem, 3vw, 2.65rem); line-height: 1.03; letter-spacing: -.045em; }
.intro-copy p { margin: 0; max-width: 720px; color: rgba(255,255,255,.78); font-size: 1rem; line-height: 1.5; }
.eyebrow { display: block; color: var(--teal); font-size: .73rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.intro-copy .eyebrow { color: #7de3ec; }
.city-photo { position: absolute; z-index: -2; inset: 0; min-height: 250px; margin: 0; }
.city-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.city-photo figcaption { position: absolute; right: 12px; bottom: 9px; z-index: 1; color: rgba(255,255,255,.8); font-size: .72rem; }

.workspace { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 18px; align-items: start; }
.filters { position: sticky; top: 108px; max-height: calc(100vh - 128px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 30px rgba(30,55,85,.07); }
.filter-heading, .panel-heading, .results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.filter-heading h2, .panel-heading h2 { margin: 3px 0 0; font-size: 1.05rem; letter-spacing: -.025em; }
.text-button { padding: 6px; border: 0; background: transparent; color: var(--blue); font-weight: 750; }
.field { display: grid; gap: 7px; margin-top: 18px; color: var(--ink); font-size: .87rem; font-weight: 720; }
.field input:not([type="range"]), .field select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid var(--line); background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,103,197,.13); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-value { display: flex; align-items: baseline; justify-content: space-between; }
.range-value strong { font-size: 1.05rem; }
.range-value small { color: var(--muted); font-weight: 500; }
.range-limits { display: flex; justify-content: space-between; margin-top: -3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--blue); }
.check-field { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: .9rem; font-weight: 720; }
.check-field input { width: 18px; height: 18px; accent-color: var(--blue); }
.source-note { margin-top: 22px; padding: 14px; border-radius: 14px; background: var(--aqua); color: #164d58; }
.source-note strong { font-size: .86rem; }
.source-note p { margin: 6px 0 0; font-size: .79rem; line-height: 1.45; }
.mobile-filter-button { display: none; }

.results-area { min-width: 0; }
.results-toolbar { min-height: 64px; padding: 12px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.results-toolbar strong, .results-toolbar span { display: block; }
.results-toolbar strong { font-size: 1.05rem; }
.results-toolbar > div > span { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.sort-control select { padding: 8px 10px; border: 1px solid var(--line); background: white; color: var(--ink); }
.content-grid { display: grid; grid-template-columns: minmax(340px, .85fr) minmax(430px, 1.15fr); gap: 12px; align-items: start; }
.map-panel, .list-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 10px 30px rgba(30,55,85,.06); }
.map-panel { position: sticky; top: 108px; }
.count-badge { min-width: 34px; padding: 5px 9px; border-radius: 999px; background: var(--wash); color: var(--muted); font-size: .78rem; font-weight: 800; text-align: center; }
.map-canvas { position: relative; height: min(63vh, 610px); min-height: 440px; margin-top: 14px; overflow: hidden; border-radius: 15px; background: linear-gradient(150deg, #eaf2f7 0%, #dfeef1 55%, #d9e7ef 100%); border: 1px solid #cfdae5; }
.map-load-notice { position: absolute; z-index: 5; inset: auto 14px 14px; max-width: 560px; margin: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.96); color: var(--navy); box-shadow: var(--shadow); font-size: .78rem; line-height: 1.4; }
.google-map { position: absolute; inset: 0; display: none; }
.map-canvas.is-google .google-map { display: block; }
.map-canvas.is-google .map-grid { display: none; }
.map-canvas.is-google .map-empty { z-index: 4; background: rgba(255,255,255,.88); }
.map-actions { position: absolute; z-index: 5; top: 10px; left: 10px; display: flex; gap: 6px; padding: 5px; border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 5px 16px rgba(11,37,69,.18); }
.map-actions[hidden] { display: none; }
.map-actions button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--navy); font: 750 .72rem/1 Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.map-actions button:hover, .map-actions button:focus-visible { border-color: #76a9dd; background: var(--wash); outline: none; }
.map-grid { position: absolute; inset: 0; opacity: .42; background-image: linear-gradient(rgba(36,92,124,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(36,92,124,.12) 1px, transparent 1px); background-size: 44px 44px; }
.map-grid::after { content: "NORTE\A\A CENTRO\A\A SUR"; white-space: pre; position: absolute; left: 14px; top: 16px; color: rgba(16,56,80,.38); font-size: .64rem; font-weight: 850; letter-spacing: .12em; line-height: 15.5; }
.map-marker { position: absolute; transform: translate(-50%, -50%); width: var(--marker-size); height: var(--marker-size); display: grid; place-items: center; border: 3px solid white; border-radius: 50%; background: var(--blue); color: white; box-shadow: 0 8px 18px rgba(11,37,69,.28); font-size: .69rem; font-weight: 850; transition: transform .15s, box-shadow .15s; }
.map-marker:hover, .map-marker:focus { z-index: 3; transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 10px 24px rgba(11,37,69,.38); outline: none; }
.map-tooltip { position: absolute; z-index: 8; width: 220px; padding: 11px 12px; border-radius: 12px; background: rgba(11,37,69,.96); color: white; box-shadow: var(--shadow); pointer-events: none; }
.map-tooltip strong, .map-tooltip span { display: block; }
.map-tooltip span { margin-top: 3px; color: rgba(255,255,255,.72); font-size: .76rem; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.map-caption { margin: 9px 2px 0; color: var(--muted); font-size: .74rem; }
.google-project-marker { min-width: 31px; height: 31px; display: grid; place-items: center; padding: 0 8px; border: 3px solid white; border-radius: 999px; background: var(--blue); color: white; box-shadow: 0 6px 16px rgba(11,37,69,.3); font: 850 .72rem/1 Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.google-project-marker:hover, .google-project-marker:focus-visible { transform: scale(1.12); box-shadow: 0 9px 20px rgba(11,37,69,.4); outline: 3px solid rgba(22,103,197,.25); }
.map-property-card { min-width: 245px; max-width: 290px; color: var(--ink); font: 500 .78rem/1.35 Inter, ui-sans-serif, system-ui, sans-serif; }
.map-property-card h3 { margin: 0 0 3px; color: var(--navy); font-size: .95rem; }
.map-property-card > p { margin: 0 0 9px; color: var(--muted); }
.map-property-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.map-property-grid span { padding: 6px; border-radius: 7px; background: var(--wash); }
.map-property-grid small, .map-property-grid strong { display: block; }
.map-property-grid small { color: var(--muted); font-size: .63rem; }
.map-property-grid strong { margin-top: 1px; font-size: .75rem; }
.map-property-action { width: 100%; margin-top: 9px; padding: 8px; border: 0; border-radius: 8px; background: var(--blue); color: white; font-weight: 800; cursor: pointer; }
.property-gallery { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; margin: 0 0 14px; }
.property-gallery img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: var(--wash); }
.property-gallery img:first-child { height: 170px; grid-row: span 2; }

.property-list { display: grid; gap: 10px; margin-top: 14px; }
.property-card { position: relative; display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 13px; align-items: center; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: white; color: inherit; text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.property-card:hover, .property-card:focus-visible { border-color: #99bce4; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(25,58,91,.09); outline: none; }
.card-visual { min-height: 82px; display: grid; place-items: end start; padding: 10px; border-radius: 11px; background: linear-gradient(145deg, var(--card-a), var(--card-b)); color: white; overflow: hidden; }
.card-visual-photo { background-position: center; background-size: cover; }
.card-visual-reference { background-size: contain; background-repeat: no-repeat; background-color: #102b43; }
.map-canvas.is-google > .map-marker { display: none; }
.card-visual span { max-width: 100%; font-size: .66rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; word-break: break-word; }
.card-body { min-width: 0; }
.card-topline { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: var(--muted); font-size: .73rem; }
.status { color: var(--success); font-weight: 850; }
.card-body h3 { margin: 0; overflow: hidden; color: var(--ink); font-size: .98rem; white-space: nowrap; text-overflow: ellipsis; }
.card-body p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.condition-preview { display: grid; gap: 3px; margin-top: 8px; color: #9b4328; font-size: .7rem; font-weight: 800; line-height: 1.25; }
.condition-preview span { display: block; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag { padding: 4px 7px; border-radius: 7px; background: var(--wash); color: #43566c; font-size: .68rem; font-weight: 750; }
.card-price { min-width: 96px; text-align: right; }
.card-price span, .card-price small { display: block; }
.card-price span { font-size: 1.08rem; font-weight: 880; }
.card-price small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 7px 0 0; }
.load-more { display: block; margin: 16px auto 2px; }

.property-dialog { width: min(680px, calc(100% - 28px)); max-height: min(820px, calc(100vh - 28px)); padding: 0; overflow: auto; border: 0; border-radius: 20px; color: var(--ink); box-shadow: 0 28px 80px rgba(0,25,55,.32); }
.property-dialog::backdrop { background: rgba(5,20,38,.58); backdrop-filter: blur(4px); }
.dialog-close { position: sticky; z-index: 2; top: 12px; float: right; margin: 12px 12px -48px 0; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); font-size: 1.4rem; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.dialog-hero { min-height: 210px; display: flex; align-items: end; padding: 28px; background: linear-gradient(135deg, #0b2545, #1667c5 62%, #1b9aaa); background-position: center; background-size: cover; color: white; }
.dialog-hero .eyebrow { color: #7de3ec; }
.dialog-hero h2 { margin: 5px 0 0; max-width: 540px; font-size: 1.75rem; line-height: 1.1; }
.dialog-body { padding: 24px 28px 30px; }
.dialog-price { display: grid; gap: 3px; margin: 0 0 18px; }
.dialog-price strong { font-size: 1.5rem; font-weight: 900; }
.dialog-price span { color: var(--navy); font-size: 1.05rem; font-weight: 800; }
.dialog-price small { color: var(--muted); font-size: .72rem; font-weight: 550; }
.price-breakdown { display: grid; gap: 8px; margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.price-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); }
.price-breakdown > div strong { color: var(--ink); text-align: right; }
.price-breakdown .price-final { padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 800; }
.price-breakdown .price-final strong { color: var(--navy); font-size: 1.15rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-item { padding: 12px; border-radius: 11px; background: var(--wash); }
.detail-item small, .detail-item strong { display: block; }
.detail-item small { color: var(--muted); font-size: .7rem; }
.detail-item strong { margin-top: 4px; font-size: .88rem; }
.dialog-location { margin: 18px 0; color: var(--muted); line-height: 1.55; }
.commercial-box { display: grid; gap: 8px; margin: 20px 0; padding: 17px; border: 1px solid #efc7b7; border-radius: 14px; background: #fff5f0; }
.commercial-box strong { color: #6f2e1d; font-size: .95rem; line-height: 1.4; }
.benefits { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.dialog-actions a { text-decoration: none; }
.button-secondary { background: white; color: var(--navy); border: 1px solid var(--line); box-shadow: none; }
.toast { position: fixed; z-index: 80; right: 20px; bottom: 20px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: white; box-shadow: var(--shadow); font-size: .86rem; }
.footer { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 22px clamp(18px, 4vw, 54px); border-top: 1px solid var(--line); background: white; color: var(--muted); font-size: .75rem; }
.footer a { color: var(--blue); }

@media (max-width: 1350px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .brand { flex: 1 1 620px; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; }
  .filters { top: 170px; max-height: calc(100vh - 190px); }
  .map-panel { top: 170px; }
}

@media (max-width: 1120px) {
  .content-grid { grid-template-columns: 1fr; }
  .map-panel { position: relative; top: auto; }
  .map-canvas { height: 420px; min-height: 380px; }
}

@media (max-width: 820px) {
  .topbar { min-height: 64px; }
  .update-pill { display: none; }
  .brand { flex: 1 1 100%; }
  .top-actions { justify-content: space-between; width: 100%; }
  .header-advisor { padding: 9px 11px; font-size: .82rem; }
  .button-ghost { padding: 9px 11px; font-size: .82rem; }
  .intro-copy { width: min(78%, 720px); }
  .workspace { grid-template-columns: 1fr; }
  .mobile-filter-button { display: block; width: 100%; margin-bottom: 10px; padding: 11px; border: 1px solid var(--line); background: white; color: var(--navy); font-weight: 800; }
  .filters { position: relative; top: auto; display: none; max-height: none; }
  .filters.is-open { display: block; }
  .results-toolbar { align-items: flex-start; }
  .sort-control span { display: none; }
}

@media (max-width: 560px) {
  .app-shell { padding: 12px 10px 24px; }
  .brand-logo { width: 165px; height: 64px; }
  .brand-product { display: grid; padding-left: 10px; gap: 3px; }
  .brand-product strong { font-size: .94rem; }
  .brand-tagline { font-size: .68rem; }
  .header-stock-summary { font-size: .65rem; }
  .intro-copy { padding: 24px 20px; }
  .intro-copy { width: 88%; }
  .intro-copy h1 { font-size: 1.72rem; }
  .map-panel, .list-panel { padding: 12px; }
  .map-canvas { min-height: 340px; height: 48vh; }
  .property-card { grid-template-columns: 68px minmax(0, 1fr); }
  .card-visual { min-height: 72px; }
  .card-price { grid-column: 2; min-width: 0; text-align: left; }
  .card-price small { display: inline; margin-left: 6px; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .dialog-body { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
