.contact .yandex-map,
.contact-location-map .yandex-map {
  isolation: isolate;
  background: #0b0e18;
  overflow: hidden;
}

.contact-location-map .yandex-map {
  position: relative;
}

/* Скрываем старый исходный iframe Яндекса на случай кеша шаблона */
.yandex-map > iframe {
  display: none !important;
}

/* Контейнер прямой Google Карты (Retina 2x) */
.kk-leaflet-map {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0b0e18 !important;
  z-index: 1;
  outline: none;
  font-family: "TikTok Sans", sans-serif;
}

@media (hover: none), (pointer: coarse) {
  .kk-leaflet-map {
    touch-action: pan-y !important;
  }
}

/* Фирменный тёмно-синий фильтр ТОЛЬКО для слоя схемы Google (спутник и маркер Кинокомнаты остаются в натуральных цветах) */
.kk-leaflet-map.is-scheme .leaflet-tile-pane {
  filter: invert(92%) hue-rotate(182deg) saturate(120%) brightness(95%) contrast(105%);
}

.kk-leaflet-map.is-satellite .leaflet-tile-pane {
  filter: brightness(92%) contrast(106%);
}

/* Убираем любые технические надписи внизу карты */
.kk-leaflet-map .leaflet-control-attribution {
  display: none !important;
}

/* === ГЕО-МАРКЕР «КИНОКОМНАТА» (ПРИВЯЗАН К ТОЧНЫМ КООРДИНАТАМ ДОМА МЕЛЕЖА, 1) === */
.kk-geo-marker-icon {
  background: transparent !important;
  border: 0 !important;
}

.kk-center-beacon {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
}

.kk-beacon-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #468aff;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 14px rgba(70, 138, 255, 0.95);
  transform: translate(-50%, -50%);
  z-index: 3;
}

.kk-beacon-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(70, 138, 255, 0.85);
  background: rgba(70, 138, 255, 0.22);
  transform: translate(-50%, -50%) scale(0.5);
  animation: kkBeaconPulse 2.1s ease-out infinite;
  z-index: 1;
}

@keyframes kkBeaconPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.45);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.65);
    opacity: 0;
  }
}

.kk-beacon-card {
  position: absolute;
  left: 0;
  bottom: 16px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border-radius: 13px;
  background: rgba(12, 15, 26, 0.96);
  border: 1.5px solid #468aff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 20px rgba(70, 138, 255, 0.42);
  color: #ffffff;
  font-family: "TikTok Sans", sans-serif;
  white-space: nowrap;
  z-index: 4;
}

.kk-beacon-card::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 11px;
  height: 11px;
  background: rgba(12, 15, 26, 0.96);
  border-right: 1.5px solid #468aff;
  border-bottom: 1.5px solid #468aff;
  transform: translateX(-50%) rotate(45deg);
}

.kk-beacon-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #468aff 0%, #2563eb 100%);
  box-shadow: 0 0 12px rgba(70, 138, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kk-beacon-icon img {
  width: 17px;
  height: 17px;
  display: block;
}

.kk-beacon-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}

.kk-beacon-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.kk-beacon-sub {
  font-size: 11px;
  font-weight: 500;
  color: #8ab4ff;
}

/* === ВЕРХНЯЯ ПАНЕЛЬ СЛЕВА (БЕЗ НАЛОЖЕНИЙ И ВДАЛИ ОТ КАРТОЧКИ «КОНТАКТЫ») === */
.kk-map-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  pointer-events: none;
}

@media screen and (min-width: 601px) {
  .kk-map-topbar {
    top: 18px;
    left: 20px;
  }
}

/* Кнопка «↺ К Кинокомнате» — плавно возвращает камеру к Мележа, 1 */
.kk-map-recenter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(92, 152, 255, 0.88);
  background: linear-gradient(180deg, rgba(32, 62, 138, 0.95) 0%, rgba(16, 28, 68, 0.96) 100%);
  color: #ffffff;
  font-family: "TikTok Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.kk-map-recenter-btn:hover {
  border-color: #ffffff;
  transform: translateY(-1px);
}

.yandex-map.is-moved .kk-map-recenter-btn {
  display: inline-flex;
}

/* Аккуратная подсказка колеса мыши — СТРОГО ТОЛЬКО НА КОМПЬЮТЕРЕ (на телефоне скрыта) */
.kk-wheel-hint {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .kk-wheel-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(14, 17, 28, 0.92);
    border: 1px solid rgba(149, 150, 171, 0.32);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-family: "TikTok Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  }

  .yandex-map:hover .kk-wheel-hint {
    opacity: 1;
    transform: translateY(0);
  }

  .yandex-map.is-wheel-active .kk-wheel-hint {
    border-color: rgba(70, 138, 255, 0.68);
    pointer-events: auto;
    cursor: pointer;
  }
}

.kk-wheel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #468aff;
  box-shadow: 0 0 0 3px rgba(70, 138, 255, 0.24);
  flex-shrink: 0;
}

.yandex-map.is-wheel-active .kk-wheel-dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

/* === НИЖНИЙ ЛЕВЫЙ УГОЛ: КНОПКИ «+ / −» И «СПУТНИК / СХЕМА» === */
.kk-map-controls-left {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}

@media screen and (min-width: 601px) {
  .kk-map-controls-left {
    left: 20px;
    bottom: 20px;
  }
}

.kk-zoom-box {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(14, 17, 28, 0.94);
  border: 1px solid rgba(149, 150, 171, 0.34);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.kk-zoom-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.kk-zoom-btn + .kk-zoom-btn {
  border-top: 1px solid rgba(149, 150, 171, 0.22);
}

.kk-zoom-btn:hover {
  background: rgba(70, 138, 255, 0.22);
  color: #8ab4ff;
}

.kk-zoom-btn:active {
  background: rgba(70, 138, 255, 0.35);
}

.kk-layer-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 11px;
  background: rgba(14, 17, 28, 0.94);
  border: 1px solid rgba(149, 150, 171, 0.34);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: "TikTok Sans", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.kk-layer-btn:hover {
  border-color: #468aff;
  transform: translateY(-1px);
}

.kk-layer-btn.is-active {
  border-color: #468aff;
  background: rgba(24, 44, 98, 0.95);
}

/* === 1. ВЫДЕЛЕНИЕ РОДНЫХ КНОПОК МАРШРУТА НА СТРАНИЦЕ «КОНТАКТЫ» === */
.contact-location-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-location-btns .btn-secondary {
  background: linear-gradient(180deg, rgba(34, 58, 122, 0.62) 0%, rgba(18, 28, 62, 0.92) 100%) !important;
  border: 1px solid rgba(92, 152, 255, 0.72) !important;
  box-shadow: 0 8px 24px rgba(20, 44, 102, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  padding: 12px 22px !important;
  font-weight: 600 !important;
  gap: 10px !important;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease !important;
}

.contact-location-btns .btn-secondary:hover {
  background: linear-gradient(180deg, rgba(54, 92, 188, 0.82) 0%, rgba(28, 48, 108, 0.96) 100%) !important;
  border-color: #ffffff !important;
  box-shadow: 0 10px 28px rgba(70, 138, 255, 0.38) !important;
  transform: translateY(-2px);
}

.contact-location-btns .btn-secondary img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* === 2. ЕДИНЫЙ БЛОК КНОПОК МАРШРУТА В КАРТОЧКЕ «КОНТАКТЫ» НА ВСЕХ СТРАНИЦАХ === */
.kk-contact-card-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kk-contact-card-actions > .btn {
  align-self: flex-start;
}

.kk-contact-route-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kk-contact-route-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 60px;
  background: linear-gradient(180deg, rgba(34, 58, 122, 0.58) 0%, rgba(18, 28, 62, 0.9) 100%);
  border: 1px solid rgba(92, 152, 255, 0.68);
  box-shadow: 0 6px 18px rgba(10, 20, 48, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: "TikTok Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.kk-contact-route-link:hover {
  background: linear-gradient(180deg, rgba(54, 92, 188, 0.8) 0%, rgba(28, 48, 108, 0.95) 100%);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.kk-contact-route-link img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

@media screen and (max-width: 820px) and (min-width: 601px) {
  .kk-contact-route-row {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 390px) {
  .kk-contact-route-row {
    grid-template-columns: 1fr;
  }
}
