/* =============================================================
   MAP.CSS
   Secções:
     01 · Map Box
     02 · Zoom Controls
     03 · Marcador Customizado
     04 · Popup
     06 · Responsivo — Tablet (≤ 768px)
     07 · Responsivo — Telemóvel pequeno (≤ 420px)
============================================================= */


/* ─────────────────────────────────────────────────────────────
   01 · MAP BOX
   Contentor principal do mapa com borda dourada e sombra.
───────────────────────────────────────────────────────────── */
.map-box {
  width: 100%;
  height: 450px;
  overflow: hidden;
  position: relative;
  border-radius: 30px;
  background: #0e0a08;
  border: 2px solid rgba(214, 143, 20, 0.6);
  box-shadow:
    0 0 20px rgba(214, 143, 20, 0.25),
    0 0 50px rgba(0, 0, 0, 0.8);
}

#map {
  width: 100%;
  height: 100%;
  background: #0e0a08;
}

.leaflet-container {
  background: #0e0a08 !important;
}

/* Filtro de cor para os tiles do mapa — estilo escuro e dourado */
.leaflet-tile {
  filter:
    grayscale(1)
    invert(1)
    brightness(0.75)
    contrast(1.1)
    sepia(0.45)
    hue-rotate(-10deg)
    saturate(1.6);
}

/* Overlay gradiente por cima do mapa */
.map-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.32));
  z-index: 400;
}

/* Esconde o texto de atribuição do Leaflet */
.leaflet-control-attribution {
  display: none;
}


/* ─────────────────────────────────────────────────────────────
   02 · ZOOM CONTROLS
   Botões de zoom com estilo escuro e borda dourada.
───────────────────────────────────────────────────────────── */
.leaflet-control-container {
  position: relative;
  z-index: 999;
}

.leaflet-control-zoom {
  border: 1px solid rgba(214, 143, 20, 0.8) !important;
  border-radius: 10px !important;
  overflow: hidden;
  margin-bottom: 18px !important;
  margin-right: 18px !important;
  box-shadow: 0 0 14px rgba(214, 143, 20, 0.12);
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 36px !important;
  background: #0b0b0b !important;
  color: #d68f14 !important;
  font-size: 22px !important;
  border: none !important;
  transition: 0.25s;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.leaflet-control-zoom a:hover {
  background: #1a1a1a !important;
  color: #ffbe42 !important;
}


/* ─────────────────────────────────────────────────────────────
   03 · MARCADOR CUSTOMIZADO
   Pin dourado com animação de pulso contínuo.
───────────────────────────────────────────────────────────── */
.custom-marker-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.custom-marker-pin {
  position: absolute;
  top: 0;
  left: 50%;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle at 35% 35%, #ffcf66, #d68f14 60%, #8a5700 100%);
  border-radius: 50% 50% 50% 0;
  transform: translateX(-50%) rotate(-45deg);
  border: 3px solid #090606;
  box-shadow:
    0 0 0 3px rgba(214, 143, 20, 0.25),
    0 0 20px rgba(214, 143, 20, 0.5);
}

.custom-marker-pin::after {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  background: #050505;
  border-radius: 50%;
  top: 5px;
  left: 5px;
}

/* Anel de pulso animado por baixo do pin */
.custom-marker-pulse {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(214, 143, 20, 0.15);
  animation: marker-pulse 2s ease-out infinite;
}

@keyframes marker-pulse {
  0%   { transform: translateX(-50%) scale(0.8); opacity: 0.8; }
  70%  { transform: translateX(-50%) scale(1.6); opacity: 0; }
  100% { transform: translateX(-50%) scale(0.8); opacity: 0; }
}


/* ─────────────────────────────────────────────────────────────
   04 · POPUP
   Balão de informação com estilo escuro e borda dourada.
───────────────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid rgba(214, 143, 20, 0.3);
  border-radius: 14px;
  box-shadow: 0 0 20px rgba(214, 143, 20, 0.15);
  padding: 0;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
}

.map-popup {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-popup strong {
  color: #d68f14;
  font-size: 14px;
  font-weight: 700;
}

.map-popup span {
  color: #7e7770;
  font-size: 12px;
}

.leaflet-popup-tip {
  background: #0b0b0b;
}

.leaflet-popup-close-button {
  color: #7e7770 !important;
  font-size: 16px !important;
  padding: 6px 8px !important;
}

/* ─────────────────────────────────────────────────────────────
   06 · RESPONSIVO — TABLET / MOBILE (≤ 768px)
   Reduz altura do mapa e ajusta controlos.
───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  .map-box {
    height: 320px;
    border-radius: 20px;
    border-width: 1.5px;
  }

  .leaflet-control-zoom {
    margin-bottom: 12px !important;
    margin-right: 12px !important;
  }

  .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    font-size: 18px !important;
  }

  .map-popup {
    padding: 10px 14px;
  }

  .map-popup strong {
    font-size: 13px;
  }

  .map-popup span {
    font-size: 11px;
  }

  .custom-marker-pin {
    width: 22px;
    height: 22px;
  }

  .custom-marker-pulse {
    width: 28px;
    height: 28px;
    top: -3px;
  }
}


/* ─────────────────────────────────────────────────────────────
   07 · RESPONSIVO — TELEMÓVEL PEQUENO (≤ 420px)
   Ajustes finos para ecrãs muito estreitos.
───────────────────────────────────────────────────────────── */
@media (max-width: 420px) {

  .map-box {
    height: 260px;
    border-radius: 14px;
  }

  .leaflet-control-zoom a {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }

  .leaflet-popup-content-wrapper {
    border-radius: 10px;
  }
}