/* ================================
   CONTAINER PRINCIPAL
================================ */
.mapa-produtores {
  position: relative;
  max-width: 960px;
  margin: auto;
}

/* ================================
   SVG WRAPPER
================================ */
.mapa-svg-wrapper {
  position: relative;
  width: 100%;
}

.mapa-svg-wrapper svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ================================
   MAPA DO BRASIL — ESTADOS
================================ */
.mapa-svg-wrapper svg path,
.mapa-svg-wrapper svg polygon {
  fill: #e9e4dc;
  stroke: #d6d0c5;
  stroke-width: 1;
  transition: fill .25s ease, transform .25s ease;
  cursor: pointer;
}

.mapa-svg-wrapper svg path:hover,
.mapa-svg-wrapper svg polygon:hover {
  fill: #1f3d1b;
  transform: scale(1.02);
}

.mapa-svg-wrapper svg text {
  fill: #ffffff !important;
  pointer-events: none;
  user-select: none;
}

/* ================================
   CAMADA DE MARCADORES (SVG)
================================ */

/* IMPORTANTE:
   - Permite clique
   - Fica acima do mapa
*/
#markers-layer {
  pointer-events: all;
}

/* Grupo do marcador */
.marker-svg {
  cursor: pointer;
  pointer-events: all;
}

/* Evita o mapa "comer" o clique */
.mapa-svg-wrapper svg > g:not(.marker-svg) {
  pointer-events: auto;
}

/* ================================
   MARCADOR SVG (PULSANTE)
================================ */
.marker-svg circle:first-child {
  fill: #7bbf44;
  transition: fill .2s ease;
}

.marker-svg:hover circle:first-child {
  fill: #1f3d1b;
}

/* ================================
   TOOLTIP (se usar futuramente no SVG)
================================ */
.marker-svg text {
  pointer-events: none;
  user-select: none;
}

/* ================================
   LEGENDA LOVABLE
================================ */
.mapa-legenda-lovable {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.mapa-legenda-lovable .legenda-titulo {
  font-size: 12px;
  font-weight: 600;
  color: #1f3d1b;
  margin-bottom: 8px;
}

.mapa-legenda-lovable .legenda-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
}

.mapa-legenda-lovable .legenda-dot {
  width: 12px;
  height: 12px;
  background: #7bbf44;
  border-radius: 50%;
}

.mapa-legenda-lovable .legenda-total {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

/* ================================
   POPUP
================================ */
#popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  z-index: 9000;
}

#popup-produtor {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fbf9f5;
  border-radius: 20px;
  padding: 22px;
  width: calc(100% - 32px);
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.25);
  z-index: 9100;
}

#popup-produtor.hidden,
#popup-overlay.hidden {
  display: none !important;
}

/* ================================
   MOBILE
================================ */
@media (max-width: 768px) {
  .mapa-legenda-lovable {
    bottom: 6px;
    left: 6px;
    padding: 6px 8px;
  }
}

/* =================================================
   BOTÃO FECHAR — ESTILO FINAL CORRETO
================================================= */
#popup-produtor .popup-close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: 2px solid #dc2626;
  background: #ffffff;

  color: #dc2626;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;

  cursor: pointer;
  z-index: 20;
}

/* Hover */
#popup-produtor .popup-close:hover {
  background: #dc2626;
  color: #ffffff;
}

/* Anel externo elegante */
#popup-produtor .popup-close::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(220, 38, 38, 0.35);
  pointer-events: none;
}

/* ================================
   POPUP — PADRÃO DE ALTURA
================================ */

#popup-produtor {
  max-height: 85vh; /* padrão desktop */
  display: flex;
  flex-direction: column;
}

/* Área rolável do conteúdo */
#popup-content {
  overflow-y: auto;
  padding-right: 6px; /* evita cortar scrollbar */
}

/* Scroll bonito e discreto */
#popup-content::-webkit-scrollbar {
  width: 6px;
}

#popup-content::-webkit-scrollbar-track {
  background: transparent;
}

#popup-content::-webkit-scrollbar-thumb {
  background-color: rgba(31, 61, 27, 0.35);
  border-radius: 4px;
}

/* ================================
   MOBILE
================================ */
@media (max-width: 768px) {
  #popup-produtor {
    max-height: 90vh;
  }
}

