.contacts-map-placement {
  position: relative;
  z-index: 1;
}

.contacts__map-wrapper--with-card {
  position: relative;
  z-index: 2;
}

.contacts-map-placement__map {
  position: relative;
  z-index: 1;
}

.contacts-map-placement .bx-yandex-map,
.contacts-map-placement .bx-yandex-view-map {
  border-radius: inherit;
}

/* Yandex Maps 2.0 переопределяет размеры контента меток */
.contacts-map-placement .ymaps-image-with-content,
.contacts-map-placement .ymaps-image-with-content-content,
.contacts-map-placement ymaps.ymaps-image-with-content-content {
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
}

.contacts-map-shield {
  align-items: center;
  background: #fff;
  border-radius: 100px;
  box-shadow:
    0 16px 24px rgba(40, 40, 41, 0.06),
    0 2px 6px rgba(40, 40, 41, 0.04),
    0 0 1px rgba(40, 40, 41, 0.04);
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0;
  height: 58px !important;
  max-width: none;
  padding-right: 15px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  width: auto !important;
}

.contacts-map-shield.is-active,
.contacts-map-shield.is-hover,
.contacts-map-shield:hover {
  box-shadow:
    0 20px 28px rgba(40, 40, 41, 0.1),
    0 4px 10px rgba(40, 40, 41, 0.06),
    0 0 1px rgba(40, 40, 41, 0.06);
  transform: translateY(-1px);
}

.contacts-map-shield__image {
  align-items: center;
  background: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  flex: 0 0 58px !important;
  height: 58px !important;
  justify-content: center;
  max-height: 58px !important;
  max-width: 58px !important;
  min-height: 58px !important;
  min-width: 58px !important;
  overflow: hidden;
  width: 58px !important;
}

.contacts-map-shield__image img {
  display: block;
  flex-shrink: 0;
  height: 44px !important;
  left: auto !important;
  margin: 0 auto;
  max-height: 44px !important;
  max-width: 44px !important;
  object-fit: contain;
  padding: 0;
  position: static !important;
  right: auto !important;
  width: 44px !important;
}

.contacts-map-placement .bx-yandex-view-map .bx-yandex-map .contacts-map-shield__image img {
  left: auto !important;
  margin: 0 auto;
  position: static !important;
  right: auto !important;
}

.contacts-map-shield__content {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0;
}

.contacts-map-shield__title {
  color: #222228;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.contacts-map-shield.is-active .contacts-map-shield__title,
.contacts-map-shield:hover .contacts-map-shield__title {
  color: var(--theme-base-color, #e8363d);
}

.contacts-map-shield__text {
  color: #43495a;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contacts-placement-card {
  background: #fff;
  border-radius: 24px;
  box-shadow:
    0 24px 48px rgba(18, 25, 38, 0.12),
    0 8px 16px rgba(18, 25, 38, 0.06);
  box-sizing: border-box;
  height: auto;
  left: 24px;
  max-height: none;
  max-width: 488px;
  opacity: 0;
  overflow: visible;
  padding: 4px;
  pointer-events: none;
  position: absolute;
  top: 24px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  visibility: hidden;
  width: 488px;
  z-index: 1000;
}

.contacts-placement-card.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.contacts-placement-card__inner {
  display: flex;
  flex-direction: column;
  height: auto;
}

.contacts-placement-card__gallery {
  border-radius: 20px;
  flex-shrink: 0;
  height: 240px;
  overflow: hidden;
  width: 100%;
}

.contacts-placement-card__gallery img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.contacts-placement-card__gallery--empty {
  align-items: center;
  background: #f4f4f6;
  display: flex;
  justify-content: center;
}

.contacts-placement-card__gallery--empty img {
  height: 96px;
  object-fit: contain;
  width: 96px;
}

.contacts-placement-card__content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 28px;
}

.contacts-placement-card__name {
  color: #222228;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

.contacts-placement-card__info {
  display: grid;
  gap: 22px;
}

.contacts-placement-card__heading {
  color: #a1a4ad;
  font-size: 14px;
  line-height: 1.28;
  margin-bottom: 6px;
}

.contacts-placement-card__value,
.contacts-placement-card__text {
  color: #222228;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.contacts-placement-card__text {
  color: #43495a;
  font-size: 14px;
  font-weight: 400;
}

.contacts-placement-card__phone,
.contacts-placement-card__email {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contacts-placement-card__phone-item {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.contacts-placement-card__phone-caption {
  color: #a1a4ad;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.28;
  white-space: nowrap;
}

.contacts-placement-card__phone-link,
.contacts-placement-card__email-link {
  color: #222228;
  font-size: 18px;
  font-weight: 500;
  text-decoration: none;
}

.contacts-placement-card__phone-link:hover,
.contacts-placement-card__email-link:hover {
  color: var(--theme-base-color, #e8363d);
}

.contacts-placement-card__block--metro {
  display: grid;
  gap: 8px;
}

.contacts-placement-card__metro-item {
  align-items: center;
  color: #43495a;
  display: flex;
  font-size: 14px;
  gap: 8px;
}

.contacts-placement-card__metro-icon {
  align-items: center;
  background: #f4f4f6;
  border-radius: 50%;
  color: #222228;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.contacts-placement-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contacts-placement-card__button {
  flex: 1 1 calc(50% - 4px);
  min-width: 180px;
}

.contacts-map-placement .ymaps-b-balloon,
.contacts-map-placement .ymaps-image-with-content {
  background: transparent !important;
}

.contacts-map-placement .ymaps-image-with-content > ymaps {
  overflow: visible !important;
}

@media (max-width: 991px) {
  .contacts-placement-card {
    left: 16px;
    max-width: none;
    top: 16px;
    width: calc(100% - 32px);
  }

  .contacts-placement-card__content {
    gap: 20px;
    padding: 20px;
  }

  .contacts-placement-card__gallery {
    height: 180px;
  }

  .contacts-placement-card__name {
    font-size: 20px;
  }

  .contacts-map-shield {
    padding-right: 15px;
  }

  .contacts-map-shield__image {
    flex: 0 0 42px !important;
    height: 42px !important;
    max-height: 42px !important;
    max-width: 42px !important;
    min-height: 42px !important;
    min-width: 42px !important;
    width: 42px !important;
  }

  .contacts-map-shield__image img {
    height: 32px !important;
    max-height: 32px !important;
    max-width: 32px !important;
    width: 32px !important;
  }

  .contacts-map-shield__title {
    font-size: 14px;
  }

  .contacts-map-shield__text {
    font-size: 12px;
  }
}

@media (max-width: 767px) {
  .contacts-placement-card {
    border-radius: 20px;
    left: 16px;
    max-width: none;
    top: 16px;
    width: calc(100% - 32px);
  }

  .contacts-map-placement {
    position: relative;
  }
}
