.footer-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: -48px;
  border-radius: 56px 56px 0 0;
  overflow: hidden;
}

/* Map strip */

.footer-map {
  position: relative;
  height: 340px;
  overflow: hidden;
  background: linear-gradient(var(--color-dark-50), var(--color-dark-50)), var(--color-light-1000);
}

.footer-map__image {
  position: absolute;
  inset: 0;
}

/* Стейдж карты — весь абсолютный контент (пин, адрес) рассчитан на
   1440px-фрейм из Figma, поэтому держим его в центрированном блоке той же
   ширины, пока сама .footer-map (и фон-фото внутри неё) тянется на 100%. */
.footer-map__inner {
  position: relative;
  max-width: 1440px;
  height: 100%;
  margin-inline: auto;
}

.footer-map__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Картинка опущена вниз — показываем верхнюю полосу исходника */
  object-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 72% 100% at center, #fff 65%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 100% at center, #fff 65%, transparent 100%);
}

.footer-map__pin {
  position: absolute;
  left: 657.37px;
  top: 115.73px;
  width: 107px;
  height: 107px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.footer-map__pin img {
  width: auto;
  height: 56px;
  display: block;
  transition: transform 0.25s ease;
  filter:
    drop-shadow(0px 37px 5px rgba(21, 17, 15, 0))
    drop-shadow(0px 24px 5px rgba(21, 17, 15, 0.04))
    drop-shadow(0px 13px 4px rgba(21, 17, 15, 0.12))
    drop-shadow(0px 6px 3px rgba(21, 17, 15, 0.2))
    drop-shadow(0px 1px 1.5px rgba(21, 17, 15, 0.24));
}

/* Подъём при наведении — как у кружочков сертификатов */
.footer-map__pin:hover img {
  transform: translateY(-8px);
}

.footer-map__address {
  position: absolute;
  left: 47.74px;
  top: 255px;
  display: flex;
  align-items: center;
}

.footer-map__address-icon,
.footer-map__address-expand {
  flex-shrink: 0;
  width: 56px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-dark-800);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border-radius: 16px;
}

.footer-map__address-icon img {
  width: auto;
  height: 18px;
  display: block;
}

.footer-map__address-text {
  flex-shrink: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  margin: 0;
  background: var(--color-dark-800);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border-right: 1px solid var(--color-light-100);
  border-radius: 16px 0 0 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-light-1000);
  white-space: nowrap;
}

.footer-map__address-expand {
  border-radius: 0 16px 16px 0;
}

.footer-map__address-expand img {
  width: 31px;
  height: 31px;
  transform: rotate(90deg);
}

/* Ховер по адресной плашке: стрелка перекручивается в правый верхний
   угол и возвращается на исходную */
@keyframes footer-address-arrow-dart {
  0%, 100% { transform: rotate(90deg); }
  50% { transform: rotate(45deg); }
}

.footer-map__address:hover .footer-map__address-expand img {
  animation: footer-address-arrow-dart 0.6s ease-in-out 1;
}

/* Photo footer */

.footer:has(.footer__logo:hover) {
  overflow: visible;
}

.footer {
  position: relative;
  height: 800px;
  overflow: hidden;
  border-radius: 56px 56px 0 0;
  background: var(--color-dark-1100);
  color: var(--color-light-1000);
  /* Contain the watermark's mix-blend-mode inside the footer — without an
     isolated stacking context it blends against the whole page group and
     forces the browser to re-composite every backdrop-filter above it,
     which is what produced the square blur artifacts and dropped elements. */
  isolation: isolate;
}

/* Стейдж футера — та же логика, что у .footer-map__inner: фон-фото тянется
   на 100% (.footer__bg ниже), а весь абсолютный контент (лого, нав, соцсети,
   копирайт и т.п., px-координаты из Figma) держим в центрированном 1440px. */
.footer__inner {
  position: relative;
  max-width: 1440px;
  height: 100%;
  margin-inline: auto;
}

.footer__bg {
  position: absolute;
  inset: 0;
  /* Собственное скругление и обрезка — чтобы .footer можно было временно
     снять overflow:hidden под ховер-подъём лого, не оголяя прямые углы
     фонового фото на месте скруглённых верхних углов футера. */
  border-radius: 56px 56px 0 0;
  overflow: hidden;
}

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

.footer__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 17, 15, 0) 62.613%, rgba(21, 17, 15, 0.48) 100%),
    linear-gradient(90deg, rgba(21, 17, 15, 0.48), rgba(21, 17, 15, 0.48));
}

.footer__logo {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 164px;
  height: 164.308px;
  z-index: 1;
  overflow: hidden;
  transition: border-radius 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.footer__logo:hover {
  border-radius: 0 0 32px 32px;
  transform: translate(-50%, -16px);
}

.footer__logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.footer__social {
  position: absolute;
  left: 47.74px;
  top: 48px;
  z-index: 1;
}

.footer__email {
  position: absolute;
  left: 1161px;
  top: 48px;
  z-index: 1;
}

.footer__nav {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.footer__bubble {
  position: absolute;
  width: 232px;
  height: 232px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-light-200);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.footer__bubble-circle {
  position: relative;
  width: 177.867px;
  height: 177.867px;
  border-radius: var(--radius-full);
  background: var(--color-light-200);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--color-light-1000);
  text-align: center;
  transition: background-color 0.2s ease;
}

.footer__bubble-circle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.footer__bubble:hover {
  transform: scale(1.04);
}

.footer__bubble:hover .footer__bubble-circle {
  background: var(--color-light-400);
}

.footer__bubble--glowna {
  left: 48.74px;
  top: 164px;
}

.footer__bubble--kontakt {
  left: 1160px;
  top: 164px;
}

.footer__bubble--ofirmie {
  left: 604.37px;
  top: 245.78px;
}

.footer__bubble--realizacje {
  left: 326.55px;
  top: 400px;
}

.footer__bubble--aktualnosci {
  left: 882.18px;
  top: 400px;
}

.footer__totop {
  position: absolute;
  left: 50%;
  top: 564.21px;
  transform: translateX(-50%);
  z-index: 1;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: var(--color-dark-800);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.footer__totop:hover {
  background: var(--color-dark-500);
  transform: translateX(-50%) translateY(-2px);
}

.footer__totop img {
  width: 31px;
  height: 31px;
  display: block;
}

.footer__copyright {
  position: absolute;
  left: 50%;
  bottom: 61px;
  transform: translateX(-50%);
  z-index: 1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-light-700);
  white-space: nowrap;
}

.footer__legal {
  position: absolute;
  bottom: 61px;
  z-index: 1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-light-700);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.footer__legal:hover {
  color: var(--color-light-1000);
}

.footer__legal--privacy {
  left: 48.03px;
}

.footer__legal--terms {
  left: 1315.63px;
}

/* ============ Mobile ≤767px — Figma 288:3645 ============ */
@media (max-width: 767px) {
  .footer-wrap {
    border-radius: 40px 40px 0 0;
  }

  .footer,
  .footer__bg {
    border-radius: 40px 40px 0 0;
  }

  /* Карта */
  .footer-map {
    height: 288.84px;
  }

  /* Figma 288:3670: крупный кроп той же карты — полотно 1217.792×669.997
     со сдвигом влево на 421.52 и вверх на 20 */
  .footer-map__image {
    -webkit-mask-image: radial-gradient(ellipse 72% 100% at center, #fff 65%, transparent 100%);
    mask-image: radial-gradient(ellipse 72% 100% at center, #fff 65%, transparent 100%);
  }

  .footer-map__image img {
    inset: auto;
    width: 1217.792px;
    height: 669.997px;
    max-width: none;
    left: -421.52px;
    top: -20px;
    object-position: center;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .footer-map__pin {
    left: 133.37px;
    top: 66.73px;
  }

  .footer-map__address {
    left: 16px;
    right: 16px;
    top: 216px;
    align-items: stretch;
  }

  .footer-map__address-icon {
    height: auto;
  }

  .footer-map__address-text {
    flex: 1 0 0;
    min-width: 0;
    height: auto;
    padding: 10px 16px;
    white-space: normal;
  }

  .footer-map__address-expand {
    width: 40px;
    height: auto;
  }

  /* Фото-футер: контент в поток колонкой */
  .footer {
    height: 812px;
    border-radius: 40px 40px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 155.36px 16px 32px;
  }

  .footer__logo {
    width: 124px;
    height: 123.2px;
  }

  /* Кружки-ссылки превращаются в простые текстовые ссылки */
  .footer__nav {
    position: relative;
    inset: auto;
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .footer__bubble {
    position: static;
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
  }

  .footer__bubble:hover {
    transform: none;
  }

  .footer__bubble-circle {
    width: auto;
    height: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    overflow: visible;
    line-height: 24px;
    letter-spacing: -0.64px;
  }

  .footer__bubble-circle::after {
    display: none;
  }

  .footer__bubble:hover .footer__bubble-circle {
    background: none;
    color: var(--color-primary);
  }

  /* Соцсети и почта — пилюли на всю ширину */
  .footer__social {
    position: relative;
    left: auto;
    top: auto;
    order: 2;
    margin-top: 32px;
    width: 100%;
    display: flex;
    gap: 0;
  }

  .footer__social .hero__pill--icon {
    flex: 1 0 0;
    width: auto;
  }

  .footer__email {
    position: relative;
    left: auto;
    top: auto;
    order: 3;
    margin-top: 12px;
    width: 100%;
    display: flex;
    gap: 0;
  }

  .footer__email .hero__pill--text {
    flex: 1 0 0;
    justify-content: center;
  }

  .footer__totop {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    order: 4;
    margin-top: 56px;
  }

  .footer__totop:hover {
    transform: translateY(-2px);
  }

  .footer__legal {
    position: relative;
    left: auto;
    top: auto;
    order: 5;
    margin: 0;
  }

  .footer__legal--terms {
    margin-top: 96px;
  }

  .footer__legal--privacy {
    order: 6;
    margin-top: 24px;
  }

  .footer__copyright {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    order: 7;
    margin-top: 37px;
  }
}
