/* === OPTIMIZACIONES DE RENDIMIENTO Y VARIABLES CSS === */
:root {
  /* Paleta consolidada y optimizada */
  --forest-green-dark: #0b2e20;
  --primary-color: #e0b639;
  --secondary-color: #27503e;
  --accent-color: #eac736;
  --text-color: #1f2937;
  --muted-text: #6b7280;
  --light-gray: #f7f7f8;
  --medium-gray: #e6e6e6;
  --dark-gray: #4b5563;
  --white: #ffffff;
  --transition: all 0.25s ease;
  --shadow: 0 8px 24px rgba(2,6,23,0.08);
  --shadow-strong: 0 12px 40px rgba(2,6,23,0.12);
  --border-radius: 10px;
  
  /* Estados de lotes */
  --available-bg: #ffffff;
  --available-text: #111827;
  --reserved-bg: #f97316;
  --reserved-text: #ffffff;
  --sold-bg: #16a34a;
  --sold-text: #ffffff;
  --blocked-bg: #dc2626;
  --blocked-text: #ffffff;
  
  /* Colores de acción */
  --btn-muted: #6b7280;
  --btn-primary: #2563eb;
  --whatsapp: #25D366;
}

body {
  padding-top: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


@media (max-width: 768px) {
  .map-wrapper {
    height: 65vh; /* Aumentado para mejor visualización */
    min-height: 450px; /* Altura mínima mejorada */
  }
}
.footer {
  margin-top: auto;
  z-index: 10 !important;
}

.whatsapp-float {
  z-index: 9998 !important;
}

/* === Z-INDEX CONSOLIDADO === */
.info-panel,
.search-panel,
.areas-panel {
  z-index: 1010 !important;
}

.side-panels-section {
  position: relative;
  z-index: 995;
}

/* === CONTENEDORES PRINCIPALES === */
.map-container,
.map-wrapper {
  overflow: visible !important;
}

/* Deshabilitar animaciones SVG durante zoom para evitar polígonos flotantes */
.leaflet-zoom-animated {
  transition: none !important;
}

svg.leaflet-zoom-animated {
  transition: none !important;
}

/* Optimizaciones de rendimiento para el contenedor del mapa */
#map {
  /* Mantener la aceleración en el contenedor principal del mapa */
  transform: translateZ(0);
 
}

.leaflet-overlay-pane svg {
  transform: translateZ(0);
}

/* Reset scroll y estructura de la página (ya cubierto en parte por el reset global) */
html, body {
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}
/* =============================================
   ESTILOS PRINCIPALES DEL MAPA INTERACTIVO
   ============================================= */

/* Reset y configuración base */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  background-color: #f5f5f5;
  overflow-x: hidden; /* Evitar scroll horizontal */
}

canvas {
  display: block;
}

/* =============================================
   HEADER CON SELECTOR DE PROYECTO - ESTRUCTURA MEJORADA
   ============================================= */

section.project-header {
  background: black;
  padding: 14px 20px;
  box-shadow: var(--shadow-strong), 0 1px 2px rgba(2,6,23,0.04);
  border-bottom: 1px solid rgba(2,6,23,0.04);
  position: relative;
  z-index: 1;
  color: var(--text-color);
  backdrop-filter: blur(6px);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  gap: 18px;
}

.project-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 200px;
}

.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 200px;
}

/* =============================================
   RESPONSIVE DESIGN PARA EL HEADER - MEJORADO
   ============================================= */

@media (max-width: 768px) {
  section.project-header {
    padding: 12px 15px;
  }
  
  .header-main {
    flex-direction: column;
    gap: 8px;
  }
  
  .header-nav,
  .project-selector {
    gap: 10px;
    min-width: auto;
    justify-content: center;
  }
  
  .header-nav .ui-button {
    padding: 7px 14px;
    font-size: 13px;
  }
  
  .project-selector select {
    min-width: 160px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .project-selector label {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  section.project-header {
    padding: 8px 10px;
  }
  
  .header-main {
    gap: 6px;
  }
  
  .header-nav {
    gap: 6px;
  }
  
  .header-nav .ui-button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .project-selector select {
    min-width: 140px;
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .project-selector label {
    font-size: 12px;
  }
  
  .project-selector {
    gap: 8px;
  }
}

.project-selector label {
  /* Sobre fondo blanco, usar color oscuro similar al footer en contraste */
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.project-selector select {
  padding: 10px 15px;
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  background: var(--white);
  font-size: 14px;
  min-width: 200px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.project-selector select:focus {
  outline: none;
  /* Usar acento del footer como halo en focus (amarillo dorado translúcido) */
  box-shadow: 0 0 0 4px rgba(234,199,54,0.16);
}

/* ---------- Stage switch visual (sin duplicar lógica) ---------- */
.stage-select {
  /* Se mantiene en el DOM como fuente de verdad, pero visualmente oculto ya que usamos el switch */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
}

.stage-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: #000000;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(224, 182, 57, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stage-btn {
  --btn-padding: 10px 18px;
  appearance: none;
  border: 2px solid transparent;
  background: #4a4a4a; /* Gris cuando no está seleccionado */
  padding: var(--btn-padding);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  min-width: 110px; /* Mismo ancho para todos */
  text-align: center;
}

/* Hover para botones no seleccionados */
.stage-btn:hover:not([aria-pressed="true"]) {
  background: #5a5a5a;
  border-color: rgba(224, 182, 57, 0.2);
}

.stage-btn .thumb {
  display: none; /* Ocultar el círculo decorativo */
}

.stage-btn[aria-pressed="true"] {
  background: #1a1a1a; /* Negro cuando está seleccionado */
  border-color: var(--accent-color); /* Borde amarillo */
  box-shadow: 0 0 0 1px var(--accent-color), 
              0 4px 12px rgba(224, 182, 57, 0.3);
  color: #ffffff;
  transform: none;
}

.stage-btn[aria-pressed="true"]:hover {
  background: #1a1a1a;
  border-color: var(--primary-color);
}

/* Compact layout on small screens */
@media (max-width: 480px) {
  .stage-switch { gap: 4px; padding: 4px; }
  .stage-btn { 
    padding: 8px 12px; 
    font-size: 13px;
    min-width: 90px;
  }
}

/* =============================================
   CONTENEDOR PRINCIPAL DEL MAPA
   ============================================= */

.map-section {
  width: 100%;  
}

.map-container {
  max-width: 1060px;
  margin: 20px auto;
  padding: 0 20px;
  position: relative;
  overflow: hidden; /* Evitar que los paneles ocultos causen scroll */
}

.map-wrapper {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  position: relative;
  height: 80vh;
  min-height: 400px;
}

/* Mejoras específicas para móviles */
@media (max-width: 480px) {
  .map-wrapper {
    height: 70vh; /* Altura optimizada para móviles pequeños */
    min-height: 400px;
    margin: 10px;
    border-radius: 12px;
  }
  
  .map-container {
    padding: 0 10px; /* Padding reducido en móviles pequeños */
    margin: 10px auto;
  }
}

#map {
  height: 100%;
  width: 100%;
  border-radius: 15px;
}

#info {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

/* =============================================
   ESTILOS PARA LOTES INTERACTIVOS
   ============================================= */

.hover-lote {
  stroke-width: 1;
  transition: fill-opacity 0.12s ease, filter 0.12s ease;
  cursor: pointer;

}

.hover-lote:hover {
  fill-opacity: 0.6 !important;
  filter: brightness(1.2) saturate(1.1);
  z-index: 1000;
}

/* =============================================
   BARRA DE ESTADOS DE LOTES - INTEGRADA EN EL CENTRO
   ============================================= */

.status-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-radius: 20px;
  /* Mejor contraste sobre fondo blanco: ligera sombra y fondo translúcido oscuro */
  background: rgb(183 183 183 / 15%);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(2,6,23,0.04);
  box-shadow: 0 4px 12px rgba(2,6,23,0.04);
}

/* Mejoras para la barra de estados en móviles */
@media (max-width: 768px) {
  .status-bar {
    padding: 5px 8px;
    gap: 4px;
    order: 0; /* Mantener en el medio en móvil */
  }
  
  .status-btn {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 10px;
    flex: 1;
    min-width: 60px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .status-bar {
    padding: 4px 6px;
    gap: 3px;
  }
  
  .status-btn {
    padding: 3px 6px;
    font-size: 9px;
    min-width: 50px;
    border-radius: 8px;
  }
}

@media (max-width: 360px) {
  .status-bar {
    gap: 2px;
    padding: 3px 5px;
  }
  
  .status-btn {
    padding: 3px 5px;
    font-size: 8px;
    min-width: 45px;
    border-radius: 6px;
  }
}

.status-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.3s ease;
}

.status-btn.disponible {
  background: var(--available-bg);
  color: var(--available-text);
}

.status-btn.reservado {
  background: var(--reserved-bg);
  color: var(--reserved-text);
}

.status-btn.vendido {
  background: var(--sold-bg);
  color: var(--sold-text);
}

.status-btn.bloqueado {
  background: var(--blocked-bg, #4b5563);
  color: var(--blocked-text, #ffffff);
}

.status-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* =============================================
   CONTROLES DE NAVEGACIÓN
   ============================================= */

.bottom-center-controls {
  position: absolute ;
  display: flex;
  flex-direction: column;
  gap: 10px;
  left: 10px;
  bottom: 15px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mobile-nav {
  z-index: 1200; /* mayor que controles (que tienen z-index:1) */
}

/* Mejoras para controles en móviles */
@media (max-width: 768px) {
  .bottom-center-controls {
    left: 15px;
    bottom: 20px;
    padding: 10px;
    gap: 12px;
  }
  
  .control-button {
    width: 48px !important; /* Botones más grandes para touch */
    height: 48px !important;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .bottom-center-controls {
    left: 10px;
    bottom: 15px;
  }
  
  .control-button {
    width: 44px !important; /* Ajuste para pantallas muy pequeñas */
    height: 44px !important;
  }
}

.control-button {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  color: #374151;
}

.control-button:hover {
  background: rgba(243, 244, 246, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #1f2937;
}

.control-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.control-button svg {
  transition: all 0.2s ease;
}

/* =============================================
   BOTÓN DE COLAPSAR CONTROLES MÓVIL
   ============================================= */

/* Botón de colapsar - solo visible en móvil */
.collapse-button {
  display: none;
}

/* Contenedor de los controles principales */
.controls-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}

/* Estados del contenedor de controles */
.bottom-center-controls.collapsed .controls-container {
  height: 0;
  overflow: hidden;
  opacity: 0;
  gap: 0;
}

.bottom-center-controls.collapsed .collapse-button svg {
  transform: rotate(180deg);
}

/* Estilos específicos para móvil */
@media (max-width: 768px) {
  .collapse-button {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(74, 222, 128, 0.3);
    box-shadow: 0 2px 12px rgba(74, 222, 128, 0.2);
  }
  
  .collapse-button:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
  }
  
  /* Ajuste del contenedor principal en móvil */
  .bottom-center-controls {
    transition: all 0.3s ease;
  }
  
  .bottom-center-controls.collapsed {
    padding: 8px;
  }
  
  /* Separador visual entre el botón de colapsar y los controles */
  .collapse-button {
    margin-bottom: 5px;
    position: relative;
  }
  
  .collapse-button::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    transition: opacity 0.3s ease;
  }
  
  .bottom-center-controls.collapsed .collapse-button::after {
    opacity: 0;
  }
}

/* Ocultar el botón en desktop */
@media (min-width: 769px) {
  .collapse-button {
    display: none !important;
  }
}

/* =============================================
   BOTONES DE LA INTERFAZ
   ============================================= */

.ui-button {
  padding: 10px 20px;
  margin: 5px;
  border: none;
  border-radius: 25px;
  background: var(--btn-muted, #6b7280);
  color: var(--white, #fff);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.ui-button:hover {
  background: var(--dark-gray, #4b5563);
  transform: translateY(-2px);
}

.ui-button.active {
  background: var(--btn-primary, #2563eb);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.ui-button:not(.active) {
  background: var(--btn-muted, #6b7280);
}

/* =============================================
   PANELES LATERALES
   ============================================= */

/* =============================================
   SECCIONES ORGANIZATIVAS
   ============================================= */

.ui-controls-section,
.side-panels-section {
  position: relative;
  z-index: 1000;
}

/* =============================================
   PANELES LATERALES
   ============================================= */

#side-panel,
.info-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 320px;
  max-height: calc(100% - 40px);
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#side-panel.visible,
.info-panel.visible { 
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

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

.back-button { 
  color: #555; 
  text-decoration: none; 
  font-size: 16px; 
}

#close-panel, #close-search-panel, #close-areas-panel { 
  background: rgba(255, 255, 255, 0.9);
  border: none; 
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px; 
  cursor: pointer; 
  color: #666;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-weight: 300;
}

#close-panel:hover, #close-search-panel:hover, #close-areas-panel:hover {
  background: #ff4757;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255,71,87,0.3);
}

.panel-content { 
  padding: 0 25px; 
  overflow-y: auto; 
  flex-grow: 1; 
}

.project-title { 
  font-size: 28px; 
  font-weight: 900; 
  color: #003366; 
  margin: 0; 
}

.lote-info { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin: 15px 0 25px 0; 
}

.lote-id { 
  font-size: 20px; 
  color: #333; 
  font-weight: 600; 
}

.status-tag { 
  background-color: var(--available-bg);
  color: var(--available-text);
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 600;
}

.info-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 15px 10px; 
  border-top: 1px solid #eee; 
  padding-top: 20px; 
}

.info-item { 
  display: flex; 
  flex-direction: column; 
}

.info-item .label { 
  color: #888; 
  font-size: 14px; 
  margin-bottom: 2px; 
}

.info-item .value { 
  color: #333; 
  font-size: 16px; 
  font-weight: 600; 
}

.dimensions-title { 
  font-size: 18px; 
  font-weight: 600; 
  color: #333; 
  margin: 25px 0 10px 0; 
  border-top: 1px solid #eee; 
  padding-top: 20px; 
}

.dimension-item { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 8px 0; 
}

.dimension-label { 
  display: flex; 
  align-items: center; 
  color: #555; 
}

.dimension-icon { 
  width: 24px; 
  height: 24px; 
  background-color: #eee; 
  border-radius: 50%; 
  display: inline-flex; 
  justify-content: center; 
  align-items: center; 
  margin-right: 12px; 
  font-weight: bold; 
  color: #555; 
}

.dimension-value { 
  font-weight: 600; 
  color: #333; 
}

.panel-footer { 
  padding: 20px 25px; 
  margin-top: auto; 
}

.whatsapp-button { 
  display: block; 
  width: 92%; 
  background-color: var(--whatsapp, #25D366); 
  color: var(--white, #fff); 
  text-align: center; 
  padding: 15px; 
  border-radius: 25px; 
  text-decoration: none; 
  font-size: 16px; 
  font-weight: 600; 
  transition: background-color 0.18s, transform 0.18s;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.12);
}

.whatsapp-button:hover { 
  background-color: #1EBE57; 
}

/* =============================================
   MENÚS DE NAVEGACIÓN - ACTUALIZADO
   ============================================= */

.header-nav {
  display: flex;
  gap: 15px;
  justify-content: right;
}

.header-nav .ui-button {
  /* Botones elevados y legibles sobre fondo blanco */
  background: rgba(255,255,255,0.95);
  color: var(--forest-green-dark, #0b0b0b);
  border: 1px solid rgba(2,6,23,0.06);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(2,6,23,0.06);
}

.header-nav .ui-button.active,
.header-nav .ui-button:hover {
  /* En hover/activo usar el acento dorado del footer */
  background: var(--accent-color, #eac736);
  color: var(--white, #fff);
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(234,199,54,0.12);
}


.control-button:hover { 
  color: #aaa; 
}

/* Panel de Búsqueda y Áreas */
.search-panel, .areas-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 320px;
  max-height: calc(100% - 40px);
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-panel.visible, .areas-panel.visible { 
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.area-item { 
  padding: 15px 20px; 
  border-bottom: 1px solid #eee; 
  cursor: pointer; 
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.area-item:hover { 
  background-color: var(--light-gray);
  transform: translateX(5px);
}

.area-item:last-child {
  border-bottom: none;
}

.area-info {
  flex: 1;
}

.area-name {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.area-type {
  font-size: 12px;
  color: var(--muted-text);
  background: var(--secondary-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.area-view-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.area-view-btn:hover {
  background: var(--accent-color);
  transform: scale(1.05);
}

/* --- Estilos para el Buscador de Lotes --- */
.search-panel .panel-content { padding: 4px 25px; overflow-y: auto; }
.filter-group { margin-bottom: 20px; }
.filter-label { display: block; margin-bottom: 8px; font-size: 14px; color: var(--text-color); }

/* Estilos para el campo de búsqueda de texto */
.search-input-group {
  margin-bottom: 20px;
}

.search-input {
  width: 95%;
  padding: 12px;
  border: 1px solid var(--medium-gray);
  border-radius: 8px;
  font-size: 14px;
  background-color: var(--white);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-input::placeholder {
  color: var(--muted-text);
}
.filter-group .range-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: var(--medium-gray); outline: none; border-radius: 2px; }
.filter-group .range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid #0056b3; box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: pointer; }
.filter-group .range-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid #0056b3; box-shadow: 0 1px 4px rgba(0,0,0,0.2); cursor: pointer; }
.sort-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.custom-select { -webkit-appearance: none; appearance: none; width: 100%; padding: 10px; border-radius: 8px; border: 1px solid var(--medium-gray); background-color: var(--white); background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23888%22/%3E%3C/svg%3E'); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }
.clear-filters { font-size: 14px; color: #007bff; text-decoration: none; }
.lote-result-card { background: var(--light-gray); border: 1px solid var(--medium-gray); border-radius: 10px; padding: 15px; margin-top: 15px; }
.lote-result-card h4 { margin: 0 0 15px 0; font-size: 18px; }
.card-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-bottom: 15px; }
.card-info-grid .label { font-size: 12px; color: var(--muted-text); display: block; }
.card-info-grid .value { font-size: 14px; font-weight: 600; color: var(--text-color); }
.card-info-grid .value.available { color: var(--available-text); }

/* Estilos para los diferentes estados de lotes en las tarjetas del buscador */
.card-info-grid .value.status-disponible {
  color: var(--available-text);
  background: var(--available-bg);
  border: 1px solid #111827;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.card-info-grid .value.status-reservado {
  color: var(--reserved-text);
  background: var(--reserved-bg);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.card-info-grid .value.status-vendido {
  color: var(--sold-text);
  background: var(--sold-bg);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.card-info-grid .value.status-bloqueado {
  color: var(--blocked-text);
  background: var(--blocked-bg);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* Estilos para el status tag en el panel de información */
.status-tag.status-disponible {
  background: var(--available-bg);
  color: var(--available-text);
  border: 1px solid #111827;
}

.status-tag.status-reservado {
  background: var(--reserved-bg);
  color: var(--reserved-text);
}

.status-tag.status-vendido {
  background: var(--sold-bg);
  color: var(--sold-text);
}

.status-tag.status-bloqueado {
  background: var(--blocked-bg);
  color: var(--blocked-text);
}
.ver-mas-btn { width: 100%; background: var(--white); border: 1px solid var(--medium-gray); padding: 10px; border-radius: 20px; cursor: pointer; transition: background-color 0.2s; }
.ver-mas-btn:hover { background-color: var(--light-gray); }

/* Estilos para el slider de doble rango */
.dual-range-slider {
  position: relative;
  height: 20px;
}
.dual-range-slider input[type=range] {
  position: absolute;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none; /* Los inputs son invisibles, los thumbs son los que se mueven */
}
.dual-range-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all; /* Habilitar eventos solo en el thumb */
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 2px solid #0056b3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  margin-top: -3px; /* Centra el control verticalmente */
}
.dual-range-slider input[type=range]::-moz-range-thumb {
  pointer-events: all;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #0056b3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  margin-top: -3px; /* Centra el control verticalmente */
}
.dual-range-slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  width: 100%;
  height: 4px;
  background: var(--medium-gray);
  border-radius: 2px;
  transform: translateY(-50%);
  z-index: -1;
}

/* Estilo para truncar texto en selectores */
.custom-select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Estilo para el contador de resultados */
.results-count {
  background-color: #e9ecef;
  color: #495057;
  padding: 10px 20px;
  border-radius: 20px;
  text-align: center;
  margin: 20px 0;
  font-weight: 500;
}

/* =============================================
   RESPONSIVIDAD PARA PANELES
   ============================================= */
@media (max-width: 768px) {
  .search-panel, .areas-panel, .info-panel {
    width: calc(100% - 30px); /* Más ancho en tablets */
    max-width: none; /* Sin límite de ancho */
    top: 15px;
    right: 15px;
    left: 15px; /* Centrado horizontalmente */
    max-height: calc(100% - 30px);
  }
  
  /* Mejorar botones de cierre en móvil */
  #close-panel, #close-search-panel, #close-areas-panel {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  
  /* Mejorar contenido del panel */
  .panel-content {
    padding: 0 20px;
    font-size: 16px; /* Texto más legible */
  }
  
  .project-title {
    font-size: 24px; /* Título más pequeño para móvil */
  }
  
  .lote-id {
    font-size: 18px;
  }
  
  .info-grid {
    grid-template-columns: 1fr; /* Una columna en móvil */
    gap: 12px;
  }
  
  .info-item .value {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .search-panel, .areas-panel, .info-panel {
    width: calc(100% - 20px);
    top: 10px;
    right: 10px;
    left: 10px;
    max-height: calc(100% - 20px);
  }
  
  .panel-content {
    padding: 0 15px;
  }
  
  /* Hacer botones de WhatsApp más grandes */
  .whatsapp-button {
    padding: 18px;
    font-size: 18px;
  }
  
  /* Mejorar filtros de búsqueda */
  .filter-group {
    margin-bottom: 20px;
  }
  
  .dual-range-slider input[type=range]::-webkit-slider-thumb {
    width: 28px; /* Controles más grandes para touch */
    height: 28px;
  }
}

/* =============================================
   MODAL PARA MOSTRAR IMÁGENES DE AMENIDADES
   ============================================= */

/* Bloquear scroll cuando modal abierto */
.no-scroll { overflow: hidden !important; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  cursor: pointer;
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: #666;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-weight: 300;
}

.modal-close:hover {
  background: #ff4757;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

#modalImage {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
}

.modal-title {
  padding: 15px 20px;
  background: var(--secondary-color);
  color: white;
  font-weight: 600;
  text-align: center;
  font-size: 16px;
}

/* Estilos específicos para amenidades en el mapa */
.hover-amenidad {
  cursor: pointer !important;
  transition: all 0.2s ease;
}

.hover-amenidad:hover {
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
    max-height: 85vh;
  }
  
  #modalImage {
    max-height: 75vh;
  }
  
  .modal-close {
    width: 38px;
    height: 38px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }
}

/* === UTILIDADES DE ACCESIBILIDAD === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
