/* CSS виджетa. Подключайте после maplibre-gl.css. */
.im-map-marker {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  /* ВАЖНО: не задавать transform/transition на корне маркера.
     MapLibre сам задаёт transform этому элементу для геопозиционирования. */
}

.im-map-marker:focus-visible {
  outline: 3px solid #253d57;
  outline-offset: 3px;
  border-radius: 12px;
}

.im-map-marker__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(37, 53, 55, .22));
  transform-origin: 50% 90%;
  transition: transform .18s ease, filter .18s ease;
  pointer-events: none;
}

.im-map-marker:hover .im-map-marker__image,
.im-map-marker:focus-visible .im-map-marker__image {
  transform: translateY(-4px) scale(1.08);
  filter: drop-shadow(0 7px 7px rgba(37, 53, 55, .28));
}

.im-map-marker__fallback {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 12%;
  background: var(--im-marker-color, #79a7a0);
  box-shadow: 0 3px 12px rgba(37, 53, 55, .22);
  transform: rotate(-45deg);
  transform-origin: center;
  transition: transform .18s ease;
  pointer-events: none;
}

.im-map-marker__emoji {
  display: block;
  font-size: 25px;
  line-height: 1;
  transform: rotate(45deg);
}

.im-map-marker:hover .im-map-marker__fallback,
.im-map-marker:focus-visible .im-map-marker__fallback {
  transform: rotate(-45deg) translateY(-3px) scale(1.08);
}

.im-map-popup-container .maplibregl-popup-content {
  overflow: hidden;
  padding: 0;
  border-radius: 15px;
  box-shadow: 0 9px 30px rgba(33, 50, 53, .18);
  font-family: inherit;
}

.im-map-popup-container .maplibregl-popup-close-button {
  z-index: 1;
  top: 7px;
  right: 7px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: #34443e;
  background: rgba(255, 255, 255, .92);
  font-size: 19px;
}

.im-map-popup-container .maplibregl-popup-close-button:hover {
  background: #fff;
}

.im-map-popup {
  max-width: 310px;
  color: #30413e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.im-map-popup__image {
  display: block;
  width: 100%;
  max-height: 155px;
  object-fit: cover;
  background: #f0eee7;
}

.im-map-popup__body {
  padding: 13px 15px 15px;
  border-top: 4px solid var(--im-popup-accent, #79a7a0);
}

.im-map-popup__title {
  margin: 0 25px 6px 0;
  color: #30413e;
  font: 600 18px/1.2 Georgia, "Times New Roman", serif;
}

.im-map-popup__address {
  color: #7a8982;
  font-size: 12px;
  line-height: 1.4;
}

.im-map-popup__description {
  margin: 8px 0 0;
  color: #596c65;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-line;
}

.im-map-popup__link {
  display: inline-flex;
  align-items: center;
  margin-top: 11px;
  color: #875b3e;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.im-map-popup__link:hover {
  text-decoration: underline;
}


