:root {
  --cor-verde-alga: #5f7d41;
  --cor-azul-mar: #1b5d8d;
  --cor-bege-areia: #efebe4;
  --cor-marrom-mangue: #573d07;
  --cor-mapa-bg: #71d7ac;
  --cor-mapa-bg: #34566e;
  --cor-mapa-bg: gray;
  --cor-mapa-tracejado: #52c4a0;

  /* ── Mapa: contorno externo ──────────────── */
  --cor-mapa-contorno: #7c7c7c;
  --espessura-mapa-contorno: 0; /* raio em unidades SVG (feMorphology) */

  /* ── Mapa: pontilhado interno ────────────── */
  --espessura-mapa-pontilhado: 1; /* stroke-width entre os estados   */
}

#mapa.pagina {
}

.mapa {
  background:
    linear-gradient(to bottom, rgba(9, 67, 115, 0.1) 0%, transparent 12%),
    linear-gradient(to top, rgba(9, 67, 115, 0.1) 0%, transparent 12%),
    radial-gradient(
      ellipse at 15% 85%,
      rgba(9, 67, 115, 0.13) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 85% 15%,
      rgba(9, 67, 115, 0.09) 0%,
      transparent 45%
    ),
    #ffffff;
}

/* ── Variáveis de cor ─────────────────────────────────────────────────────── */
.mapa-brasil-bloco {
  --cor-norte: var(--cor-mapa-bg);
  --cor-nordeste: var(--cor-mapa-bg);
  --cor-centro-oeste: var(--cor-mapa-bg);
  --cor-sudeste: var(--cor-mapa-bg);
  --cor-sul: var(--cor-mapa-bg);
  --cor-pin: #ffffff;
  --cor-pin-texto: #07182a;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.mapa-brasil-bloco {
  position: relative;
  width: 100%;
  margin-top: var(--r2);
  user-select: none;
}

.mapa-svg-wrapper {
  width: 50vw;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
  /* filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.08)); */
}

#brasil-mapa {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
}

/* ── Cores por região ─────────────────────────────────────────────────────── */
#BRAC,
#BRAM,
#BRAP,
#BRPA,
#BRRO,
#BRRR,
#BRTO {
  fill: var(--cor-norte);
}
#BRAL,
#BRBA,
#BRCE,
#BRMA,
#BRPB,
#BRPE,
#BRPI,
#BRRN,
#BRSE {
  fill: var(--cor-nordeste);
}
#BRDF,
#BRGO,
#BRMS,
#BRMT {
  fill: var(--cor-centro-oeste);
}
#BRES,
#BRMG,
#BRRJ,
#BRSP {
  fill: var(--cor-sudeste);
}
#BRPR,
#BRRS,
#BRSC {
  fill: var(--cor-sul);
}

#features circle {
  fill: var(--cor-norte);
}

/* Borda externa sólida — currentColor + espessura aplicados via JS */
#brasil-mapa #features {
  color: var(--cor-mapa-contorno);
  /* filter: url(#mapa-borda-externa); */
}

/* Bordas entre estados — branco suave, sem tracejado */
#brasil-mapa path,
#brasil-mapa circle {
  transition: fill 0.15s ease;
  stroke: rgba(180, 230, 255, 0.5);
  stroke-width: 0.8;
  stroke-dasharray: none;
}

/* Pins não herdam stroke dos estados */
#brasil-mapa .mapa-pin path,
#brasil-mapa .mapa-pin circle {
  stroke: none !important;
  stroke-dasharray: none !important;
  transition: none;
}

/* Hover: tint ciano sobre o gradiente/ondas */
#brasil-mapa #features path:hover {
  fill: rgba(77, 217, 255, 0.12) !important;
  cursor: pointer;
}

/* ── Pins ─────────────────────────────────────────────────────────────────── */
.mapa-pin {
  cursor: pointer;
  transition: filter 0.15s ease;
}

.mapa-pin:hover {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)) brightness(1.15);
}

.mapa-pin-icone {
  fill: var(--cor-pin);
  filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.7));
}

.mapa-pin-badge-txt {
  fill: var(--cor-pin);
  stroke: none !important;
  stroke-width: 0 !important;
  font-family: sans-serif;
  font-weight: 700;
  font-size: 16px;
  text-anchor: start;
  dominant-baseline: central;
  pointer-events: none;
}

/* ── Controles de zoom ────────────────────────────────────────────────────── */
.mapa-controles {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mapa-btn {
  width: 32px;
  height: 32px;
  background: #094b7a;
  border: none;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background 0.15s;
  padding: 0;
  color: #fff;
}

.mapa-btn:hover {
  background: #0a5a93;
}

/* ── Tooltip ──────────────────────────────────────────────────────────────── */
.mapa-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  display: none;
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.mapa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mapa-modal-overlay[hidden] {
  display: none;
}

.mapa-modal {
  background: #f7f8fa;
  border-radius: 16px;
  max-width: 360px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.mapa-modal-cabecalho {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1rem 1rem;
  flex-shrink: 0;
}

.mapa-modal-header-ico {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--cor-1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mapa-modal-header-ico svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}

.mapa-modal-header-texto {
  flex: 1;
  min-width: 0;
}

.mapa-modal-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cor-1);
  margin: 0;
  line-height: 1.3;
}

.mapa-modal-subtitulo {
  font-size: 0.72rem;
  color: #999;
  margin: 0.15rem 0 0;
}

.mapa-modal-fechar {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.mapa-modal-fechar:hover {
  color: #333;
}

.mapa-modal-fechar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.mapa-modal-hr {
  border: none;
  border-top: 1px solid #eee;
  margin: 0;
  flex-shrink: 0;
}

.mapa-modal-lista {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.mapa-oficina-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

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

.mapa-oficina-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--cor-2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mapa-oficina-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mapa-oficina-nome {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cor-1);
  line-height: 1.3;
}

.mapa-oficina-meta {
  font-size: 0.7rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mapa-modal-icone {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: currentColor;
}

.mapa-oficina-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  flex-shrink: 0;
  transition: color 0.15s;
}

a.mapa-oficina-chevron:hover {
  color: var(--cor-2);
}

.mapa-oficina-chevron svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.mapa-oficina-chevron--vazio {
  width: 20px;
}

/* ── Layout com painel lateral ───────────────────────────────────────────── */
.mapa-brasil-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--r4);
  align-items: start;
}

.mapa-brasil-layout .mapa-svg-wrapper {
  width: 100%;
  max-width: 70%;
  margin: 0 auto;
  filter: drop-shadow(0 8px 40px rgba(27, 93, 141, 0.45));
}

.mapa-brasil-painel {
  display: flex;
  flex-direction: column;
  gap: var(--r1);
  padding-top: var(--r2);
}

@media (max-width: 992px) {
  .mapa-brasil-layout {
    grid-template-columns: 1fr;
  }

  .mapa-brasil-layout .mapa-svg-wrapper,
  .mapa-svg-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .mapa-brasil-bloco {
    display: flex;
    flex-direction: column;
  }

  .mapa-brasil-bloco .mapa-svg-wrapper {
    order: 1;
  }

  .mapa-pin-badge-txt {
    font-size: 42px;
  }

  .mapa-brasil-bloco .mapa-controles {
    order: 2;
    position: static;
    flex-direction: row;
    justify-content: center;
    margin-top: var(--r1);
  }
}

/* Painel lateral */
.mapa__painel {
  display: flex;
  flex-direction: column;
  gap: var(--r1);
}

.mapa__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--r1);
}

.mapa__stat {
  border: 1px solid #dce8f0;
  border-radius: 0.75rem;
  padding: var(--r1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  background-color: #fff;
}

.mapa__stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: #1b5d8d;
  line-height: 1;
}

.mapa__stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.35);
}

.mapa__lista-titulo {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cor-1);
  margin: 0;
}

.mapa__lista {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(4 * 5.5rem);
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 1rem;
  scrollbar-width: 8px;
  scrollbar-color: var(--cor-2) transparent;
}
.mapa__lista::-webkit-scrollbar {
  width: 8px;
}
.mapa__lista::-webkit-scrollbar-thumb {
  background: var(--cor-2);
  border-radius: 4px;
}
.mapa__lista::-webkit-scrollbar-track {
  background: transparent;
}

ul.mapa__lista,
ul.mapa__lista {
  margin-left: 0;
}

.mapa__filtro {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--cor-1);
  background: #fff;
  cursor: pointer;
}

.mapa__grupo {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mapa__grupo-nome {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cor-1);
  opacity: 0.5;
  padding-top: 0.25rem;
}

.mapa__grupo-lista {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-left: 0;
}

.mapa__vazio {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  padding: var(--r1);
}

.mapa__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #dce8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
  list-style: none;
}

.mapa__item:hover,
.mapa__item.mapa-item-ativo {
  border-color: #1b5d8d;
  background: #f0f6ff;
}

.mapa__num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: #1b5d8d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mapa__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mapa__nome {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cor-1);
  /* text-transform: capitalize; */
}

.mapa__meta {
  font-size: 0.72rem;
  color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}

.mapa__meta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: var(--cor-2);
  margin-top: 2px;
}

.mapa__link {
  font-size: 0.72rem;
  color: #1b5d8d;
  text-decoration: underline;
  margin-top: 0.15rem;
  width: fit-content;
}

@media (max-width: 992px) {
  .mapa {
    grid-template-columns: 1fr;
  }

  .mapa__lista {
    max-height: none;
    overflow-y: visible;
  }
}
