/* ---------------------------------------------------------------------------
   Página «Mapa de Cachopo» — estilos próprios, carregados só aqui.
   Segue as variáveis e o ritmo visual de assets/css/style.css.
   --------------------------------------------------------------------------- */

.map-section { padding-top: 8px; }

/* Nesta página a área útil é mais larga do que o resto do site. */
.container--wide { max-width: 1560px; }

.mapa-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin: 0 0 18px;
}

.mapa-search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 16px;
  box-shadow: 0 10px 24px -22px rgba(8, 32, 56, .6);
}
.mapa-search svg { width: 18px; height: 18px; color: var(--ink-soft); flex-shrink: 0; }
.mapa-search input {
  border: 0; background: transparent; font: inherit; color: var(--navy-950);
  width: 100%; outline: none; font-size: .95rem;
}
.mapa-search input::placeholder { color: #8798a8; }
.mapa-search:focus-within { border-color: var(--teal-500, #12b0a8); box-shadow: 0 0 0 3px rgba(18, 176, 168, .16); }

.mapa-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.mapa-counts span {
  font-size: .78rem; color: var(--ink-soft); background: var(--sand, #f4efe6);
  border-radius: 999px; padding: 5px 11px;
}

.mapa-layout {
  display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px;
  align-items: start;
}

/* ------------------------------- barra lateral ---------------------------- */
.mapa-sidebar {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px; max-height: 660px; display: flex; flex-direction: column;
  box-shadow: 0 18px 45px -38px rgba(8, 32, 56, .7);
}
.mapa-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mapa-sidebar-head h2 { font-size: 1.02rem; color: var(--navy-950); margin: 0; }
.mapa-reset {
  border: 1px solid var(--line); background: var(--white); color: var(--brand-700, #0b67ac);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.mapa-reset:hover { background: var(--brand-700, #0b67ac); color: #fff; border-color: transparent; }

.mapa-lista { overflow-y: auto; padding-right: 4px; }
.mapa-lista::-webkit-scrollbar { width: 8px; }
.mapa-lista::-webkit-scrollbar-thumb { background: rgba(11, 58, 99, .18); border-radius: 999px; }

.mapa-grupo { margin-bottom: 6px; }
.mapa-grupo > button.mapa-grupo-head {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: transparent; border: 0; border-radius: 12px; padding: 9px 10px;
  font: inherit; font-weight: 700; font-size: .86rem; color: var(--navy-950);
  cursor: pointer; text-align: left; transition: background .2s var(--ease);
}
.mapa-grupo > button.mapa-grupo-head:hover { background: rgba(18, 176, 168, .1); }
.mapa-grupo-head .icone {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(18, 176, 168, .14); color: #0d7c76; flex-shrink: 0;
}
.mapa-grupo-head .icone svg { width: 15px; height: 15px; }
.mapa-grupo-head .contagem {
  margin-left: auto; font-size: .74rem; font-weight: 600; color: var(--ink-soft);
  background: var(--sand, #f4efe6); border-radius: 999px; padding: 2px 8px;
}
.mapa-grupo[data-open="false"] .mapa-itens { display: none; }

.mapa-itens { list-style: none; margin: 0 0 6px; padding: 0 0 0 6px; }
.mapa-itens li { margin: 0 0 2px; }
.mapa-item {
  width: 100%; display: block; text-align: left; background: transparent; border: 0;
  border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease);
  border-left: 3px solid transparent;
}
.mapa-item:hover { background: rgba(11, 103, 172, .08); }
.mapa-item[aria-current="true"] {
  background: rgba(11, 103, 172, .12); border-left-color: var(--brand-700, #0b67ac);
}
.mapa-item[aria-current="true"] .nome { color: var(--brand-700, #0b67ac); }
.mapa-item .nome { display: flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; color: var(--navy-950); }
.mapa-item .ponto {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}
.mapa-item .morada { display: block; font-size: .76rem; color: var(--ink-soft); }
.mapa-item .detalhe { display: block; font-size: .74rem; color: #6d7f8f; margin-top: 2px; }

/* --------------------------------- mapa ---------------------------------- */
.mapa-canvas {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); background: #e8eef3;
  box-shadow: 0 22px 55px -44px rgba(8, 32, 56, .85);
}
.mapa-leaflet { width: 100%; height: 640px; z-index: 0; }

/* ------------------------------- alfinetes -------------------------------- */
.mapa-pin { background: none; border: 0; }
.mapa-pin-ponto {
  position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: var(--cor); border: 2.5px solid #fff;
  box-shadow: 0 4px 10px -3px rgba(8, 32, 56, .7);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mapa-pin:hover .mapa-pin-ponto { transform: translate(-50%, -50%) scale(1.25); }
.mapa-pin.is-active .mapa-pin-ponto {
  transform: translate(-50%, -50%) scale(1.7);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .55), 0 8px 18px -6px rgba(8, 32, 56, .85);
}
.mapa-pin--centro .mapa-pin-ponto { width: 19px; height: 19px; }
.mapa-tooltip {
  border: 0; border-radius: 8px; padding: 4px 9px; font-size: .8rem; font-weight: 600;
  color: #0a2e4f; box-shadow: 0 8px 20px -12px rgba(8, 32, 56, .8);
}
.leaflet-container { font: inherit; background: #e8eef3; }

.mapa-legenda {
  position: absolute; left: 14px; bottom: 14px; max-width: min(420px, calc(100% - 28px));
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 14px; backdrop-filter: blur(6px);
  box-shadow: 0 16px 32px -26px rgba(8, 32, 56, .8);
}
.mapa-legenda strong { display: block; font-size: .9rem; color: var(--navy-950); }
.mapa-legenda span { display: block; font-size: .78rem; color: var(--ink-soft); margin-top: 2px; }
.mapa-legenda a {
  display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 600;
  color: var(--brand-700, #0b67ac); text-decoration: none;
}
.mapa-legenda a:hover { text-decoration: underline; }

.mapa-estado { color: var(--ink-soft); font-size: .86rem; padding: 8px 4px; }

.mapa-nota {
  margin-top: 14px; font-size: .84rem; color: var(--ink-soft);
}
.mapa-nota a { color: var(--brand-700, #0b67ac); font-weight: 600; text-decoration: none; }
.mapa-nota a:hover { text-decoration: underline; }

/* -------------------------------- telemóvel ------------------------------- */
@media (max-width: 900px) {
  .mapa-layout { grid-template-columns: 1fr; }
  .mapa-canvas { order: -1; }
  .mapa-leaflet { height: 380px; }
  .mapa-sidebar { max-height: none; }
  .mapa-lista { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  .mapa-item, .mapa-reset { transition: none; }
}
