/*
 * Афиша на карте (/events?view=map): бейдж-пины с датой и карточка-шторка.
 * Только для event_feed (event-feed-map-ui.js). Карта организаций и мини-карты не затронуты.
 */

/* ---------- Пин-бейдж ---------- */
.inaia-badge-pin {
  position: relative;
  width: 40px;
  height: 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 20px 48px;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* filter на корне отключал бы backdrop-filter у плашки даты — тень вешаем на детей */
  animation: inaia-pin-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) backwards;
}

.inaia-badge-pin:hover {
  transform: translateY(-2px) scale(1.07);
}

.inaia-badge-pin.is-active {
  transform: scale(1.22);
}

.inaia-badge-pin__img {
  position: relative;
  z-index: 1;
  display: block;
  width: 40px;
  height: 48px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 3px 4px rgba(60, 40, 110, 0.3));
}

.inaia-badge-pin__chip {
  position: absolute;
  z-index: 0;
  left: 28px;
  top: 9px;
  height: 20px;
  padding: 0 9px 0 13px;
  border-radius: 999px;
  /* «Стекло»: полупрозрачная плашка с размытием карты под ней */
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(8px) saturate(1.7);
  backdrop-filter: blur(8px) saturate(1.7);
  box-shadow: 0 2px 8px rgba(60, 40, 110, 0.16);
  color: #3f3a52;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.inaia-badge-pin--soon .inaia-badge-pin__chip {
  color: #6c4cb0;
  background: rgba(243, 237, 255, 0.62);
}

.inaia-badge-pin--past .inaia-badge-pin__chip {
  color: var(--inaia-field-placeholder, #6e7a96);
  background: rgba(246, 248, 255, 0.55);
}

/* «Сегодня» — тёплый акцент, единственный на карте */
.inaia-badge-pin--today .inaia-badge-pin__chip {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 150, 96, 0.92) 0%, rgba(226, 84, 128, 0.92) 100%);
  box-shadow: 0 2px 8px rgba(226, 84, 128, 0.35);
}

.inaia-badge-pin.is-active .inaia-badge-pin__chip {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: linear-gradient(135deg, rgba(114, 176, 224, 0.95) 0%, rgba(138, 95, 208, 0.95) 100%);
  box-shadow: 0 2px 8px rgba(110, 80, 190, 0.35);
}

@keyframes inaia-pin-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.85);
  }
}

/* ---------- Кластер ---------- */
.event-feed-map-shell.is-sheet-ui .inaia-map-cluster__count {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- Шторка ---------- */
.event-feed-map-shell.is-sheet-ui .inaia-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  /* 30px снизу — чтобы остались видны логотип и копирайт Яндекс.Карт */
  padding: 0 10px calc(30px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.inaia-sheet[hidden] {
  display: none !important;
}

.inaia-sheet__card {
  position: relative;
  width: min(420px, 100%);
  box-sizing: border-box;
  padding: 0 12px 12px;
  border-radius: 22px;
  background: #fff;
  color: var(--inaia-field-text, #2a3142);
  font-family: inherit;
  pointer-events: auto;
  box-shadow:
    0 14px 40px rgba(60, 50, 90, 0.28),
    0 0 0 1px rgba(153, 120, 208, 0.1);
  opacity: 0;
  transform: translateY(26px);
  transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.2s ease;
}

.inaia-sheet.is-open .inaia-sheet__card {
  opacity: 1;
  transform: none;
}

.inaia-sheet__grab {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: 120px;
  height: 30px;
  margin-left: -60px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
  box-sizing: border-box;
  touch-action: none;
}

.inaia-sheet__grab span {
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #dfe4f2;
}

.inaia-sheet__bar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  margin-bottom: 8px;
  padding-top: 8px;
  pointer-events: none;
}

.inaia-sheet__bar > * {
  pointer-events: auto;
}

.inaia-sheet__bar .inaia-sheet__close {
  margin-left: auto;
}

.inaia-sheet__iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid var(--inaia-field-border, rgb(232, 237, 255));
  border-radius: 50%;
  background: var(--inaia-field-bg, #f6f8ff);
  color: #9aa3bd;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.inaia-sheet__iconbtn:hover {
  background: #eef1fb;
  color: #7f5fbf;
}

.inaia-sheet__iconbtn:active {
  transform: scale(0.94);
}

.inaia-sheet__bar .inaia-sheet__iconbtn,
.inaia-sheet__head .inaia-sheet__iconbtn {
  width: 32px;
  height: 32px;
}

.inaia-sheet__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px 0 8px;
  border: 2px solid var(--inaia-field-border, rgb(232, 237, 255));
  border-radius: 999px;
  background: var(--inaia-field-bg, #f6f8ff);
  color: #3f3a52;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.inaia-sheet__back:hover {
  background: #eef1fb;
}

.inaia-sheet__back svg {
  color: #9978d0;
}

/* Карточка события */
.inaia-sheet__row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.inaia-sheet__coverlink {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}

.inaia-sheet__avatarlink {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
}

.inaia-sheet__org-avatar {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgb(120 146 208 / 22%);
  background: #f6f8ff;
  box-shadow: 0 2px 8px rgba(138, 183, 213, 0.12);
}

.inaia-sheet__org-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inaia-sheet__org-avatar--sm {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.inaia-org-tag-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
}

.inaia-org-tag-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
  color: #7f5fbf;
  background: rgba(153, 120, 208, 0.12);
  border: 1px solid rgba(153, 120, 208, 0.18);
}

.inaia-org-tag-pill > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inaia-sheet__cover {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  background-color: #eef1f6;
  background-size: cover;
  background-position: center;
}

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

.inaia-sheet__cover--empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--inaia-sheet-cover-icon, none) center / 44% no-repeat;
  opacity: 0.9;
}

.inaia-sheet__tile {
  position: absolute;
  z-index: 1;
  left: 6px;
  top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 32px;
  padding: 3px 6px 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--inaia-field-text, #2a3142);
  box-shadow: 0 2px 8px rgba(30, 20, 60, 0.22);
  line-height: 1;
}

.inaia-sheet__tile b {
  font-size: 15px;
  font-weight: 700;
}

.inaia-sheet__tile i {
  margin-top: 2px;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--inaia-field-hint, #8b95ad);
}

.inaia-sheet__tile--today {
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%);
  color: #fff;
}

.inaia-sheet__tile--today i {
  color: rgba(255, 255, 255, 0.85);
}

.inaia-sheet__tile--soon {
  background: #f3edff;
  color: #7f5fbf;
}

.inaia-sheet__tile--soon i {
  color: #9978d0;
}

.inaia-sheet__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.inaia-sheet__cat {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 10px 2px 2px;
  border-radius: 999px;
  background: rgba(153, 120, 208, 0.12);
  color: #7f5fbf;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.inaia-sheet__cat > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inaia-sheet__cat-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8ab7d5 0%, #9978d0 100%) center / cover no-repeat;
  background-size: 12px 12px;
}

.inaia-sheet__cat-icon[style] {
  background-color: #9978d0;
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.inaia-sheet__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #1f2430 !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
}

.inaia-sheet__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--inaia-field-placeholder, #6e7a96);
  font-size: 12px;
  line-height: 1.35;
}

.inaia-sheet__meta svg {
  flex-shrink: 0;
  color: #9978d0;
}

.inaia-sheet__meta span {
  min-width: 0;
}

.inaia-sheet__meta--address span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inaia-sheet__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.inaia-sheet__price {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  border: 2px solid var(--inaia-field-border, rgb(232, 237, 255));
  border-radius: 999px;
  background: var(--inaia-field-bg, #f6f8ff);
  color: #3f3a52;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-sizing: border-box;
}

.inaia-sheet__actions .inaia-sheet__iconbtn {
  width: 44px;
  height: 44px;
}

.inaia-sheet__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8ab7d5, #9978d0);
  box-shadow: 0 0 16px rgba(153, 120, 208, 0.35);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.inaia-sheet__cta:active {
  transform: scale(0.98);
}

/* Список событий в одной точке */
.inaia-sheet__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 0 8px;
}

.inaia-sheet__head-title {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 6px;
}

.inaia-sheet__head-title b {
  color: #1f2430;
  font-size: 16px;
  font-weight: 700;
}

.inaia-sheet__head-title span {
  color: var(--inaia-field-hint, #8b95ad);
  font-size: 12px;
}

.inaia-sheet__list {
  max-height: min(300px, 44vh);
  margin: 0 -4px;
  padding: 0 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #dfe4f2 transparent;
}

.inaia-sheet__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.inaia-sheet__item + .inaia-sheet__item {
  box-shadow: 0 -1px 0 var(--inaia-field-border, rgb(232, 237, 255));
}

.inaia-sheet__item:hover,
.inaia-sheet__item:active {
  background: var(--inaia-field-bg, #f6f8ff);
}

.inaia-sheet__cover--sm {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  flex-shrink: 0;
}

.inaia-sheet__cover--sm .inaia-sheet__tile {
  left: 3px;
  top: 3px;
  min-width: 24px;
  padding: 2px 4px 1px;
  border-radius: 8px;
}

.inaia-sheet__cover--sm .inaia-sheet__tile b {
  font-size: 12px;
}

.inaia-sheet__cover--sm .inaia-sheet__tile i {
  font-size: 7px;
  margin-top: 1px;
}

.inaia-sheet__item-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.inaia-sheet__item-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #1f2430;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.inaia-sheet__item-tag {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(153, 120, 208, 0.12);
  color: #7f5fbf;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.inaia-sheet__item-meta {
  color: var(--inaia-field-placeholder, #6e7a96);
  font-size: 12px;
  line-height: 1.3;
}

.inaia-sheet__item-chev {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--inaia-post-icon, #becbdb);
}

/* Полноэкранная карта: шторка над системной панелью */
.event-feed-map-shell.is-fullscreen.is-sheet-ui .inaia-sheet {
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .event-feed-map-shell.is-sheet-ui .inaia-sheet {
    justify-content: flex-start;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inaia-badge-pin,
  .inaia-sheet__card {
    animation: none;
    transition: none;
  }
}

/* ---------- Организации ---------- */
.inaia-sheet__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inaia-sheet__cat--plain {
  padding: 3px 10px;
}

.inaia-sheet__sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--inaia-field-placeholder, #6e7a96);
  font-size: 12px;
  line-height: 1.35;
}

/* ---------- Фильтр категорий внутри карты ---------- */
.event-feed-map-shell {
  --inaia-mf-top: 15px;
  --inaia-mf-left: 59px;
}

.event-feed-map-shell.is-fullscreen {
  --inaia-mf-top: max(12px, env(safe-area-inset-top, 0px));
  --inaia-mf-left: calc(max(12px, env(safe-area-inset-left, 0px)) + 44px);
}

.inaia-mapfilter__btn {
  position: absolute;
  z-index: 7;
  top: var(--inaia-mf-top);
  left: var(--inaia-mf-left);
  height: 36px;
  padding: 0 14px 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: #7f5fbf;
  background: #fff;
  box-shadow: 0 2px 10px rgba(60, 50, 90, 0.2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.inaia-mapfilter__btn:hover {
  background: #f6f8ff;
}

.inaia-mapfilter__btn:active {
  transform: scale(0.96);
}

.inaia-mapfilter.is-open .inaia-mapfilter__btn {
  background: #f6f8ff;
}

.inaia-mapfilter__label {
  display: block;
  line-height: 1;
  /* кириллица визуально «стоит» выше геометрического центра строки */
  padding-top: 1px;
}

.inaia-mapfilter__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #72b0e0, #8a5fd0);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.inaia-mapfilter__badge[hidden] {
  display: none;
}

.inaia-mapfilter__panel {
  position: absolute;
  z-index: 7;
  top: calc(var(--inaia-mf-top) + 44px);
  left: min(15px, var(--inaia-mf-left));
  width: min(300px, calc(100% - 30px));
  max-height: calc(100% - var(--inaia-mf-top) - 44px - 44px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  box-shadow: 0 12px 32px rgba(60, 40, 110, 0.24);
  transform-origin: 40px -8px;
  animation: inaia-mf-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.inaia-mapfilter__panel[hidden] {
  display: none;
}

@keyframes inaia-mf-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}

.inaia-mapfilter__row {
  width: 100%;
  min-height: 50px;
  padding: 7px 10px 7px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--inaia-field-text, #2a3142);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.inaia-mapfilter__row:hover {
  background: rgba(243, 237, 255, 0.7);
}

.inaia-mapfilter__row.is-on {
  background: var(--inaia-field-bg, #f6f8ff);
  font-weight: 600;
}

.inaia-mapfilter__ico {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, #72b0e0, #8a5fd0);
  box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(60, 50, 90, 0.18);
}

.inaia-mapfilter__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inaia-mapfilter__count {
  flex: 0 0 auto;
  color: var(--inaia-field-hint, #8b95ad);
  font-size: 12px;
  font-weight: 600;
}

.inaia-mapfilter__check {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: transparent;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--inaia-field-border, rgb(232, 237, 255));
  transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.inaia-mapfilter__row.is-on .inaia-mapfilter__check {
  color: #fff;
  background: linear-gradient(135deg, #72b0e0, #8a5fd0);
  box-shadow: none;
}

/* Отступ карты от переключателя «Лента / Список / Карта» */
.event-feed-map-wrap,
.org-catalog-map-wrap {
  padding-top: 14px;
}
