/* ===================================================================
   styles.css — DISEÑO DEL MAPA DE EMPLEOS
   ===================================================================
   Este archivo NO se edita en uso normal. Todo lo editable está en
   configuracion.js. app.js inyecta los colores y textos aquí via
   variables CSS (--azul-marino, --coral, etc.).
   =================================================================== */

/* Variables de color (sobrescritas por app.js con CONFIG.colores) */
:root {
  --azul-marino: #0A2540;
  --coral: #FF6B35;
  --beige: #F8F5EF;
  --texto: #1A2332;
  --texto-secundario: #5A6B7B;
  --borde: #E3DDD2;
  --sombra: 0 4px 14px rgba(10, 37, 64, 0.10);
  --sombra-fuerte: 0 10px 28px rgba(10, 37, 64, 0.18);
  --radio: 14px;
  --radio-chico: 10px;
}

/* Reset básico */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--beige);
  color: var(--texto);
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================================================
   BARRA SUPERIOR
   =================================================================== */
.barra-superior {
  background: var(--azul-marino);
  color: white;
  padding: 10px 14px 8px;
  padding-top: max(10px, env(safe-area-inset-top));
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10, 37, 64, 0.18);
  z-index: 1000;
  position: relative;
}

.barra-contenido {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.marca-titulo {
  margin: 0;                 /* ahora es un <h1>: fuera el margen del navegador */
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.marca-punto {
  color: var(--coral);
  font-weight: 900;
}

.marca-subtitulo {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1px;
}

.boton-como {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: background 0.15s;
}

.boton-como:hover, .boton-como:active {
  background: rgba(255, 255, 255, 0.22);
}

.bienvenida-texto {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 6px;
  line-height: 1.4;
  max-width: 600px;
  display: none;
}

@media (min-width: 600px) {
  .bienvenida-texto { display: block; }
}

/* ===================================================================
   BARRA DE FILTROS
   =================================================================== */
.barra-filtros {
  background: var(--beige);
  padding: 10px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--borde);
  z-index: 999;
  position: relative;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0 4px;
}

.chips::-webkit-scrollbar { display: none; }

.chip-filtro {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-secundario);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  transition: all 0.18s ease;
}

.chip-filtro:active { transform: scale(0.96); }

.chip-filtro .chip-punto {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-filtro.activo {
  background: var(--azul-marino);
  border-color: var(--azul-marino);
  color: white;
}

.chip-filtro.activo .chip-punto {
  box-shadow: 0 0 0 2px white;
}

.contador {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--texto-secundario);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 0 2px 4px;
}

/* ===================================================================
   MAPA
   =================================================================== */
#mapa {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: var(--beige);
  z-index: 1;
}

/* Forzar capas Leaflet debajo de la UI */
.leaflet-pane, .leaflet-top, .leaflet-bottom { z-index: 1 !important; }
.leaflet-control-attribution { z-index: 1 !important; }

/* ===================================================================
   PINES SVG
   =================================================================== */
.pin-vallarta-wrapper {
  background: transparent !important;
  border: none !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center bottom;
  cursor: pointer;
}

.pin-vallarta-wrapper:hover {
  transform: scale(1.15);
  z-index: 1000 !important;
}

.pin-vallarta-wrapper:active {
  transform: scale(1.08);
}

/* ===================================================================
   CLUSTERS
   =================================================================== */
.cluster-wrapper {
  background: transparent !important;
  border: none !important;
}

.cluster-vallarta {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azul-marino) 0%, #1d4a78 100%);
  color: white;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.25);
  border: 2.5px solid white;
  position: relative;
}

.cluster-vallarta::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(10, 37, 64, 0.10);
  z-index: -1;
}

/* ===================================================================
   PUNTO DE USUARIO
   =================================================================== */
.punto-usuario-wrapper {
  background: transparent !important;
  border: none !important;
}

.punto-usuario {
  position: relative;
  width: 24px;
  height: 24px;
}

.punto-usuario-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(55, 138, 221, 0.35);
  animation: pulse-usuario 2s ease-out infinite;
}

.punto-usuario-nucleo {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #378ADD;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.3);
}

@keyframes pulse-usuario {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ===================================================================
   POPUP (TARJETA DEL PIN)
   =================================================================== */
.popup-wrapper-vallarta .leaflet-popup-content-wrapper {
  background: white;
  border-radius: var(--radio);
  box-shadow: var(--sombra-fuerte);
  padding: 0;
  overflow: hidden;
}

.popup-wrapper-vallarta .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

.popup-wrapper-vallarta .leaflet-popup-tip {
  background: white;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.10);
}

.popup-vallarta {
  width: 280px;
  max-width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px 16px 14px;
  -webkit-overflow-scrolling: touch;
}

.popup-negocio {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-secundario);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.popup-puesto {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.popup-categoria {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.popup-frescura {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #5A6B7B;
  margin-bottom: 10px;
  background: #EEF1F4;
  padding: 5px 9px;
  border-radius: 8px;
  align-self: flex-start;
}

/* Recien puesta: verde. Es el argumento de venta del sitio. */
.popup-frescura.fresca { color: #157A54; background: #E6F6EE; }

/* Ya va de salida: ambar. Avisa sin mentir. */
.popup-frescura.vieja  { color: #8A6220; background: #FBF0DC; }

.popup-hospedaje {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #B4530F;
  margin-bottom: 10px;
  background: #FDEDE1;
  padding: 5px 9px;
  border-radius: 8px;
  align-self: flex-start;
}

.popup-verificado {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #1D9E75;
  margin-bottom: 10px;
  background: #E6F6EE;
  padding: 5px 9px;
  border-radius: 8px;
  align-self: flex-start;
}

.popup-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.popup-dato {
  background: var(--beige);
  border-radius: var(--radio-chico);
  padding: 7px 10px;
  flex: 1 1 0;
  min-width: 100px;
}

.popup-dato-etiqueta {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--texto-secundario);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.popup-dato-valor {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto);
}

.popup-zona {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--texto-secundario);
  margin-bottom: 8px;
}

.popup-linea {
  font-size: 12.5px;
  color: var(--texto);
  margin-bottom: 8px;
}

.popup-linea-etiqueta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.popup-requisitos {
  background: var(--beige);
  border-radius: var(--radio-chico);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.popup-requisitos-titulo {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--texto-secundario);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.popup-requisitos ul {
  list-style: none;
  padding: 0;
}

.popup-requisitos li {
  font-size: 12.5px;
  color: var(--texto);
  padding: 3px 0 3px 18px;
  position: relative;
  line-height: 1.4;
}

.popup-requisitos li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

.popup-descripcion {
  font-size: 12.5px;
  color: var(--texto);
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #FFF8F2;
  border-left: 3px solid var(--coral);
  border-radius: 0 8px 8px 0;
}

.popup-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #25D366;
  color: white;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: var(--radio-chico);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transition: transform 0.12s, box-shadow 0.12s;
}

.popup-whatsapp:hover {
  background: #1FB855;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

.popup-whatsapp:active {
  transform: translateY(0) scale(0.98);
}

/* ===================================================================
   BOTÓN FLOTANTE
   =================================================================== */
.boton-flotante {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--azul-marino);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  box-shadow: 0 6px 20px rgba(10, 37, 64, 0.35);
  z-index: 800;
  transition: transform 0.15s;
}

/* Se aparta cuando hay un popup abierto: no debe tapar el boton de WhatsApp. */
.boton-flotante {
  transition: opacity 160ms ease, transform 160ms ease;
}
.boton-flotante.oculto {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .boton-flotante { transition: none; }
}

.boton-flotante:active { transform: translateX(-50%) scale(0.96); }
.boton-flotante:hover { background: #15365c; }

/* ===================================================================
   MENSAJE VACÍO
   =================================================================== */
.mensaje-vacio {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 18px 22px;
  border-radius: var(--radio);
  box-shadow: var(--sombra-fuerte);
  font-size: 14px;
  color: var(--texto);
  text-align: center;
  z-index: 700;
  max-width: 320px;
  border: 1px solid var(--borde);
}

/* ===================================================================
   TOAST
   =================================================================== */
.toast {
  position: absolute;
  bottom: 80px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--azul-marino);
  color: white;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--sombra-fuerte);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 90%;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===================================================================
   MODAL "CÓMO FUNCIONA"
   =================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.visible { display: flex; }

.modal-fondo {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-contenido {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 28px 24px 22px;
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(10, 37, 64, 0.4);
  animation: modal-entra 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes modal-entra {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-cerrar {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--beige);
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--texto-secundario);
  cursor: pointer;
}

.modal-cerrar:hover { background: #ede7dc; }

.modal-titulo {
  font-family: "Fraunces", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
  padding-right: 30px;
}

.modal-parrafo {
  font-size: 14px;
  color: var(--texto);
  line-height: 1.55;
  margin-bottom: 12px;
}

.modal-lista {
  padding-left: 22px;
  margin-bottom: 14px;
}

.modal-lista li {
  font-size: 13.5px;
  color: var(--texto);
  line-height: 1.5;
  margin-bottom: 8px;
}

.modal-lista strong { color: var(--azul-marino); }

.modal-boton {
  width: 100%;
  background: var(--azul-marino);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radio-chico);
  font-family: "Inter", sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  margin-top: 6px;
  transition: background 0.15s;
}

.modal-boton:hover { background: #15365c; }
.modal-boton:active { transform: scale(0.98); }

/* ===================================================================
   CONTROLES LEAFLET
   =================================================================== */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--sombra) !important;
  border-radius: 12px !important;
  overflow: hidden;
  margin-bottom: 90px !important;
  margin-right: 12px !important;
}

.leaflet-control-zoom a {
  background: white !important;
  color: var(--azul-marino) !important;
  border: none !important;
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.leaflet-control-zoom a:hover {
  background: var(--beige) !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.85) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  margin-bottom: env(safe-area-inset-bottom) !important;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (min-width: 768px) {
  body { font-size: 15.5px; }
  .barra-superior { padding: 14px 20px 10px; }
  .marca-titulo { font-size: 26px; }
  .marca-subtitulo { font-size: 12px; }
  .barra-filtros { padding: 12px 20px 8px; }
  .chips { gap: 10px; }
  .chip-filtro { font-size: 13.5px; padding: 9px 16px; }
  .contador { font-size: 12px; padding: 0 2px 6px; }
  .bienvenida-texto { font-size: 13px; }
  .popup-vallarta { width: 320px; max-width: 320px; }
  .popup-puesto { font-size: 21px; }
  .boton-flotante { font-size: 14px; padding: 13px 22px; }
  .leaflet-control-zoom { margin-bottom: 100px !important; }
}

@media (min-width: 1100px) {
  .barra-superior { padding: 16px 28px 12px; }
  .barra-filtros { padding: 14px 28px 10px; }
}

/* Modo oscuro del sistema (mapa respeta OSM; UI se adapta) */
@media (prefers-color-scheme: dark) {
  :root {
    --beige: #1A2230;
    --texto: #F1F5F9;
    --texto-secundario: #94A3B8;
    --borde: #2A3344;
  }
  .chip-filtro { background: #232B3A; }
  .popup-dato, .popup-requisitos { background: #232B3A; }
  .popup-descripcion { background: rgba(255, 107, 53, 0.08); }
  .toast { background: #15365c; }
  .mensaje-vacio { background: #232B3A; }
  .modal-contenido { background: #1A2230; }
  .modal-cerrar { background: #2A3344; }
  .leaflet-control-zoom a { background: #232B3A !important; color: #F1F5F9 !important; }
}
