/* ==========================================================================
   SECCIÓN: VER LOTES (SOLO CONSULTA) - NOVA BIENES RAÍCES
   Diseño integrado con la paleta de colores oficial:
   - Fondo general: --bg (#F8F7F4) / --surface (#FFFFFF)
   - Bordes y líneas: --line (#E4DFD3)
   - Acentos: Dorado (--accent #C9A227 / --accent-dark #9C7B1B)
   - Textos: Marino (--dark #0A162E) y Muted (--muted #5C6470)
   - Cero Layout Shift: Alturas fijas constantes con scroll interno fluido
   ========================================================================== */

:root {
  --lotes-fixed-height: 680px;
}

.lotes-section {
  padding: 80px 0;
  background-color: var(--surface, #FFFFFF);
  position: relative;
  border-top: 1px solid var(--line, #E4DFD3);
  border-bottom: 1px solid var(--line, #E4DFD3);
}

/* Contenedor amplio para que la información respire y no quede comprimida */
.lotes-container-wide {
  max-width: 1480px;
  width: 95%;
  margin: 0 auto;
  padding: 0 24px;
}

.lotes-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px auto;
}

.lotes-header .eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent, #C9A227);
  margin-bottom: 8px;
}

.lotes-header h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--dark, #0A162E);
  margin-bottom: 12px;
  line-height: 1.25;
}

.lotes-header p {
  color: var(--muted, #5C6470);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   BARRA DE FILTROS RÁPIDOS
   -------------------------------------------------------------------------- */
.lotes-filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg, #F8F7F4);
  padding: 14px 22px;
  border-radius: 16px;
  border: 1px solid var(--line, #E4DFD3);
  margin-bottom: 28px;
}

.lotes-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lotes-filter-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #5C6470);
  margin-right: 4px;
}

.lotes-pill-btn {
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
  color: var(--text, #0B1220);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lotes-pill-btn:hover {
  background: var(--soft, #F1EEE6);
  border-color: #D3CDC0;
}

.lotes-pill-btn.active {
  background: var(--dark, #0A162E);
  color: #FFFFFF;
  border-color: var(--dark, #0A162E);
  box-shadow: 0 4px 12px rgba(10, 22, 46, 0.15);
}

.lotes-pill-btn .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pill-dot--disp { background-color: #10B981; }
.pill-dot--apart { background-color: #F59E0B; }
.pill-dot--vend { background-color: #EF4444; }

.lotes-summary-counter {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted, #5C6470);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lotes-summary-counter span.badge-num {
  background: var(--accent-soft, #FBF3DE);
  color: var(--accent-dark, #9C7B1B);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   CUADRÍCULA PRINCIPAL (ESPACIO AMPLIO, ALTURA FIJA SIN LAYOUT SHIFT)
   -------------------------------------------------------------------------- */
.lotes-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: start;
  height: var(--lotes-fixed-height);
  min-height: var(--lotes-fixed-height);
  max-height: var(--lotes-fixed-height);
}

@media (max-width: 1100px) {
  .lotes-layout-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    max-height: none;
  }
}

/* --------------------------------------------------------------------------
   TARJETA DEL VISOR (ARMONIZADA CON LA PALETA DE COLORES - CERO CAJA AZUL)
   -------------------------------------------------------------------------- */
.lotes-viewer-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid var(--line, #E4DFD3);
  box-shadow: 0 16px 40px rgba(10, 22, 46, 0.07);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: var(--lotes-fixed-height);
  min-height: var(--lotes-fixed-height);
  max-height: var(--lotes-fixed-height);
  box-sizing: border-box;
}

.lotes-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg, #F8F7F4);
  border-bottom: 1px solid var(--line, #E4DFD3);
  z-index: 10;
  height: 56px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.lotes-viewer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark, #0A162E);
}

.lotes-viewer-title svg {
  color: var(--accent, #C9A227);
}

.lotes-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line, #E4DFD3);
  box-shadow: 0 2px 6px rgba(10, 22, 46, 0.04);
}

.lotes-zoom-btn {
  background: transparent;
  border: none;
  color: var(--dark, #0A162E);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lotes-zoom-btn:hover {
  background: var(--soft, #F1EEE6);
  color: var(--accent-dark, #9C7B1B);
}

.lotes-zoom-btn:active {
  transform: scale(0.92);
}

.lotes-zoom-level {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark, #0A162E);
  padding: 0 6px;
  min-width: 44px;
  text-align: center;
}

/* ÁREA DE VISUALIZACIÓN ENMARCADA (FONDO ARQUITECTÓNICO CÁLIDO Y NAVEGABLE) */
.lotes-viewport-framed {
  position: relative;
  width: 100%;
  height: calc(var(--lotes-fixed-height) - 56px);
  flex: 1;
  background-color: #FAF8F5;
  background-image: radial-gradient(circle, rgba(10, 22, 46, 0.08) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
  box-sizing: border-box;
}

.lotes-viewport-framed.is-panning {
  cursor: grabbing !important;
}

.lotes-canvas-wrap {
  position: relative;
  display: inline-block;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  margin: auto;
  box-shadow: 0 12px 36px rgba(10, 22, 46, 0.14);
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
}

.lotes-blueprint-img {
  display: block;
  max-height: 560px;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.lotes-blueprint-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* POLÍGONOS DE LOTES */
.lote-polygon {
  cursor: pointer;
  transition: fill 0.2s ease, stroke-width 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  vector-effect: non-scaling-stroke;
}

.lote-polygon.status-disponible {
  fill: rgba(16, 185, 129, 0.42);
  stroke: #10B981;
  stroke-width: 2;
  stroke-dasharray: 6 3;
}

.lote-polygon.status-apartado {
  fill: rgba(245, 158, 11, 0.42);
  stroke: #F59E0B;
  stroke-width: 2;
  stroke-dasharray: 6 3;
}

.lote-polygon.status-vendido {
  fill: rgba(239, 68, 68, 0.42);
  stroke: #EF4444;
  stroke-width: 2;
  stroke-dasharray: 6 3;
}

.lote-polygon:hover {
  fill-opacity: 0.72;
  stroke-width: 3;
  stroke-dasharray: 8 4;
  filter: drop-shadow(0 0 8px rgba(10, 22, 46, 0.3));
}

.lote-polygon.selected {
  stroke: #0284C7 !important;
  stroke-width: 3.5 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 10px rgba(2, 132, 199, 0.7)) !important;
  fill-opacity: 0.78 !important;
}

.lote-polygon.dimmed {
  opacity: 0.12 !important;
  pointer-events: none !important;
}

/* ETIQUETAS CENTRADAS */
.lote-svg-label {
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}

.lote-label-bg {
  fill: var(--dark, #0A162E);
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 0.8;
  rx: 4px;
  ry: 4px;
  transition: all 0.2s ease;
}

.lote-label-text {
  fill: #FFFFFF;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.lote-svg-label:hover .lote-label-bg {
  fill: var(--accent, #C9A227);
  stroke: #FFFFFF;
}

.lote-svg-label:hover .lote-label-text {
  fill: #0A162E;
}

.lote-svg-label.dimmed {
  opacity: 0.12;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   COLUMNA Y TARJETA LATERAL DE DETALLES (ALTURA FIJA Y SCROLL INTERNO)
   -------------------------------------------------------------------------- */
.lotes-detail-col {
  height: var(--lotes-fixed-height);
  min-height: var(--lotes-fixed-height);
  max-height: var(--lotes-fixed-height);
  display: flex;
  box-sizing: border-box;
}

.lotes-detail-card {
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(10, 22, 46, 0.07);
  padding: 26px 28px;
  height: var(--lotes-fixed-height);
  min-height: var(--lotes-fixed-height);
  max-height: var(--lotes-fixed-height);
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Contenedores de estado: altura fija al 100% */
.lotes-detail-empty,
.lotes-detail-active {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Encabezados fijos de cada estado */
.lotes-detail-top,
.lotes-detail-top-static {
  flex-shrink: 0;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #E4DFD3);
}

.lotes-detail-title-group h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.65rem;
  color: var(--dark, #0A162E);
  line-height: 1.2;
}

.lotes-detail-subtitle {
  font-size: 0.88rem;
  color: var(--muted, #5C6470);
  font-weight: 500;
  display: block;
  margin-top: 3px;
}

.lotes-empty-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--accent-soft, #FBF3DE);
  color: var(--accent-dark, #9C7B1B);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.lotes-empty-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  color: var(--dark, #0A162E);
  margin-bottom: 6px;
  line-height: 1.25;
}

.lotes-empty-desc {
  font-size: 0.92rem;
  color: var(--muted, #5C6470);
  line-height: 1.5;
  margin: 0;
}

/* CUERPO CENTRAL CON SCROLL INTERNO (EVITA CUALQUIER LAYOUT SHIFT) */
.lotes-detail-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(10, 22, 46, 0.22) transparent;
}

.lotes-detail-scroll-body::-webkit-scrollbar {
  width: 6px;
}

.lotes-detail-scroll-body::-webkit-scrollbar-track {
  background: transparent;
}

.lotes-detail-scroll-body::-webkit-scrollbar-thumb {
  background: rgba(10, 22, 46, 0.2);
  border-radius: 4px;
}

.lotes-detail-scroll-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark, #9C7B1B);
}

/* Grid de métricas generales (4 columnas o 2x2) */
.lotes-metrics-grid--4col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.lotes-metric-box {
  background: var(--bg, #F8F7F4);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #E4DFD3);
}

.lotes-metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #5C6470);
  margin-bottom: 3px;
  display: block;
}

.lotes-metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark, #0A162E);
}

.highlight-price {
  color: var(--accent-dark, #9C7B1B) !important;
}

.highlight-gold {
  color: var(--dark, #0A162E) !important;
}

/* Bloque de Infraestructura & Servicios */
.lotes-features-block {
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.lotes-block-subtitle {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark, #0A162E);
  margin-bottom: 10px;
}

.lotes-services-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lotes-service-tag {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--dark, #0A162E);
  background: var(--bg, #F8F7F4);
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #E4DFD3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Banner de Resumen Comercial */
.lotes-stats-banner {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.lotes-stat-chip {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip-disp {
  background: #DCFCE7;
  color: #15803D;
  border-color: #86EFAC;
}

.chip-apart {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FCD34D;
}

.chip-vend {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

/* Prompt en estado vacío (fijo al pie) */
.lotes-empty-prompt {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg, #F8F7F4);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px dashed var(--accent, #C9A227);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark, #9C7B1B);
  margin-top: auto;
}

/* Cuadro de Medidas y Linderos */
.lotes-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--bg, #F8F7F4);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line, #E4DFD3);
  margin-bottom: 16px;
}

.lotes-spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted, #5C6470);
}

.spec-val {
  font-size: 0.92rem;
  color: var(--dark, #0A162E);
  font-weight: 600;
}

/* Notas del lote */
.lotes-notes-box {
  background: #FBF3DE;
  border-left: 3px solid var(--accent, #C9A227);
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: #584615;
  margin-bottom: 16px;
  line-height: 1.5;
}

.lotes-notes-box strong {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-dark, #9C7B1B);
  margin-bottom: 3px;
}

/* Servicios a pie de lote */
.lotes-lot-services {
  margin-bottom: 12px;
}

.lotes-mini-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted, #5C6470);
  margin-bottom: 8px;
}

.lotes-service-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-sm {
  font-size: 0.78rem;
  font-weight: 500;
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--dark, #0A162E);
}

/* Badges de estado */
.lotes-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lotes-status-tag--disponible {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.lotes-status-tag--apartado {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.lotes-status-tag--vendido {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

/* Botones de acción (fijos al pie del card activo) */
.lotes-card-actions {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 6px;
}

.lotes-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lotes-action-btn--wa {
  background: var(--whatsapp, #216E49);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 6px 20px rgba(33, 110, 73, 0.25);
}

.lotes-action-btn--wa:hover {
  background: var(--whatsapp-hover, #19583A);
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(33, 110, 73, 0.35);
  color: #FFFFFF;
}

.lotes-action-btn--disabled {
  background: #E2E8F0;
  color: #94A3B8;
  border: 1px solid #CBD5E1;
  cursor: not-allowed;
}

.btn-deselect-lot {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--muted, #5C6470);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 8px;
  margin-top: 4px;
  cursor: pointer;
  transition: color 0.15s ease;
  text-decoration: underline;
}

.btn-deselect-lot:hover {
  color: var(--dark, #0A162E);
}

/* --------------------------------------------------------------------------
   RESPONSIVIDAD Y AJUSTES MÓVILES
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .lotes-section {
    padding: 50px 0;
  }

  .lotes-container-wide {
    padding: 0 16px;
  }

  .lotes-viewer-card {
    height: 480px;
    min-height: 480px;
    max-height: 480px;
  }

  .lotes-viewport-framed {
    height: calc(480px - 56px);
  }

  .lotes-blueprint-img {
    max-height: 400px;
  }

  .lotes-detail-col,
  .lotes-detail-card {
    height: 560px;
    min-height: 560px;
    max-height: 560px;
  }

  .lotes-filters-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   SELECTOR DE SECTORES / FRACCIONAMIENTOS
   -------------------------------------------------------------------------- */
.lotes-sector-selector-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sector-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--line, #E4DFD3);
  padding: 10px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark, #0A162E);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(10, 22, 46, 0.04);
}

.sector-tab-btn:hover {
  border-color: var(--accent, #C9A227);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.15);
}

.sector-tab-btn.active {
  background: var(--dark, #0A162E);
  border-color: var(--dark, #0A162E);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(10, 22, 46, 0.2);
}

.sector-tab-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent-dark, #9C7B1B);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.sector-tab-btn.active .sector-tab-badge {
  background: var(--accent, #C9A227);
  color: #0A162E;
}

/* Resumen de Financiamiento */
.lotes-financing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.financing-chip {
  flex: 1;
  min-width: 135px;
  background: #FFFFFF;
  border: 1px solid var(--line, #E4DFD3);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(10, 22, 46, 0.03);
}

.fin-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted, #6B7280);
  font-weight: 600;
}

.fin-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark, #0A162E);
}

.text-gold {
  color: #B48A14 !important;
}

.mt-2 {
  margin-top: 12px;
}

