* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  height: 100vh;
  background: #eef6fb;
  color: #123;
  overflow: hidden;
}

.topo {
  height: 65px;
  padding: 0 6%;
  background: linear-gradient(135deg, #0878a8, #18a9d8, #4b45d6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.logo {
  font-size: 20px;
  font-weight: bold;
}

nav {
  display: flex;
  gap: 22px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
}

.layout {
  height: calc(100vh - 65px);
  display: grid;
  grid-template-columns: 380px 1fr;
}

.painel {
  background: white;
  padding: 25px;
  overflow-y: auto;
  border-right: 1px solid #ddd;
}

.painel h1 {
  font-size: 28px;
  color: #0878a8;
  margin-bottom: 10px;
}

.painel p {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
}

#busca {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid #ccc;
  margin-bottom: 18px;
  font-size: 15px;
}

.filtros {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.filtros button {
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: #eef6fb;
  color: #0878a8;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}

.filtros button:hover,
.filtros button.ativo {
  background: #0878a8;
  color: white;
}

.lista-locais {
  display: grid;
  gap: 12px;
}

.local-card {
  padding: 14px;
  border-radius: 12px;
  background: #f5f8fb;
  border: 1px solid #dce8f1;
  cursor: pointer;
  transition: 0.2s;
}

.local-card:hover {
  background: #e8f5ff;
  transform: translateY(-2px);
}

.local-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: #0878a8;
  margin-bottom: 5px;
}

.local-icone,
.marcador {
  --icone-cor: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--icone-cor);
  color: white;
}

.local-icone {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.local-icone span {
  transform: rotate(45deg);
}

.local-icone-saude,
.marcador-saude {
  --icone-cor: #188038;
}

.local-icone-educacao,
.marcador-educacao {
  --icone-cor: #1a73e8;
}

.local-icone-seguranca,
.marcador-seguranca {
  --icone-cor: #5f6368;
}

.local-icone-assistencia,
.marcador-assistencia {
  --icone-cor: #9334e6;
}

.local-icone-trabalho,
.marcador-trabalho {
  --icone-cor: #f29900;
}

.local-icone-documentos,
.marcador-documentos {
  --icone-cor: #0b8043;
}

.marcador-wrapper {
  background: transparent;
  border: 0;
}

.marcador {
  --pin-size: 28px;
  position: relative;
  width: var(--pin-size);
  height: var(--pin-size);
  border: max(2px, calc(var(--pin-size) * 0.07)) solid white;
  border-radius: 50% 50% 50% 0;
  font-size: calc(var(--pin-size) * 0.42);
  font-weight: 800;
  transform: rotate(-45deg);
  box-shadow: 0 calc(var(--pin-size) * 0.11) calc(var(--pin-size) * 0.36) rgba(15, 23, 42, 0.28);
}

.marcador span {
  transform: rotate(45deg);
}

.local-card p {
  font-size: 13px;
  margin-bottom: 4px;
}

.local-card .acoes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.local-card a {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 8px;
  background: #0878a8;
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
}

.sem-mapa {
  display: inline-block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.categoria {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 20px;
  background: #dff3ff;
  color: #0878a8;
  font-size: 12px;
  font-weight: bold;
}

#mapa {
  width: 100%;
  height: 100%;
}

.popup h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0878a8;
  margin-bottom: 6px;
}

.popup p {
  margin: 5px 0;
}

.popup a {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #0878a8;
  color: white;
  text-decoration: none;
  font-weight: bold;
}

.language-switcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 330px;
  padding: 8px;
  border: 1px solid #d8dee9;
  border-radius: 14px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 10px 26px rgba(0,0,0,0.16);
  backdrop-filter: blur(10px);
}

.language-switcher button {
  border: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #eef6fb;
  color: #0878a8;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.language-switcher button.ativo {
  background: #0878a8;
  color: white;
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topo {
    height: auto;
    min-height: 58px;
    padding: 12px 16px;
  }

  .logo {
    font-size: 17px;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 52vh auto;
    min-height: calc(100vh - 58px);
    height: auto;
  }

  #mapa {
    grid-row: 1;
    min-height: 360px;
  }

  .painel {
    grid-row: 2;
    padding: 18px 16px 92px;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-top: 1px solid #ddd;
  }

  .painel h1 {
    font-size: 24px;
  }

  .painel p {
    font-size: 14px;
    margin-bottom: 14px;
  }

  #busca {
    padding: 12px;
    margin-bottom: 12px;
  }

  .filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin: 0 -16px 16px;
    padding-left: 16px;
    padding-right: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .filtros button {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 13px;
  }

  .local-card {
    padding: 12px;
  }

  .local-card h3 {
    align-items: flex-start;
    font-size: 15px;
    line-height: 1.3;
  }

  nav {
    display: none;
  }

  .language-switcher {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-content: center;
    max-width: none;
  }

  .language-switcher button {
    flex: 1 1 auto;
    min-width: 68px;
  }
}

@media (max-width: 520px) {
  .layout {
    grid-template-rows: 46vh auto;
  }

  #mapa {
    min-height: 300px;
  }

  .leaflet-control-zoom {
    transform: scale(0.9);
    transform-origin: top left;
  }
}
