/* Карточка события на карте афиши */
.inaia-map-balloon {
  width: 260px;
  max-width: min(260px, 82vw);
  font-family: inherit;
  color: #2a2a2a;
  overflow: hidden;
  background: #fff;
  position: relative;
}

.inaia-map-panel__toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inaia-map-panel__toolbar--balloon {
  top: 8px;
  right: 8px;
}

.inaia-map-panel__zoom,
.inaia-map-balloon__close,
.inaia-map-cluster-balloon__close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 20, 0.45);
  color: #fff;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.inaia-map-panel__zoom:hover,
.inaia-map-balloon__close:hover,
.inaia-map-cluster-balloon__close:hover {
  background: rgba(20, 20, 20, 0.62);
}

.inaia-map-panel__zoom svg,
.inaia-map-balloon__close svg,
.inaia-map-cluster-balloon__close svg {
  display: block;
}

.inaia-map-balloon__media {
  position: relative;
  background: #fff;
}

.inaia-map-balloon__cover {
  position: relative;
  z-index: 1;
  height: 132px;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-color: #eef1f6;
  border-radius: 0;
  display: block;
}

.inaia-map-balloon__cover--empty {
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%);
}

/* Бейдж категории поверх афиши, левый нижний угол */
.inaia-map-balloon__cat {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 48px);
  padding: 3px 10px 3px 3px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%);
  box-shadow: 0 4px 14px rgba(40, 30, 70, 0.35);
  pointer-events: none;
}

.inaia-map-balloon__cat-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgb(103, 125, 158);
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.inaia-map-balloon__cat-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2px;
}

.inaia-map-balloon__cats {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: calc(100% - 48px);
  pointer-events: none;
}

.inaia-map-balloon__cats .inaia-map-balloon__cat {
  position: static;
  left: auto;
  bottom: auto;
  max-width: 100%;
}

/* Теги организации в балуне — без иконки, ровные отступы */
.inaia-map-balloon__cat--plain {
  padding: 5px 10px;
  gap: 0;
  line-height: 1;
  min-height: 24px;
  box-sizing: border-box;
}

.inaia-map-balloon__cat--plain .inaia-map-balloon__cat-label {
  display: block;
  line-height: 14px;
  padding: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inaia-map-balloon__body {
  padding: 12px 14px 14px;
}

.inaia-map-balloon__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 2px;
  padding-right: 8px;
}

.inaia-map-balloon__row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: #696969;
  line-height: 1.4;
  margin-top: 4px;
}

.inaia-map-balloon__row svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.inaia-map-balloon__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff !important;
  border: none;
  background: linear-gradient(135deg, #8AB7D5, #9978D0);
  box-shadow: 0 0 16px rgba(153, 120, 208, 0.35);
}

.inaia-map-balloon__row--subtitle {
  font-size: 14px;
  color: #3a3a3a;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 2px;
}

/* Оболочка балуна Яндекса */
[class*="balloon__layout"],
[class*="balloon_layout"] {
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 12px 32px rgba(60, 50, 90, 0.18) !important;
}

[class*="balloon__content"] {
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: #fff !important;
}

/* Скрываем штатный крестик Яндекса (не трогаем наши кнопки закрытия) */
[class*="balloon__close-button"],
[class*="balloon__close"]:not(.inaia-map-balloon__close):not(.inaia-map-cluster-balloon__close) {
  display: none !important;
}

/* Общая «рамка» карт — мягкий градиент INAIA */
.inaia-map-frame {
  border: 2px solid transparent;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(#eef1f5, #eef1f5) padding-box,
    linear-gradient(
      145deg,
      rgba(138, 183, 213, 0.72) 0%,
      rgba(186, 200, 230, 0.55) 42%,
      rgba(210, 190, 235, 0.58) 68%,
      rgba(153, 120, 208, 0.62) 100%
    ) border-box;
  box-shadow:
    0 1px 2px rgba(20, 20, 20, 0.04),
    0 10px 28px rgba(60, 50, 90, 0.1);
}

.event-feed-map-wrap #event-feed-map,
#event-map-picker {
  box-shadow: none;
}

.event-feed-map-wrap #event-feed-map.inaia-map-frame,
#event-map-picker.inaia-map-frame {
  border-radius: 16px;
}

.event-feed-map-shell {
  position: relative;
}

.event-feed-map-fs-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: #3a3a3a;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(20, 20, 20, 0.16);
  -webkit-tap-highlight-color: transparent;
}

.event-feed-map-fs-btn:not([hidden]) {
  display: inline-flex;
}

.event-feed-map-fs-btn:hover {
  background: #fff;
}

.event-feed-map-fs-btn:active {
  transform: scale(0.96);
}

.event-feed-map-fs-btn__icon {
  display: block;
}

.event-feed-map-fs-btn__icon--exit {
  display: none;
}

.event-feed-map-shell.is-fullscreen .event-feed-map-fs-btn__icon--enter {
  display: none;
}

.event-feed-map-shell.is-fullscreen .event-feed-map-fs-btn__icon--exit {
  display: block;
}

.event-feed-map-shell.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10040;
  padding: 0;
  background: #eef1f5;
}

.event-feed-map-shell.is-fullscreen #event-feed-map,
.event-feed-map-shell.is-fullscreen #event-feed-map.inaia-map-frame,
.event-feed-map-shell.is-fullscreen #org-catalog-map,
.event-feed-map-shell.is-fullscreen #org-catalog-map.inaia-map-frame,
.event-feed-map-shell.is-fullscreen #organization-show-map,
.event-feed-map-shell.is-fullscreen #organization-show-map.inaia-map-frame {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.event-feed-map-shell.is-fullscreen .event-feed-map-fs-btn {
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
}

body.is-event-map-fullscreen {
  overflow: hidden;
}

/* Мини-карта на странице события */
.event-show-map-block {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 12px;
}

.event-show-map-block #event-show-map,
.event-show-map-block #organization-show-map {
  width: 100%;
  height: 220px;
  background: #eef1f5;
}

.event-show-map-block #event-show-map.inaia-map-frame,
.event-show-map-block #organization-show-map.inaia-map-frame {
  border-radius: 14px;
}

.event-show-map-block__link {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: #9978d0;
  font-weight: 600;
  text-decoration: none;
}

/* Центрированная панель списка событий поверх карты */
.inaia-map-cluster-panel {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 20px 20px;
  pointer-events: none;
}

.inaia-map-cluster-panel[hidden] {
  display: none !important;
}

/* Список событий в одной точке */
.inaia-map-cluster-balloon {
  position: relative;
  width: min(320px, 100%);
  max-width: 100%;
  background: #fff;
  font-family: inherit;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(60, 50, 90, 0.2);
  pointer-events: auto;
  box-sizing: border-box;
}

.inaia-map-cluster-balloon__head {
  padding: 14px 76px 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%);
}

.inaia-map-cluster-balloon__list {
  max-height: min(320px, 52vh);
  overflow-x: hidden;
  overflow-y: auto;
}

.inaia-map-cluster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  text-align: left;
  color: #2a2a2a;
  cursor: pointer;
}

.inaia-map-cluster-item:last-child {
  border-bottom: none;
}

.inaia-map-cluster-item:hover {
  background: #f7f8fb;
}

.inaia-map-cluster-item__thumb {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: #eef1f6;
}

.inaia-map-cluster-item__thumb--empty {
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%);
}

.inaia-map-cluster-item__body {
  min-width: 0;
  flex: 1;
}

.inaia-map-cluster-item__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.inaia-map-cluster-item__tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: #7f5fbf;
  background: rgba(153, 120, 208, 0.14);
}

.inaia-map-cluster-item__meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #696969;
  line-height: 1.3;
}

.inaia-map-cluster-panel .inaia-map-balloon {
  width: min(280px, 100%);
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(60, 50, 90, 0.2);
  pointer-events: auto;
}

[class*="cluster-balloon"] [class*="accordion"],
[class*="cluster-balloon"] [class*="content"] {
  font-family: inherit;
}

/* Кластеры на карте — градиент INAIA (фон: clusterIcons SVG, цифра: content layout) */
.inaia-map-cluster__count {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  font-family: inherit;
  user-select: none;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.inaia-map-cluster__hit {
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .inaia-map-cluster__count {
    font-size: 13px;
    font-weight: 500;
  }
}

/* Пин подкатегории теперь рисуется как одна картинка (canvas) — HTML-layout не используем */
