.footer {
  flex-shrink: 0;
  background: var(--bg-white);
}

.footer__top-wrap {
  display: flex;
  justify-content: center;
  padding: 0;
  margin-bottom: -22px; /* виходить за межу футера вгору */
  position: relative;
  z-index: 2;
}

.footer__scroll-top {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: var(--yellow);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition:
    background var(--transition),
    transform var(--transition);
}
.footer__scroll-top:hover {
  background: #e6b800;
}
.footer__scroll-top svg {
  display: block;
}

.footer__main {
  background: var(--bg-white);
  padding: 10px 0;
}

.footer__main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 66px;
}

.footer__logo {
  display: flex;
  flex-shrink: 0;
}
.footer__logo-img {
  height: 52px;
  width: auto;
}

.footer__nav {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
  justify-content: center;
}

.footer__nav-link {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  transition: color var(--transition);
}
.footer__nav-link:hover {
  color: var(--yellow);
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.footer__social-icon--active {
  display: none;
}
.footer__social:hover .footer__social-icon--normal {
  display: none;
}
.footer__social:hover .footer__social-icon--active {
  display: block;
}

.footer__cats {
  background: var(--bg-light);
  padding: 20px 0;
}

.footer__cats-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 104px;
}

.footer__cat {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  text-align: left;
  transition: color var(--transition);
  white-space: nowrap;
}
.footer__cat:hover {
  color: var(--yellow);
}

.footer__legal {
  background: var(--bg-white);
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.footer__legal .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}

.footer__legal-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  transition: color var(--transition);
}
.footer__legal-link:hover {
  color: var(--dark);
}

@media (max-width: 1024px) {
  .footer__main-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  .footer__nav {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer__cats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer__cats-grid {
    grid-template-columns: 1fr;
  }
  .footer__legal .container {
    flex-direction: column;
    gap: 12px;
  }
}

/* wp_nav_menu selectors — WP generates <ul class="menu"><li class="menu-item"><a>...</a></li></ul> */
.footer__nav .menu {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer__nav .menu > li > a {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--transition);
}
.footer__nav .menu > li > a:hover {
  color: var(--yellow);
}

.footer__cats-grid .menu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 104px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.footer__cats-grid .menu > li > a {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
  text-align: left;
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}
.footer__cats-grid .menu > li > a:hover {
  color: var(--yellow);
}

.footer__legal .menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.footer__legal .menu > li > a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  transition: color var(--transition);
}
.footer__legal .menu > li > a:hover {
  color: var(--dark);
}

@media (max-width: 1024px) {
  .footer__nav .menu {
    gap: 20px;
  }
  .footer__cats-grid .menu {
    gap: 24px;
  }
}
@media (max-width: 768px) {
  .footer__cats-grid .menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer__legal .menu {
    flex-direction: column;
    gap: 12px;
  }
}

.footer__top-wrap {
  margin-bottom: -16px;
  align-items: center;
  background: var(--bg-white);
}

.footer__top-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100% - 160px, 1200px);
  height: 1px;
  background: var(--border);
  transform: translate(-50%, -50%);
  z-index: 0;
}

.footer__scroll-top {
  position: relative;
  z-index: 1;
  transform: translateY(-6px);
}

.footer__scroll-top:hover {
  transform: translateY(-8px);
}

.footer__scroll-top img {
  display: block;
  width: 21px;
  height: 27px;
}

.footer__main-inner {
  height: auto;
}

.footer__logo-img {
  width: 120px;
  height: 45px;
  object-fit: contain;
}

.footer__nav .menu {
  gap: 48px;
}

.footer__nav-link,
.footer__nav .menu > li > a,
.footer__cat,
.footer__cats-grid .menu > li > a {
  font-size: 16px;
}

.footer__socials {
  gap: 28px;
}

.footer__cats {
  padding: 20px 120px;
}

.footer__cats-grid .menu {
  gap: 20px;
}

.footer__cat,
.footer__cats-grid .menu > li > a {
  font-weight: 700;
}

.footer__legal {
  padding: 7px 0 8px;
  border-top: 0;
}

.footer__legal-link,
.footer__legal .menu > li > a {
  font-size: 12px;
}

.footer__legal .menu {
  gap: 58px;
}

@media (min-width: 769px) and (max-width: 1280px) {
  .footer__top-wrap::before {
    width: calc(100% - 160px);
  }

  .footer__main-inner {
    gap: 20px;
  }

  .footer__nav .menu {
    gap: 36px;
  }

  .footer__cats {
    padding: 20px clamp(24px, 3vw, 40px);
  }

  .footer__cats-grid .menu {
    flex-wrap: nowrap;
    gap: clamp(12px, 1.6vw, 20px);
  }

  .footer__cats-grid .menu > li > a {
    white-space: nowrap;
  }
}

@media (min-width: 769px) and (max-width: 920px) {
  .footer__cats {
    padding: 20px 24px;
  }

  .footer__cats-grid .menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 32px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .footer__top-wrap::before {
    width: calc(100% - 96px);
  }

  .footer__main {
    padding: 18px 0 16px;
  }

  .footer__main-inner {
    height: auto;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 18px 24px;
  }

  .footer__nav {
    min-width: 0;
  }

  .footer__nav .menu {
    justify-content: center;
    gap: 18px 30px;
  }

  .footer__nav .menu > li > a {
    font-size: 16px;
    line-height: 1.35;
  }

  .footer__socials {
    gap: 24px;
  }

  .footer__cats {
    padding: 20px 24px;
  }

  .footer__cats-grid .menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px 32px;
  }

  .footer__cats-grid .menu > li > a {
    font-size: 16px;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
  }

  .footer__legal .menu {
    flex-direction: row;
    gap: 48px;
  }
}

@media (max-width: 480px) {
  .footer__top-wrap {
    display: none;
  }

  .footer__main {
    padding: 32px 0 31px;
    border-top: 0;
  }

  .footer__main-inner {
    height: auto;
    flex-direction: column;
    justify-content: flex-start;
    gap: 27px;
  }

  .footer__logo-img {
    height: 52px;
  }

  .footer__nav {
    width: 100%;
  }

  .footer__nav .menu {
    width: 100%;
    max-width: 330px;
    flex: 0 1 auto;
    justify-content: center;
    gap: 33px 35px;
  }

  .footer__nav .menu > li > a {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
  }

  .footer__socials {
    gap: 28px;
  }

  .footer__social-icon {
    width: 20px;
    height: 20px;
  }

  .footer__cats {
    padding: 23px 0 24px;
  }

  .footer__cats-grid .menu {
    align-items: center;
    gap: 20px;
  }

  .footer__cats-grid .menu > li > a {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
  }

  .footer__legal {
    padding: 28px 0 29px;
    border-top: 0;
  }

  .footer__legal .container {
    flex-direction: row;
    gap: 0;
  }

  .footer__legal .menu {
    flex-direction: row;
    justify-content: center;
    gap: 36px;
  }

  .footer__legal .menu > li > a {
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
  }
}


.footer__legal-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}
