.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.footer-inner {
  display: grid;
  gap: 20px;
  padding-block: 28px;
}

@media (max-width: 767px) {
  body:has(.js-sticky-cta) .footer-inner {
    padding-bottom: calc(var(--sticky-cta-height, 140px) + 24px + env(safe-area-inset-bottom, 0px));
  }
}

.site-footer__top,
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
  min-width: 0;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.6px;
}

.footer-logo img {
  max-height: 34px;
  width: auto;
  object-fit: contain;
}

.footer-logo__img {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.footer-logo .site-logo__text {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.footer-logo .logo-mark {
  display: none;
}

.footer-nav {
  min-width: 0;
}

.site-footer__legal,
.site-footer__responsible,
.site-footer__copyright {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.site-footer__legal p {
  margin: 0;
}

.site-footer__legal p + p {
  margin-top: 8px;
}

.site-footer__payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.site-footer__payment-item {
  flex: 0 0 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  min-width: 88px;
  height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.site-footer__payment-item img {
  display: block;
  width: auto;
  max-width: 64px;
  height: auto;
  max-height: 24px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.site-footer__payments {
  min-width: 0;
}

.site-footer__responsible {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
}

.site-footer__responsible p,
.site-footer__copyright {
  margin: 0;
}

.site-footer__age {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding-block: 36px;
    gap: 20px 28px;
  }

  .site-footer__top {
    grid-column: 1;
    grid-row: 1;
  }

  .site-footer__payments {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .site-footer__legal,
  .site-footer__bottom {
    grid-column: 1 / -1;
  }

  .site-footer__bottom {
    justify-content: space-between;
  }
}

.scroll-top {
  position: fixed;
  right: max(var(--gutter), env(safe-area-inset-right, 0px));
  bottom: calc(var(--scroll-top-offset, 0px) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--transition),
    visibility var(--transition),
    transform var(--transition),
    background-color var(--transition),
    border-color var(--transition);
}

.scroll-top::before {
  content: '';
  width: 11px;
  height: 11px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(3px) rotate(45deg);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

@media (hover: hover) {
  .scroll-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top:hover {
    transform: none;
  }
}

/* viewBox-only SVGs need a definite height inside an auto-sized flex badge. */
.site-footer__payment-item .site-footer__payment-image--svg {
  height: 24px;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__payment-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  }

  .site-footer__payment-item:hover img {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__payment-item,
  .site-footer__payment-item img {
    transition: none;
  }

  .site-footer__payment-item:hover,
  .site-footer__payment-item:hover img {
    transform: none;
  }
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}
.footer-menu a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.footer-menu a:focus-visible {
  color: var(--accent);
}
.footer-menu a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}
.footer-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .footer-menu a:hover {
    color: var(--accent);
  }
  .footer-menu a:hover::after {
    opacity: 1;
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .footer-menu a,
  .footer-menu a::after {
    transition: none;
  }
}

@media (max-width: 767px) {
  .site-footer__top {
    gap: 12px 16px;
  }
  .footer-logo {
    max-width: 110px;
    font-size: 19px;
  }
  .footer-logo img {
    width: 110px;
    max-width: 100%;
    height: auto;
    max-height: 26px;
  }
  .site-footer__payments {
    gap: 8px;
  }
  .site-footer__payment-item {
    box-sizing: border-box;
    flex-basis: 70px;
    width: 70px;
    min-width: 70px;
    height: 34px;
    padding: 6px 8px;
    border-radius: 9px;
  }
  .site-footer__payment-item img {
    max-width: 50px;
    max-height: 20px;
  }
  .site-footer__payment-item .site-footer__payment-image--svg {
    height: 20px;
  }
  .footer-menu {
    gap: 8px 14px;
  }
  .footer-menu a {
    padding: 6px 0;
    font-size: 11px;
  }
}
