:root {
  --bg: #f6f1e8;
  --panel: #fffaf0;
  --text: #1d1d1b;
  --muted: #69645a;
  --brand: #111111;
  --gold: #d6b44d;
  --gold-soft: #f0df9f;
  --line: #e7dcc4;
  --soft: #f4ead5;
  --whatsapp: #1fa855;
  --whatsapp-dark: #158543;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  min-height: 96px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(214, 180, 77, .28), transparent 32%),
    linear-gradient(135deg, #080808, #231d12);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 118px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0,0,0,.18);
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  color: var(--gold-soft);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  color: #fff;
}

.hero-button,
.info-button,
.card-actions a,
.whatsapp-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--whatsapp);
  color: white;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(31, 168, 85, .28);
  cursor: pointer;
}

.hero-button:hover,
.info-button:hover,
.whatsapp-card-button:hover {
  background: var(--whatsapp-dark);
}

.layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  min-height: calc(100vh - 99px);
}

.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px;
  overflow: auto;
  max-height: calc(100vh - 99px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  margin: 0 0 14px;
}

#clearFilters,
.card-actions button:not(.whatsapp-card-button) {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 900;
}

.card-actions button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: #eee7d7;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 900;
  margin-bottom: 12px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: white;
  color: var(--text);
  font-size: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.dot.casa { background: #C8A24A; }
.dot.depa { background: #19313A; }
.dot.local { background: #8B6F2E; }
.dot.terreno { background: #496B42; }
.dot.inversion { background: #B88A2E; }

.summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: linear-gradient(135deg, #fff, var(--soft));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin: 16px 0;
}

.summary strong {
  font-size: 30px;
  color: var(--gold);
}

.cards {
  display: grid;
  gap: 12px;
}

.property-card,
.empty {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: white;
  box-shadow: 0 10px 28px rgba(29, 29, 27, .07);
}

.property-card.featured {
  border-color: var(--gold);
  box-shadow: 0 14px 34px rgba(200, 162, 74, .22);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.property-card h3 {
  margin: 0 0 6px;
}

.property-card p {
  margin: 5px 0;
  color: var(--muted);
}

.property-card .price {
  color: var(--brand);
  font-weight: 900;
  font-size: 20px;
}

.small {
  font-size: 13px;
}

.location-badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  margin: 4px 0;
}

.location-badge.exact {
  background: #edf8f0;
  color: #137a3a;
}

.location-badge.approx {
  background: #fff5dd;
  color: #8b6100;
}

.location-badge.private {
  background: #f3ece2;
  color: #5d5040;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-actions button,
.card-actions a {
  flex: 1;
  font-size: 13px;
  padding: 10px;
}

.map-wrap {
  position: relative;
  min-height: 600px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 99px);
}

.loading {
  position: absolute;
  inset: 16px auto auto 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(29, 29, 27, .15);
  font-weight: 900;
}

.info-card {
  max-width: 310px;
  color: var(--text);
}

.info-card h3 {
  margin: 0 0 6px;
}

.info-card p {
  margin: 6px 0;
}

.info-img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.info-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.dev-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 4px;
  background: white;
}

.info-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.info-button,
.info-secondary-button {
  width: 100%;
  border-radius: 999px;
  padding: 11px 14px;
  text-align: center;
  font-weight: 900;
  text-decoration: none;
}

.info-secondary-button {
  color: var(--brand);
  border: 1px solid var(--gold);
  background: #fff9e8;
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    padding: 14px 18px;
  }

  .brand {
    align-items: center;
  }

  .brand-logo {
    width: 100px;
    height: 54px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #map {
    min-height: 620px;
  }
}


/* ===== Ajustes V5.1: mejor experiencia en celular ===== */
@media (max-width: 900px) {
  body {
    background: #fffaf0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 72px;
    grid-template-columns: 1fr auto;
    display: grid;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand-logo {
    width: 70px;
    height: 42px;
    border-radius: 9px;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: .08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
  }

  h1 {
    font-size: 20px;
  }

  .hero-button {
    padding: 10px 12px;
    font-size: 13px;
  }

  .layout {
    display: flex;
    flex-direction: column;
  }

  .panel {
    order: 1;
    padding: 12px;
    max-height: none;
  }

  .map-wrap {
    order: 2;
    min-height: 62vh;
  }

  #map {
    min-height: 62vh;
  }

  .panel-header h2 {
    font-size: 20px;
  }

  label {
    margin-bottom: 9px;
    font-size: 13px;
  }

  select {
    padding: 10px 11px;
    font-size: 14px;
  }

  .legend {
    gap: 6px;
    margin: 10px 0;
  }

  .summary {
    margin: 12px 0;
    padding: 11px 12px;
  }

  .summary strong {
    font-size: 24px;
  }

  .property-card {
    padding: 12px;
    border-radius: 16px;
  }

  .property-card h3 {
    font-size: 17px;
  }

  .property-card .price {
    font-size: 18px;
  }

  .card-actions {
    gap: 6px;
  }

  .card-actions button,
  .card-actions a {
    padding: 9px 8px;
    font-size: 12px;
  }
}


/* ===== V5.5 MOBILE UX: mapa primero en celular ===== */
.mobile-map-jump {
  display: none;
}

@media (max-width: 900px) {
  html {
    scroll-behavior: smooth;
  }

  body {
    overflow-x: hidden;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .layout {
    display: flex !important;
    flex-direction: column !important;
  }

  .map-wrap {
    order: 1 !important;
    width: 100%;
    min-height: 46vh !important;
    height: 46vh !important;
    position: sticky;
    top: 72px;
    z-index: 35;
    border-bottom: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
  }

  #map {
    min-height: 46vh !important;
    height: 46vh !important;
  }

  .panel {
    order: 2 !important;
    width: 100%;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px;
  }

  .panel-header {
    position: sticky;
    top: calc(72px + 46vh);
    z-index: 30;
    background: #fff8e8;
    border-radius: 0 0 16px 16px;
    padding: 10px 0 8px;
  }

  .mobile-map-jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    margin: 8px 0 10px;
    background: #16362f;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
  }

  .filters,
  .filter-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  label {
    margin-bottom: 0 !important;
    font-size: 12px !important;
  }

  label span,
  label strong {
    display: block;
    margin-bottom: 4px;
  }

  select {
    min-height: 38px;
    padding: 8px 9px !important;
    font-size: 13px !important;
  }

  .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .summary {
    margin: 8px 0 10px !important;
  }

  .property-card {
    scroll-margin-top: calc(72px + 46vh + 72px);
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .card-actions button,
  .card-actions a {
    min-height: 38px;
  }

  .gm-style-iw {
    max-width: 92vw !important;
  }

  .info-window {
    max-width: 84vw;
  }
}

@media (max-width: 520px) {
  .map-wrap {
    top: 66px;
    height: 43vh !important;
    min-height: 43vh !important;
  }

  #map {
    height: 43vh !important;
    min-height: 43vh !important;
  }

  .panel-header {
    top: calc(66px + 43vh);
  }

  .filters,
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-logo {
    width: 62px !important;
    height: 38px !important;
  }

  h1 {
    font-size: 18px !important;
  }

  .hero-button {
    padding: 9px 10px !important;
    font-size: 12px !important;
  }
}


/* ===== V5.6: pines compactos + imágenes opcionales ===== */
.card-img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  display: block;
  border-radius: 15px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #111, #2f2717);
  border: 1px solid rgba(214, 180, 77, .28);
}

.info-img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(214, 180, 77, .28);
}

@media (max-width: 900px) {
  .card-img {
    height: 86px;
    border-radius: 12px;
    margin-bottom: 8px;
  }

  .info-img {
    max-height: 125px;
  }
}


/* ===== V5.8: pin sólido compacto + popup equilibrado ===== */
@media (max-width: 900px) {
  .info-card {
    max-width: 82vw;
  }

  .info-img {
    max-height: 105px !important;
    object-fit: cover;
  }
}

@media (min-width: 901px) {
  .info-img {
    max-height: 135px !important;
    object-fit: cover;
  }
}


/* ===== V5.12: filtros rápidos ordenados y campo Otro controlado ===== */
.panel-fast-filters {
  padding: 18px;
}

.fast-panel-header {
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 900;
}

.fast-section {
  margin: 13px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(231, 220, 196, .75);
}

.fast-section h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
}

.fast-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.budget-grid,
.credit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fast-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  border-radius: 13px;
  padding: 9px 8px;
  min-height: 42px;
  font-size: 12.5px;
  line-height: 1.12;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.fast-chip:hover {
  border-color: var(--gold);
}

.fast-chip.active {
  background: linear-gradient(135deg, #d7b85b, #b98c2f);
  border-color: #b98c2f;
  color: #17130b;
  box-shadow: 0 10px 20px rgba(200, 162, 74, .22);
}

.other-credit-box {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.other-credit-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: #efe7d8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.other-credit-box input.enabled {
  background: #fff;
  color: var(--text);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 180, 77, .12);
}

.other-credit-box small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.more-filters {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  overflow: hidden;
}

.more-filters summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  position: relative;
  font-weight: 900;
}

.more-filters summary::-webkit-details-marker {
  display: none;
}

.more-filters summary::after {
  content: '+';
  position: absolute;
  right: 15px;
  top: 12px;
  color: var(--gold);
  font-size: 20px;
}

.more-filters[open] summary::after {
  content: '–';
}

.more-filters summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding-right: 28px;
}

.advanced-filters {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.sr-only-filter {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 12px;
}

.active-filters span {
  display: inline-flex;
  border-radius: 999px;
  background: #141414;
  color: #fff;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.panel-fast-filters .legend {
  display: none;
}

@media (max-width: 900px) {
  .panel-fast-filters {
    padding: 12px;
  }

  .panel-fast-filters .panel-header {
    position: static !important;
    top: auto !important;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .fast-section {
    margin: 11px 0;
    padding-bottom: 10px;
  }

  .fast-section h3 {
    font-size: 13px;
  }

  .type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .budget-grid,
  .credit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fast-chip {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 12px;
  }

  .advanced-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (max-width: 520px) {
  .type-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .budget-grid,
  .credit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-filters {
    grid-template-columns: 1fr;
  }
}


/* ===== V5.13: pulido visual premium + iconos en filtros rápidos ===== */
:root {
  --v513-gold: #c9a24a;
  --v513-gold-dark: #a57a22;
  --v513-ink: #111111;
  --v513-soft: #fbf7ee;
  --v513-line: #e8ddc8;
  --v513-muted: #6f675b;
}

/* Letra un poco más fina y elegante en panel */
.panel-fast-filters {
  background: linear-gradient(180deg, #fffaf0 0%, #fbf6eb 100%);
}

.panel-fast-filters,
.panel-fast-filters button,
.panel-fast-filters input,
.panel-fast-filters select {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fast-panel-header h2,
.panel-fast-filters .panel-header h2 {
  font-weight: 800 !important;
  letter-spacing: .01em;
  line-height: 1.06;
}

.panel-kicker {
  font-size: 10.5px !important;
  letter-spacing: .18em !important;
  color: var(--v513-gold-dark) !important;
}

.fast-section {
  padding-bottom: 13px !important;
  margin: 14px 0 !important;
}

.fast-section h3 {
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #1d1a14;
  margin-bottom: 9px !important;
}

/* Botones simétricos */
.fast-grid {
  gap: 8px !important;
}

.type-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.budget-grid,
.credit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.fast-chip {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border-radius: 12px !important;
  min-height: 43px !important;
  padding: 8px 8px !important;
  font-size: 12px !important;
  font-weight: 760 !important;
  letter-spacing: -.01em;
  background: rgba(255,255,255,.92) !important;
  border-color: var(--v513-line) !important;
  color: #17130b !important;
  box-shadow: 0 3px 10px rgba(15, 12, 8, .035) !important;
}

.fast-chip:hover {
  border-color: var(--v513-gold) !important;
  transform: translateY(-1px);
}

.fast-chip.active {
  background: linear-gradient(135deg, #d6b65a 0%, #ba8d2e 100%) !important;
  border-color: #b98b2e !important;
  color: #161106 !important;
  box-shadow: 0 10px 20px rgba(201, 162, 74, .22) !important;
}

.chip-icon {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.chip-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fast-chip.active .chip-icon svg {
  stroke-width: 2;
}

/* Presupuesto y crédito: texto más limpio */
.budget-grid .fast-chip,
.credit-grid .fast-chip {
  min-height: 40px !important;
  font-size: 12.2px !important;
}

/* Campo Otro: elegante y claramente desactivado */
.other-credit-box {
  margin-top: 10px !important;
}

.other-credit-box input {
  min-height: 39px;
  border-radius: 12px !important;
  background: #eee7da !important;
  border-color: #ded2bd !important;
  color: #8a8173 !important;
  font-weight: 650 !important;
  letter-spacing: -.01em;
}

.other-credit-box input.enabled {
  background: #fff !important;
  color: #17130b !important;
  border-color: var(--v513-gold) !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 74, .13) !important;
}

.other-credit-box input:disabled {
  cursor: not-allowed;
}

.other-credit-box small {
  color: var(--v513-muted) !important;
  font-weight: 600;
}

/* Más filtros más premium */
.more-filters {
  background: rgba(255,255,255,.82) !important;
  border-color: var(--v513-line) !important;
  box-shadow: 0 5px 16px rgba(15, 12, 8, .04);
}

.more-filters summary {
  padding: 13px 14px !important;
}

.more-filters summary span {
  font-size: 15px;
  font-weight: 850;
}

.more-filters summary small {
  color: var(--v513-muted) !important;
  font-weight: 620 !important;
}

.more-filters summary::after {
  color: var(--v513-gold-dark) !important;
  font-weight: 600;
}

.advanced-filters label {
  font-weight: 760 !important;
}

.advanced-filters select {
  border-color: var(--v513-line) !important;
}

/* Resumen más fino */
.summary {
  border-color: #eadfc9 !important;
  background: linear-gradient(180deg, #f5eddc 0%, #f0e6d2 100%) !important;
}

.summary strong {
  color: var(--v513-gold-dark) !important;
  font-weight: 850 !important;
}

/* Tags activos */
.active-filters span {
  background: #161410 !important;
  font-weight: 720 !important;
  letter-spacing: .01em;
}

/* Tarjetas: ajuste visual ligero para que combine con el panel refinado */
.property-card {
  border-color: rgba(232,221,200,.92) !important;
}

.property-card h3 {
  letter-spacing: -.02em;
}

/* Mobile: que se vea como app, sin aplastarse */
@media (max-width: 900px) {
  .panel-fast-filters {
    padding: 13px !important;
  }

  .fast-section {
    margin: 12px 0 !important;
    padding-bottom: 11px !important;
  }

  .fast-section h3 {
    font-size: 12.8px !important;
    margin-bottom: 8px !important;
  }

  .fast-grid {
    gap: 7px !important;
  }

  .fast-chip {
    min-height: 39px !important;
    padding: 7px 6px !important;
    font-size: 11.5px !important;
    border-radius: 11px !important;
  }

  .chip-icon {
    width: 16px;
    height: 16px;
  }

  .chip-icon svg {
    width: 16px;
    height: 16px;
  }

  .budget-grid .fast-chip,
  .credit-grid .fast-chip {
    min-height: 38px !important;
    font-size: 11.7px !important;
  }

  .other-credit-box input {
    min-height: 38px;
    font-size: 12px;
  }
}

/* Desktop: panel más ordenado visualmente */
@media (min-width: 901px) {
  .panel-fast-filters {
    padding: 20px 18px !important;
  }

  .fast-chip {
    white-space: nowrap;
  }
}


/* ===== V5.14: modal propio para nombre + crédito antes de WhatsApp ===== */
body.modal-open {
  overflow: hidden;
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.lead-modal.open {
  display: flex;
}

.lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 7, .62);
  backdrop-filter: blur(2px);
}

.lead-modal__card {
  position: relative;
  z-index: 1;
  width: min(460px, 96vw);
  background: linear-gradient(180deg, #fffaf0 0%, #fbf4e7 100%);
  border: 1px solid rgba(201, 162, 74, .34);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0,0,0,.38);
  padding: 24px;
  color: #15120c;
}

.lead-modal__close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(17,17,17,.06);
  color: #17130b;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lead-modal__kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #a57a22;
  font-weight: 900;
}

.lead-modal__card h2 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.lead-modal__text {
  margin: 0 0 18px;
  color: #6f675b;
  font-size: 14px;
  line-height: 1.42;
}

.lead-field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  font-size: 13px;
  font-weight: 850;
}

.lead-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e8ddc8;
  border-radius: 14px;
  padding: 11px 13px;
  background: #fff;
  color: #16130d;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}

.lead-field input:focus {
  border-color: #c9a24a;
  box-shadow: 0 0 0 3px rgba(201, 162, 74, .14);
}

.lead-credit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lead-credit-option {
  min-height: 42px;
  border: 1px solid #e8ddc8;
  border-radius: 14px;
  background: #fff;
  color: #17130b;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.035);
}

.lead-credit-option:hover {
  border-color: #c9a24a;
}

.lead-credit-option.active {
  background: linear-gradient(135deg, #d6b65a 0%, #ba8d2e 100%);
  border-color: #b98b2e;
  color: #161106;
  box-shadow: 0 10px 20px rgba(201, 162, 74, .22);
}

.lead-credit-option--wide {
  grid-column: span 2;
}

.lead-other-credit {
  display: none;
}

.lead-other-credit.active {
  display: grid;
}

.lead-other-credit input:disabled {
  background: #eee7da;
  color: #8a8173;
}

.lead-modal__error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #9a2f24;
  font-size: 12px;
  font-weight: 800;
}

.lead-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px;
  margin-top: 14px;
}

.lead-secondary,
.lead-primary {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid transparent;
}

.lead-secondary {
  background: #fff;
  color: #17130b;
  border-color: #e8ddc8;
}

.lead-primary {
  background: #18a34a;
  color: #fff;
  box-shadow: 0 12px 24px rgba(24, 163, 74, .24);
}

@media (max-width: 520px) {
  .lead-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .lead-modal__card {
    width: 100%;
    border-radius: 22px;
    padding: 20px;
  }

  .lead-modal__card h2 {
    font-size: 23px;
  }

  .lead-credit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lead-modal__actions {
    grid-template-columns: 1fr;
  }

  .lead-secondary {
    order: 2;
  }

  .lead-primary {
    order: 1;
  }
}


/* ===== V5.15: imágenes menos recortadas y popup más limpio ===== */

/* Imagen dentro del popup del mapa */
.info-img {
  object-fit: contain !important;
  object-position: center !important;
  background: #f4efe5 !important;
  border: 1px solid rgba(232, 221, 200, .92);
}

/* En escritorio puede respirar un poco más sin invadir */
@media (min-width: 901px) {
  .info-img {
    height: 128px !important;
    max-height: 128px !important;
    width: 100% !important;
  }

  .info-window,
  .info-card {
    max-width: 330px !important;
  }
}

/* En móvil se mantiene compacto para no tapar el mapa */
@media (max-width: 900px) {
  .info-img {
    height: 104px !important;
    max-height: 104px !important;
    width: 100% !important;
  }

  .info-window,
  .info-card {
    max-width: 84vw !important;
  }
}

/* Imagen de tarjeta/listado: visual, pero no invasiva */
.card-image,
.property-image,
.card-img,
.property-card img:first-child {
  object-fit: cover;
  object-position: center;
}

/* Si la tarjeta usa la clase card-image, controlamos altura */
.card-image,
.property-image,
.card-img {
  max-height: 118px;
}

/* Descripción en popup: evita que el popup crezca demasiado */
.info-window .description,
.info-card .description,
.info-window p.description,
.info-card p.description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Si el texto del popup no tiene clase description, evitamos exceso en párrafos largos */
.info-window p,
.info-card p {
  line-height: 1.35;
}

/* Para collages/flyers dentro del popup, contain ayuda a que no se corte el contenido */
.gm-style-iw img.info-img {
  object-fit: contain !important;
}


/* ===== V5.16: botón Ver imagen grande + modal de imagen ===== */
.info-actions {
  gap: 8px !important;
}

.info-secondary-button.js-view-image {
  text-align: center;
  cursor: pointer;
}

/* Modal de imagen grande */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.image-modal.open {
  display: flex;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 7, .72);
  backdrop-filter: blur(3px);
}

.image-modal__card {
  position: relative;
  z-index: 1;
  width: min(980px, 96vw);
  max-height: 92vh;
  margin: 0;
  padding: 14px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffaf0 0%, #f6efe1 100%);
  border: 1px solid rgba(201, 162, 74, .36);
  box-shadow: 0 32px 90px rgba(0,0,0,.45);
  display: grid;
  gap: 10px;
}

.image-modal__card img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #f1eadc;
  border-radius: 18px;
  border: 1px solid rgba(232, 221, 200, .95);
}

.image-modal__close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(17,17,17,.72);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.image-modal__close:hover {
  background: rgba(17,17,17,.92);
}

.image-modal__card figcaption {
  padding: 0 4px 2px;
  color: #17130b;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

@media (max-width: 900px) {
  .image-modal {
    padding: 10px;
  }

  .image-modal__card {
    width: 100%;
    max-height: 88vh;
    padding: 10px;
    border-radius: 20px;
  }

  .image-modal__card img {
    max-height: 72vh;
    border-radius: 15px;
  }

  .image-modal__card figcaption {
    font-size: 13px;
  }
}


/* ===== V5.17: imagen de tarjeta sin recorte fuerte + WhatsApp en nueva pestaña ===== */

/* Tarjetas laterales/listado: mostrar imagen completa para fachadas o portadas de desarrollo */
.property-card .card-image,
.property-card .property-image,
.property-card .card-img,
.card .card-image,
.card .property-image,
.card .card-img,
.property-card img:first-child,
.card img:first-child {
  object-fit: contain !important;
  object-position: center center !important;
  background: #f4efe5 !important;
  border: 1px solid rgba(232, 221, 200, .9);
}

/* Altura equilibrada: se ve más completa sin hacer eterna la lista */
@media (min-width: 901px) {
  .property-card .card-image,
  .property-card .property-image,
  .property-card .card-img,
  .card .card-image,
  .card .property-image,
  .card .card-img,
  .property-card img:first-child,
  .card img:first-child {
    height: 112px !important;
    max-height: 112px !important;
    width: 100% !important;
  }
}

@media (max-width: 900px) {
  .property-card .card-image,
  .property-card .property-image,
  .property-card .card-img,
  .card .card-image,
  .card .property-image,
  .card .card-img,
  .property-card img:first-child,
  .card img:first-child {
    height: 108px !important;
    max-height: 108px !important;
    width: 100% !important;
  }
}


/* ===== V5.18: popup móvil compacto, sin scroll incómodo ===== */

/* En celular, el popup debe servir para decidir rápido, no para mostrar todo el brochure */
@media (max-width: 900px) {
  /* Reducir contenedor interno de Google Maps */
  .gm-style .gm-style-iw-c {
    max-width: 88vw !important;
    max-height: none !important;
    padding: 0 !important;
    border-radius: 18px !important;
  }

  .gm-style .gm-style-iw-d {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Ocultamos la miniatura dentro del popup móvil para que los botones se vean sin hacer scroll */
  .gm-style-iw .info-img,
  .info-window .info-img,
  .info-card .info-img {
    display: none !important;
  }

  /* Compactamos el cuerpo */
  .info-window,
  .info-card {
    max-width: 88vw !important;
    padding: 14px 14px 12px !important;
    font-size: 12.5px !important;
  }

  .info-window h3,
  .info-card h3 {
    font-size: 18px !important;
    line-height: 1.12 !important;
    margin: 0 0 8px !important;
  }

  .info-window p,
  .info-card p {
    margin: 3px 0 !important;
    line-height: 1.25 !important;
  }

  /* En móvil mostramos solo lo más importante para que quepan los botones */
  .info-window .description,
  .info-card .description,
  .info-window p.description,
  .info-card p.description {
    display: none !important;
  }

  /* Botones siempre visibles y cómodos */
  .info-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .info-button,
  .info-secondary-button {
    min-height: 42px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-align: center !important;
  }

  /* El botón de cerrar de Google queda más cómodo */
  .gm-ui-hover-effect {
    top: 4px !important;
    right: 4px !important;
  }
}

/* En escritorio conservamos la experiencia con imagen y datos completos */
@media (min-width: 901px) {
  .info-window .info-img,
  .info-card .info-img {
    display: block;
  }
}


/* ===== V5.19: WhatsApp siempre en pestaña nueva, sin cerrar el mapa ===== */
/* No hay cambios visuales fuertes; solo se evita reemplazar la pestaña del mapa. */

/* SOTH Preview: acciones visibles sin ocultar datos comerciales del pin. */
.info-card .info-actions-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  margin: 8px 0 0;
}
.info-card .info-actions-compact .info-button,
.info-card .info-actions-compact .info-secondary-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 5px;
  font-size: 11px;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.info-card .info-actions-compact .js-view-image {
  grid-column: 1 / -1;
  min-height: 30px;
  padding: 5px;
  font-size: 11px;
  background: transparent;
}
.info-card .info-scroll-cue {
  margin: 4px 0 7px;
  font-size: 11px;
  color: #756a58;
  text-align: center;
}
.property-card .card-ficha-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  margin-top: 10px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #fff9e8;
  padding: 9px 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
.property-card .card-ficha-link:hover { filter: brightness(.97); }
.property-card .card-actions { margin-top: 7px; }
@media (max-width: 900px) {
  .info-card .info-actions-compact {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 6px !important;
  }
  .info-card .info-actions-compact .info-button,
  .info-card .info-actions-compact .info-secondary-button {
    min-height: 38px !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
  }
  .info-card .info-actions-compact .js-view-image {
    grid-column: 1 / -1;
    min-height: 30px !important;
  }
}

/* Ficha ampliada del mapa, independiente del catálogo web */
.map-detail-modal{display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;padding:16px}
.map-detail-modal.open{display:flex}
.map-detail-backdrop{position:absolute;inset:0;background:rgba(8,22,28,.77)}
.map-detail-panel{position:relative;background:#fff;color:#183039;border-radius:18px;width:min(680px,100%);max-height:92dvh;overflow:auto;padding:22px 24px 26px;box-shadow:0 20px 80px rgba(0,0,0,.3)}
.map-detail-close{position:sticky;top:0;float:right;border:0;border-radius:50%;width:38px;height:38px;background:#19313a;color:#fff;cursor:pointer;font-size:27px;z-index:2}
.map-detail-image{display:block;width:100%;max-height:370px;object-fit:contain;border-radius:12px;background:#f3f4f2;margin-bottom:18px}
.map-detail-panel h2{margin:10px 0 14px;font-size:1.5rem}
.map-detail-panel p{margin:10px 0;line-height:1.5}
.map-detail-description{white-space:pre-line}
.map-detail-whatsapp{display:block;width:100%;border:0;border-radius:10px;background:#167b49;color:#fff;padding:14px 16px;margin-top:20px;font-weight:700;cursor:pointer}
.property-card button.card-ficha-link{font:inherit;cursor:pointer}
.map-detail-model{border-top:1px solid #ddd;padding-top:16px;margin-top:20px}
.map-detail-model h3{margin:0 0 12px}
.map-detail-model a{display:inline-block;padding:10px 0;text-decoration:underline}
@media(max-width:600px){.map-detail-modal{padding:8px}.map-detail-panel{max-height:96dvh;padding:14px}.map-detail-image{max-height:260px}}


/* Ubicaciones compartidas: cada desarrollo conserva su ficha y filtros */
.shared-location{max-width:310px;padding:5px 2px}.shared-location p{margin:8px 0}.shared-location-choice{display:block;width:100%;margin:7px 0;padding:10px 12px;border:1px solid #bbc8c6;border-radius:9px;background:#fff;color:#183039;text-align:left;font:inherit;cursor:pointer}.shared-location-choice:hover,.shared-location-choice:focus{background:#eaf3f0;outline:2px solid #346d64;outline-offset:1px}

/* SOTH: navegación cruzada corporativo / catálogo / mapa */
.topbar-navigation { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.topbar-nav-link { color:#fff; text-decoration:none; border:1px solid rgba(214,180,77,.75); border-radius:999px; padding:10px 13px; font-weight:700; font-size:13px; background:rgba(255,255,255,.07); text-align:center; }
.topbar-nav-link:hover,.topbar-nav-link:focus-visible { background:rgba(214,180,77,.20); }
@media(max-width:900px) { .topbar { flex-wrap:wrap; gap:8px; } .topbar-navigation { width:100%; display:grid; grid-template-columns:1fr 1fr; gap:7px; } .topbar-nav-link { padding:8px 6px; font-size:12px; } .topbar-navigation .hero-button { grid-column:1/-1; justify-self:center; padding:8px 14px; font-size:12px; } }
