*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
  background: #1b2a2f;
}

/* Marcadores com foto */
.marcador-icone {
  pointer-events: none;
}

.marcador {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  cursor: pointer;
}

.marcador-foto,
.marcador-nome {
  pointer-events: auto;
}

.marcador-foto {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ccc center / cover no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.marcador:hover .marcador-foto,
.marcador.ativo .marcador-foto {
  transform: scale(1.15);
  border-color: #ffd23f;
}

.marcador-nome {
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Em zoom baixo os nomes só aparecem no hover/ativo, para não se sobreporem */
.zoom-baixo .marcador-nome {
  display: none;
}

.zoom-baixo .marcador:hover .marcador-nome,
.zoom-baixo .marcador.ativo .marcador-nome {
  display: block;
}

/* Popup */
.leaflet-popup-content {
  margin: 0;
  width: 260px !important;
}

.leaflet-popup-content-wrapper {
  padding: 0;
  overflow: hidden;
}

.popup-imagem {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.popup-corpo {
  padding: 10px 14px 14px;
}

.popup-corpo h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.popup-link {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 6px;
  background: #2e7d32;
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.popup-link:hover,
.popup-link:focus {
  background: #1b5e20;
}

/* Painel lateral */
.painel {
  position: absolute;
  top: 10px;
  left: 54px;
  z-index: 1000;
  width: 280px;
  max-height: calc(100% - 20px);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.painel-toggle {
  display: none;
  border: 0;
  padding: 10px 14px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.painel-conteudo {
  padding: 14px;
  overflow-y: auto;
}

.painel h1 {
  margin: 0;
  font-size: 18px;
}

.subtitulo {
  margin: 4px 0 12px;
  color: #555;
  font-size: 13px;
}

.lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lista button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.lista button:hover,
.lista button:focus-visible,
.lista button.ativo {
  background: #e8f5e9;
}

.lista img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.ver-todos {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid #2e7d32;
  border-radius: 6px;
  background: #fff;
  color: #2e7d32;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .painel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 24px;
    width: auto;
    max-height: 50%;
  }

  .painel-toggle {
    display: block;
  }

  .painel.recolhido .painel-conteudo {
    display: none;
  }

  .marcador-nome {
    font-size: 12px;
  }
}
