/* =========================================================
   MAPA "ONDE ATUAMOS" - Costa Brasil Engenharia
   Todas as regras sao restritas a #mapa-atuacao (ou usam
   classes com prefixo "mapa-"), entao nao afetam o resto
   do site.
   ========================================================= */

#mapa-atuacao {
  --mapa-bg: #f4f8fc;
  --mapa-card: #ffffff;
  --mapa-accent: #FFD98A;
  --mapa-state-fill: #2d4468;
  --mapa-state-hot: #2d4468;
  --mapa-state-stroke: #ffffff;
  --mapa-text: #34445c;

  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 48px 24px;
  background: radial-gradient(circle at top, #ffffff, #e6eef7 75%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--mapa-text);
  text-align: left;
}

#mapa-atuacao,
#mapa-atuacao *,
#mapa-atuacao *::before,
#mapa-atuacao *::after {
  box-sizing: border-box;
}

#mapa-atuacao .mapa-titulo {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: none;
  text-align: center;
  color: var(--mapa-text);
}

#mapa-atuacao .mapa-subtitulo {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.4;
  text-align: center;
  color: #7a8aa3;
}

/* ---------- Layout ---------- */
#mapa-atuacao .mapa-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

#mapa-atuacao .mapa-wrapper {
  position: relative;
  width: min(90vw, 620px);
  padding: 28px;
  background: var(--mapa-card);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(70,100,140,0.15), inset 0 0 0 1px rgba(70,100,140,0.06);
}

#mapa-atuacao svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ---------- Estados ---------- */
#mapa-atuacao .mapa-state {
  fill: var(--mapa-state-fill);
  stroke: var(--mapa-state-stroke);
  stroke-width: 0.6;
  cursor: default;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.2s ease;
}

#mapa-atuacao .mapa-state.mapa-hot {
  fill: var(--mapa-state-hot);
  cursor: pointer;
}

#mapa-atuacao .mapa-state.mapa-hot:hover {
  fill: var(--mapa-accent);
  animation: mapa-salto 0.5s cubic-bezier(.36,1.6,.4,1);
}

#mapa-atuacao .mapa-state.mapa-country {
  fill: #94e9c0;
  stroke: #ffffff;
  stroke-width: 0.9;
}

#mapa-atuacao .mapa-state.mapa-hot.mapa-ativo {
  fill: var(--mapa-accent);
  animation: mapa-salto 0.5s cubic-bezier(.36,1.6,.4,1);
}

#mapa-atuacao .mapa-state.mapa-country.mapa-hot:hover,
#mapa-atuacao .mapa-state.mapa-country.mapa-hot.mapa-ativo {
  fill: #589e7f;
}

@keyframes mapa-salto {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-14px) scale(1.05); }
  60%  { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- Legenda ---------- */
#mapa-atuacao .mapa-legenda {
  min-width: 210px;
  padding: 20px 16px;
  background: var(--mapa-card);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(70,100,140,0.15), inset 0 0 0 1px rgba(70,100,140,0.06);
}

#mapa-atuacao .mapa-legenda h3 {
  margin: 0 0 12px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  text-align: left;
  color: #7a8aa3;
}

#mapa-atuacao .mapa-legenda ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#mapa-atuacao .mapa-legenda li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--mapa-text);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

#mapa-atuacao .mapa-legenda li.mapa-pais {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(70,100,140,0.1);
  border-radius: 0 0 10px 10px;
}

#mapa-atuacao .mapa-legenda li:hover,
#mapa-atuacao .mapa-legenda li.mapa-ativo {
  background: #fff3d6;
  transform: translateX(4px);
}

#mapa-atuacao .mapa-legenda li.mapa-pais:hover,
#mapa-atuacao .mapa-legenda li.mapa-pais.mapa-ativo {
  background: #e2f6ec;
}

#mapa-atuacao .mapa-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #F4908F;
}

#mapa-atuacao .mapa-legenda li.mapa-pais .mapa-dot {
  background: #74D6AC;
}

/* ---------- Tooltip ---------- */
#mapa-atuacao .mapa-tooltip {
  position: fixed;
  z-index: 1000;
  padding: 6px 12px;
  background: #ffffff;
  color: var(--mapa-text);
  border: 1px solid rgba(240,180,60,0.7);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(70,100,140,0.15);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -130%);
  transition: opacity 0.12s ease;
}

#mapa-atuacao .mapa-tooltip.mapa-visible {
  opacity: 1;
}

/* ---------- Pins ---------- */
#mapa-atuacao #mapa-pins-layer .mapa-pin {
  cursor: pointer;
  transform-box: fill-box;
  animation: mapa-cair 0.6s cubic-bezier(.36,1.6,.4,1) backwards;
}

#mapa-atuacao #mapa-pins-layer .mapa-pin-body {
  transition: transform 0.15s ease;
}

#mapa-atuacao #mapa-pins-layer .mapa-pin:hover .mapa-pin-body {
  transform: scale(1.25);
  transform-origin: 12px 9px;
}

@keyframes mapa-cair {
  0%   { transform: translateY(-40px); opacity: 0; }
  70%  { transform: translateY(3px); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  #mapa-atuacao { padding: 32px 12px; }
  #mapa-atuacao .mapa-wrapper { padding: 16px; }
  #mapa-atuacao .mapa-legenda { width: min(90vw, 620px); }
}
