/* BlueGreen map markers: soft teardrop + category color + simple white icon. */

.map-pin,
.legend-pin {
  position: relative;
  display: block;
  transform-origin: 50% 100%;
}

.map-pin {
  width: 30px;
  height: 40px;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 2px 3px rgba(15, 79, 103, 0.24));
  transition: transform 140ms ease, filter 140ms ease;
}

.legend-pin {
  width: 22px;
  height: 29px;
  filter: drop-shadow(0 0 1px #fff);
}

.map-pin::before,
.legend-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ui-blue, #176f8f);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Cpath d='M15 1C7.3 1 1 7.2 1 15c0 9.9 14 24 14 24s14-14.1 14-24C29 7.2 22.7 1 15 1Z' fill='black'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Cpath d='M15 1C7.3 1 1 7.2 1 15c0 9.9 14 24 14 24s14-14.1 14-24C29 7.2 22.7 1 15 1Z' fill='black'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.map-pin-land::before,
.legend-pin.map-pin-land::before {
  background: var(--ui-green, #6f8f63);
}

.map-pin-mixed::before,
.legend-pin.map-pin-mixed::before {
  background: linear-gradient(135deg,
    var(--ui-blue, #176f8f) 0 48%,
    #fff 48% 52%,
    var(--ui-green, #6f8f63) 52% 100%);
}

.map-pin-face {
  position: absolute;
  top: 7px;
  left: 50%;
  z-index: 1;
  display: flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  color: #fff;
  pointer-events: none;
}

.legend-pin .map-pin-face {
  top: 5px;
  width: 13px;
  height: 13px;
}

.map-pin .marker-icon {
  width: 14px;
  height: 14px;
  fill: none;
  color: currentColor;
}

.map-pin .marker-icon-mixed {
  width: 15px;
  height: 15px;
}

.legend-pin .marker-icon {
  width: 10px;
  height: 10px;
}

.legend-pin .marker-icon-mixed {
  width: 11px;
  height: 11px;
}

.map-pin.is-selected {
  transform: scale(1.12);
  filter:
    drop-shadow(0 0 1px #fff)
    drop-shadow(0 0 3px rgba(23, 111, 143, 0.78))
    drop-shadow(0 4px 5px rgba(15, 79, 103, 0.28));
}

@media (hover: hover) and (pointer: fine) {
  .map-pin:hover {
    transform: translateY(-1px) scale(1.06);
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 4px 5px rgba(15, 79, 103, 0.24));
  }
}

.map-wayfinding-legend {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 700;
  max-width: min(270px, calc(100% - 28px));
  border: 1px solid var(--ui-line, #c9dce4);
  border-radius: 10px;
  background: rgba(251, 253, 255, 0.96);
  color: var(--ui-text, #10252e);
  box-shadow: 0 6px 18px rgba(15, 79, 103, 0.12);
  backdrop-filter: blur(10px);
}

.map-wayfinding-legend summary {
  min-height: 40px;
  cursor: pointer;
  padding: 10px 13px;
  color: var(--ui-blue-deep, #0f4f67);
  font: 700 12px/1.2 Inter, system-ui, sans-serif;
  list-style-position: inside;
}

.map-wayfinding-legend-body {
  display: grid;
  gap: 9px;
  min-width: 220px;
  border-top: 1px solid var(--ui-line, #c9dce4);
  padding: 10px 12px 12px;
}

.map-legend-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.map-legend-item > span:last-child {
  display: grid;
  gap: 1px;
}

.map-legend-item strong {
  color: var(--ui-text, #10252e);
  font: 700 12px/1.2 Inter, system-ui, sans-serif;
}

.map-legend-item small {
  color: var(--ui-muted, #5a6f78);
  font: 500 10px/1.2 Inter, system-ui, sans-serif;
}

@media (max-width: 720px) {
  .map-wayfinding-legend {
    right: 12px;
    bottom: 12px;
  }

  .map-wayfinding-legend summary {
    min-height: 38px;
    padding: 9px 11px;
  }

  .map-wayfinding-legend-body {
    min-width: 205px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin {
    transition: none;
  }
}
