#map a {
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#map a:hover path {
  fill: #0869c7;
}

svg text {
  font-size: 12px;
  pointer-events: none;
  user-select: none;
}

/* ============================= */
/* AJUSTE 1 — SVG RESPONSIVO 🔧 */
/* ============================= */
#map svg {
  width: 100%;
  height: auto;
  max-height: 90vh;
  display: block;
}

.tooltip-trigger {
  display: inline-block;
  padding: 10px 20px;
  margin: 10px;
  background: #667eea;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}

.tooltip-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 1);
  z-index: 9999;
}

.tooltip {
  position: fixed;
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  max-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.tooltip.show {
  opacity: 1;
}

.mainWrapper {
  width: 100%;
  max-width: 1300px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 20px;
  margin: 0 auto;
  align-items: start;
}

.mapaContainer {
  width: 100%;
  background: white;
  border-radius: 8px;
  padding: 20px;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */

  /* ============================= */
  /* AJUSTE 2 — NÃO CORTAR O MAPA */
  /* ============================= */
  overflow: visible;
}

#map {
  width: 100%;
  margin: 0 auto;
  display: block;
}

.mapStates {
  position: sticky;
  top: 20px;
}

.mapState {
  display: none;
  width: 100%;
  max-height: 70vh;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mapState {
  max-height: 90vh; /* limita altura ao viewport */
  display: none;
}

.mapStates .stateHeader {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: #054784;
  border-radius: 8px 8px 0 0;
  color: #fff;
  padding: 15px 20px;
}

.mapStates .stateTitle {
  font-size: 20px;
  font-weight: bold;
}

.mapStates .stateClose {
  display: flex;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  padding: 3px 12px;
  border-radius: 4px;
  cursor: pointer;
  background-color: #0d263d;
  transition: background-color 0.3s;
  min-width: 40px;
  height: 40px;
}

.mapStates .stateClose:hover {
  background-color: #1a3a52;
}

.stateContent {
  padding: 15px;
}

.stateContent {
  max-height: calc(80vh - 50px); /* desconta o header */
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px; /* espaço pro scrollbar */
}

.mapStates .stateWrapper {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 15px;
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.mapStates .stateWrapper:last-child {
  margin-bottom: 0;
}

.stateContent .representante {
  font-size: 14px;
  color: #555;
}

.stateContent .fantasia {
  font-size: 18px;
  font-weight: 600;
  color: #054784;
}

.stateContent .fone,
.stateContent .email,
.stateContent .regiao {
  font-size: 13px;
  color: #666;
}

.stateContent a {
  color: #054784;
  text-decoration: none;
}

.stateContent a:hover {
  text-decoration: underline;
}

.stateHeader {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.stateContent {
  scroll-behavior: smooth;
}

/* Responsividade para tablets */
@media all and (max-width: 1024px) {
  .mainWrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mapStates {
    position: relative;
    top: 0;
  }

  .mapState {
    max-height: max-content;
  }

  #map {
    max-width: 500px;
  }
}

/* Responsividade para mobile */
@media all and (max-width: 768px) {
  body {
    padding: 10px;
  }

  .mapaContainer {
    padding: 15px;
  }

  #map {
    max-width: 100%;
  }

  svg text {
    font-size: 10px;
  }

  .mapStates .stateHeader {
    padding: 12px 15px;
  }

  .mapStates .stateTitle {
    font-size: 18px;
  }

  .stateContent {
    padding: 10px;
  }

  .mapStates .stateWrapper {
    padding: 12px;
  }

  .stateContent .fantasia {
    font-size: 16px;
  }

  .stateContent .representante,
  .stateContent .fone,
  .stateContent .email,
  .stateContent .regiao {
    font-size: 12px;
  }

  .tooltip {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Responsividade para mobile pequeno */
@media all and (max-width: 480px) {
  body {
    padding: 5px;
  }

  .mainWrapper {
    gap: 15px;
  }

  .mapaContainer {
    padding: 10px;
    border-radius: 6px;
  }

  svg text {
    font-size: 8px;
  }

  .mapStates .stateHeader {
    padding: 10px 12px;
    border-radius: 6px 6px 0 0;
  }

  .mapStates .stateTitle {
    font-size: 16px;
  }

  .mapStates .stateClose {
    min-width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .stateContent {
    padding: 8px;
  }

  .mapStates .stateWrapper {
    padding: 10px;
    margin-bottom: 10px;
    gap: 6px;
  }

  .stateContent .fantasia {
    font-size: 15px;
  }

  .stateContent .representante,
  .stateContent .fone,
  .stateContent .email,
  .stateContent .regiao {
    font-size: 11px;
  }
}

/* Scrollbar personalizada */
.mapState::-webkit-scrollbar {
  width: 8px;
}

.mapState::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.mapState::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.mapState::-webkit-scrollbar-thumb:hover {
  background: #555;
}
