/*
  Interactive map styling — Contact page only.
  Scoped under .mf-map-wrap / .mf-map so nothing here can leak into or
  conflict with the rest of assets/css/theme.css, which is left
  untouched. Uses the same CSS variables as the rest of the theme
  (defined in theme.css :root) so the map matches the site exactly.
*/

.mf-map-wrap {
  position: relative;
  width: 100%;
  height: 460px;
  background: var(--mf-panel, #0e1210);
}

.mf-map {
  width: 100%;
  height: 100%;
}

/* Google's own InfoWindow chrome is white by default — restyle it to
   match the dark theme. These selectors target Google's generated
   classes, which is the standard supported way to theme InfoWindows. */
.gm-style .gm-style-iw-c {
  background: var(--mf-panel, #0e1210) !important;
  border: 1px solid var(--mf-green-dim, #163a26) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7) !important;
  padding: 0 !important;
}
.gm-style .gm-style-iw-d { overflow: auto !important; }
.gm-style .gm-style-iw-t::after { background: var(--mf-panel, #0e1210) !important; }
.gm-style .gm-ui-hover-effect { filter: invert(1); opacity: 0.7; }

.mf-map-infowindow {
  padding: 14px 16px;
  font-family: inherit;
  min-width: 180px;
}
.mf-map-infowindow h4 {
  color: #fff;
  font-size: 0.95rem;
  margin: 0 0 6px;
}
.mf-map-infowindow p {
  color: var(--mf-muted, #9aa39d);
  font-size: 0.8rem;
  margin: 0 0 4px;
  line-height: 1.4;
}
.mf-map-infowindow p:last-child { margin-bottom: 0; }
.mf-map-infowindow .accent { color: var(--mf-green, #22C55E); }

/* ---------------- Current-location marker (pulsing dot) ---------------- */
.mf-current-location-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}
.mf-current-location-dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mf-green, #22C55E);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25), 0 0 16px 4px rgba(34, 197, 94, 0.55);
}
.mf-current-location-dot::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, 0.55);
  animation: mf-pulse 2.2s ease-out infinite;
}
@keyframes mf-pulse {
  0%   { transform: scale(0.4); opacity: 0.9; }
  80%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
.mf-current-location-label {
  margin-top: 6px;
  background: rgba(9, 9, 9, 0.85);
  border: 1px solid var(--mf-green-dim, #163a26);
  color: var(--mf-green, #22C55E);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------- Service-location pins ---------------- */
.mf-service-pin-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 4;
}
.mf-service-pin {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.65));
}
.mf-service-pin-label {
  margin-top: 4px;
  background: rgba(9, 9, 9, 0.9);
  border: 1px solid var(--mf-green-dim, #163a26);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.6);
}
.mf-service-pin-marker:hover .mf-service-pin-label { border-color: var(--mf-green, #22C55E); }

/* ---------------- Legend ---------------- */
.mf-map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  background: rgba(9, 9, 9, 0.78);
  border: 1px solid var(--mf-border, #1c2b22);
  border-radius: 0.75rem;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  backdrop-filter: blur(4px);
}
.mf-map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--mf-muted-2, #c7cdc9);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.mf-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mf-green, #22C55E);
  box-shadow: 0 0 8px 2px rgba(34, 197, 94, 0.6);
  flex: none;
}
.mf-legend-pin {
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  background: var(--mf-green, #22C55E);
  transform: rotate(-45deg);
  flex: none;
}

/* ---------------- Scale bar ---------------- */
.mf-map-scale {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  background: rgba(9, 9, 9, 0.78);
  border: 1px solid var(--mf-border, #1c2b22);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.68rem;
  color: var(--mf-muted-2, #c7cdc9);
  text-align: center;
}
.mf-map-scale-bar {
  height: 2px;
  background: var(--mf-muted-2, #c7cdc9);
  margin-top: 3px;
}

/* ---------------- Denied-geolocation note ---------------- */
.mf-map-geo-note {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(9, 9, 9, 0.85);
  border: 1px solid var(--mf-border, #1c2b22);
  color: var(--mf-muted-2, #c7cdc9);
  font-size: 0.72rem;
  padding: 6px 14px;
  border-radius: 999px;
  max-width: 90%;
  text-align: center;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 767.98px) {
  .mf-map-wrap { height: 340px; }
  .mf-map-legend { left: 10px; bottom: 10px; padding: 8px 10px; gap: 4px; }
  .mf-map-legend-item { font-size: 0.62rem; }
  .mf-map-scale { display: none; } /* avoid crowding a small map on mobile */
  .mf-service-pin-label, .mf-current-location-label { font-size: 0.62rem; padding: 2px 6px; }
  .mf-map-geo-note { font-size: 0.65rem; padding: 5px 10px; }
}
