/* ════════════════════════════════════════════════════════════
   CENTRAL DE ÁNGELES — COMPONENTS · Mapa mock: card, marcadores, ruta, leyenda, pins
   ⚠ Consume css/tokens.css. Parte del set de componentes por dominio.
   Ver css/components/_index.css para el mapa completo.
   ════════════════════════════════════════════════════════════ */

/* ── MAP CARD (dashboard, reporte, ultima-localización) ── */
.map-card {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.map-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
  background: var(--surface-2);
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}
.map-title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-1);
}
.map-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}


.map-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 360px;
  z-index: 1;
}
.map-mock {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  overflow: hidden;
}
.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-3) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-road-h, .map-road-v { position: absolute; background: var(--border-2); }
.map-road-h { height: 3px; left: 0; right: 0; }
.map-road-v { width: 3px; top: 0; bottom: 0; }
.map-label {
  position: absolute;
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--text-4);
  font-family: var(--font-body);
  white-space: nowrap;
  background: var(--surface-2);
  padding: 1px 4px;
  border-radius: 3px;
  opacity: 0.7;
}

/* Vehicle marker */
.v-marker {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  cursor: pointer;
  transition: filter 0.2s ease;
  z-index: 5;
  pointer-events: auto;
}
.v-marker:hover { filter: brightness(1.08); z-index: 10; }
.v-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--marker-stroke);
}
.v-pin-inner { transform: rotate(45deg); font-size: var(--text-xs); }
.v-pin.green  { background: var(--success); }
.v-pin.yellow { background: var(--warning); }
.v-pin.red    { background: var(--danger); }
.v-pin.blue   { background: var(--electric); }
.v-label {
  font-size: var(--text-2xs);
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-1);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-sm);
  margin-top: 2px;
  white-space: nowrap;
}

/* Route line overlay */
.route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.route-line {
  fill: none;
  stroke: var(--electric);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  opacity: 0.55;
}
.route-line.solid { stroke-dasharray: none; opacity: 0.7; }

/* Map zoom controls */
.map-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  z-index: 10;
}
.map-ctrl-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-md);
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s ease;
}
.map-ctrl-btn:hover { box-shadow: var(--shadow-md); color: var(--text-1); }
/* Glifos que necesitan menos tamaño que + / − (ej. ⊙ centrar) */
.map-ctrl-btn.is-glyph { font-size: var(--text-sm); }

/* Map footer */
.map-footer {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}
.map-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.map-attribution {
  margin-left: auto;
  font-size: var(--text-2xs);
  color: var(--text-4);
  font-family: var(--font-mono);
}


/* ── MAP-PANEL: contenedor de mapa en split-2 ── */
/* .split-2 grid is in layout.css (1fr 320px / collapses at 1100px) */
.map-panel {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-sm);
  height: 480px;
}

/* ── MAP-BADGE: etiqueta flotante sobre el mapa ── */
.map-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── MAP-PIN: pins de rastreador sobre el mapa ── */
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}
.map-pin::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid var(--marker-stroke);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.map-pin.is-online::before  { background: var(--success); }
.map-pin.is-stopped::before { background: var(--warning); }
.map-pin.is-alert::before   { background: var(--danger); }
.map-pin.is-offline::before { background: var(--text-4); }
.pin-label {
  margin-top: 3px;
  font-size: var(--text-2xs);
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-1);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-1);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

/* ── ROUTE-POINT: círculos SVG de inicio/parada/fin en ruta ── */
.route-point { fill: var(--electric); stroke: var(--marker-stroke); stroke-width: 2; }
.route-point.start { fill: var(--success); }
.route-point.stop  { fill: var(--warning); }
.route-point.end   { fill: var(--electric); }

/* ── MAP-LEGEND: overlay dentro del mapa mock (split-2 / map-panel) ── */
.map-mock .map-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  flex-direction: column;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-2xs);
  color: var(--text-3);
  font-weight: 500;
}

