/* ==========================================================================
   GeoCliente — Pantalla de Mapa
   ========================================================================== */

/* El mapa ocupa todo el espacio disponible entre el header y el tabbar */
.map-container {
  flex: 1;
  position: relative;
  min-height: 0; /* necesario para que flex:1 respete el alto en Safari/iOS */
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--color-border); /* placeholder visible mientras carga el mapa */
}

/* ---- Estado: cargando ---- */
.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--color-paper);
  text-align: center;
  padding: var(--space-4);
  z-index: 10;
}

.map-status--hidden {
  display: none;
}

.map-status__icon {
  width: 32px;
  height: 32px;
  color: var(--color-gps);
  animation: spin 1s linear infinite;
}

.map-status__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.map-status__error-icon {
  color: var(--color-danger);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .map-status__icon {
    animation: none;
  }
}

/* ---- Contador de clientes en el header ---- */
.map-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ---- Contenido del popup del pin (renderizado dentro de un
   maplibregl.Popup, con nuestras clases para heredar tipografía y color
   del sistema en vez del estilo por defecto de MapLibre) ---- */
.pin-info {
  font-family: var(--font-body);
  min-width: 200px;
  padding: var(--space-1);
}

.pin-info__nombre {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.pin-info__ciudad {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.pin-info__acciones {
  display: flex;
  gap: var(--space-2);
}

.pin-info__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  flex: 1;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-gps);
  color: var(--color-text-on-accent);
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.pin-info__btn .icon {
  width: 16px;
  height: 16px;
  color: currentColor;
}

/* ---- Overrides del popup de MapLibre: reemplaza su look por defecto
   con el estilo de tarjeta del sistema de diseño (esquinas redondeadas,
   sombra sutil, sin flecha marcada) ---- */
.maplibregl-popup-content {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.maplibregl-popup-close-button {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
}

