.amg-footer {
  padding: 76px 0 34px;
  background: linear-gradient(180deg, #212121 0%, #2a2a2a 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.88);
}

.amg-footer__inner {
  display: grid;
  gap: 42px;
}

.amg-footer__top {
  display: grid;
  grid-template-columns: minmax(320px, 1.55fr) minmax(160px, 1fr) minmax(220px, 1.05fr) minmax(240px, 1.15fr);
  gap: 56px;
  align-items: start;
}

.amg-footer__brand {
  max-width: 340px;
}

.amg-footer__logo {
  display: inline-flex;
  margin-bottom: 26px;
}

.amg-footer__logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.amg-footer__logo .custom-logo {
  display: block;
  width: 150px !important;
  height: 48px !important;
  max-width: 150px !important;
  max-height: 48px !important;
  object-fit: contain;
}

.amg-footer__logo img {
  width: auto;
  max-height: 64px;
}

.amg-footer__logo--text {
  text-decoration: none;
}

.amg-footer__logo-text {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.amg-footer__desc {
  margin: 0;
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  line-height: 1.55;
}

.amg-footer__title {
  margin: 0 0 18px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.amg-footer__links,
.amg-footer__legal {
  list-style: none;
  margin: 0;
  padding: 0;
}

.amg-footer__links {
  display: grid;
  gap: 12px;
}

.amg-footer__links li,
.amg-footer__legal li {
  margin: 0;
}

.amg-footer__links a,
.amg-footer__legal a,
.amg-footer__meta a,
.amg-footer__credit a {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  transition: color 150ms ease, opacity 150ms ease;
}

.amg-footer__links a,
.amg-footer__meta-value,
.amg-footer__legal a {
  font-size: 14px;
  line-height: 1.5;
}

.amg-footer__links a:hover,
.amg-footer__legal a:hover,
.amg-footer__meta a:hover,
.amg-footer__credit a:hover {
  color: #fff;
}

.amg-footer__meta {
  display: grid;
  gap: 10px;
}

.amg-footer__meta-row {
  display: grid;
  gap: 3px;
}

.amg-footer__meta-label {
  color: rgba(255, 255, 255, 0.42);
  font-size: 13px;
  line-height: 1.35;
}

.amg-footer__meta-value {
  color: rgba(255, 255, 255, 0.94);
}

.amg-footer__legal-wrap {
  padding-top: 22px;
}

.amg-footer__legal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 24px;
  text-align: center;
}

.amg-footer__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.amg-footer__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.amg-footer__copy {
  color: rgba(255, 255, 255, 0.96);
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}

.amg-footer__credit {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.45;
}

.amg-footer__credit--right {
  text-align: right;
}

.amg-scroll-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid rgba(17, 24, 39, 0.15);
  border-radius: 50%;
  background: linear-gradient(180deg, #f4f4f4 0%, #ececec 100%);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
  color: #97d317;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.amg-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.amg-scroll-top:hover,
.amg-scroll-top:focus-visible {
  border-color: rgba(151, 211, 23, 0.5);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.16);
  outline: none;
}

.amg-scroll-top__icon {
  position: relative;
  display: block;
  width: 30px;
  height: 34px;
}

.amg-scroll-top__icon::before,
.amg-scroll-top__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.amg-scroll-top__icon::before {
  bottom: 0;
  width: 16px;
  height: 18px;
  border-radius: 2px 2px 0 0;
}

.amg-scroll-top__icon::after {
  top: 0;
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-bottom: 18px solid currentColor;
  background: transparent;
}

@media (max-width: 1180px) {
  .amg-footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }

  .amg-footer__brand {
    max-width: none;
  }

  .amg-footer__desc {
    max-width: 32ch;
  }

  .amg-footer__legal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .amg-footer {
    padding: 54px 0 26px;
  }

  .amg-scroll-top {
    right: 18px;
    bottom: 18px;
    width: 70px;
    height: 70px;
  }

  .amg-scroll-top__icon {
    width: 24px;
    height: 28px;
  }

  .amg-scroll-top__icon::before {
    width: 13px;
    height: 15px;
  }

  .amg-scroll-top__icon::after {
    border-left-width: 12px;
    border-right-width: 12px;
    border-bottom-width: 15px;
  }

  .amg-footer__inner {
    gap: 28px;
  }

  .amg-footer__top,
  .amg-footer__legal,
  .amg-footer__bottom {
    grid-template-columns: 1fr;
  }

  .amg-footer__logo {
    margin-bottom: 18px;
  }

  .amg-footer__logo img {
    max-height: 52px;
  }

  .amg-footer__logo .custom-logo {
    width: 150px !important;
    height: 48px !important;
    max-width: 150px !important;
    max-height: 48px !important;
  }

  .amg-footer__desc {
    max-width: 28ch;
    font-size: 14px;
  }

  .amg-footer__title {
    margin-bottom: 14px;
  }

  .amg-footer__legal {
    text-align: left;
  }

  .amg-footer__copy,
  .amg-footer__credit,
  .amg-footer__credit--right {
    text-align: left;
  }
}
