footer {
  background-color: var(--black);
  color: white;
  width: 100%;
}

/* On PL desktop enforce a clear 4-column footer layout:
   logo | services | company/legal | contacts */
@media (min-width: 1100px) {
  html[lang^="pl"] footer .footer-container {
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(180px, 1fr) minmax(220px, 1fr) minmax(220px, 280px);
    align-items: start;
    column-gap: 2.5rem;
  }

  html[lang^="pl"] footer .footer-container > .credits {
    grid-column: 1;
  }

  html[lang^="pl"] footer .footer-container > nav {
    display: contents;
  }

  html[lang^="pl"] footer .footer-container > nav > ul.menu:first-of-type {
    grid-column: 2;
  }

  html[lang^="pl"] footer .footer-container > nav > ul.menu:last-of-type {
    grid-column: 3;
  }

  html[lang^="pl"] footer .footer-container > .social {
    grid-column: 4;
    justify-self: start;
  }
}

.footer-container {
  display: flex;
  justify-content: space-between;
  max-width: 1296px;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-block: 80px;
  gap: 2rem;

  & hr {
    height: 1px;
    margin: 0;
    display: none;
    width: 100%;
    color: #333333;
    background-color: #333333;
    border: none;
  }

  & > .credits-content {
    display: none;
  }

  @media (max-width: 950px) {
    flex-direction: column;
    gap: 3rem;

    & > .credits-content {
      display: block;
    }

    & hr {
      display: block;
    }
  }

  & .credits {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    @media (max-width: 950px) {
      & .credits-content {
        display: none;
      }
    }
  }

  & .policy {
    font-weight: 500;
    line-height: 24px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    & a {
      color: #999999;
      transition: 0.2s;
    }

    & a:hover {
      text-decoration: none;
      color: white;
    }
  }

  & .copyright {
    margin-block: 3rem 0;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #999999;
  }

  & .momentum {
    width: 270px;
    height: 80px;
    object-fit: contain;

    @media(max-width: 950px) {
      width: 200px;
      height: 60px;
    }
  }

  nav {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;

    @media (max-width: 400px) {
      gap: 2rem;
    }
    
  }

  & nav ul.menu {
    display: block;
    list-style: none;
    padding: 0;
    margin: 0;
    & li {
      margin-bottom: 1.5rem;
    }
    & li:nth-of-type(6) {
      margin-bottom: 0;
    }

    & a {
      transition: 0.2s;
    }

    & a:hover {
      color: #999999;
    }

    & li.legal-policy-item {
      margin-bottom: 1rem;
    }

    & li.legal-policy-item a {
      display: inline-block;
      max-width: 260px;
      line-height: 1.35;
      overflow-wrap: anywhere;
      word-break: normal;
    }
  }

  /* Загальний контейнер */
  & .social {
    background-color: var(--black); /* чорний фон */
    color: #fff; /* білий текст */
    display: flex; /* розміщення у ряд або колонку */
    flex-direction: column; /* спочатку у стовпець (для мобільних) */
    gap: 1.5rem; /* відстань між блоками */

    /* Для ширших екранів розкидаємо в ряд */
    @media (min-width: 768px) {
      & .social {
        flex-direction: row;
        justify-content: space-between; /* або center, якщо потрібно */
        align-items: flex-start;
      }
    }

    /* Кожна колонка (Email, Phone, Socials) */
    & .social-container {
      display: flex;
      flex-direction: column;
      gap: 0.5rem; /* відступ між заголовком і посиланнями */

      /* Заголовок (Email, Phone, Socials) */
      & h4 {
        margin-block: 0;
        font-weight: 600;
        font-size: 14px;
        line-height: 20px;
        color: #999999;
      }

      /* Посилання (email, телефон) */
      & > a {
        font-weight: 500;
        line-height: 24px;
        color: white;
        transition: color 0.2s ease;
      }

      /* Ховер по посиланнях */
      & > a:hover {
        text-decoration: none;
        color: #999999; /* або інший відтінок */
      }

      /* Блок із соцмережами (іконками) */
      & .social-icons {
        display: flex;
        gap: 1.5rem;

        & a {
          position: relative;
          align-items: center;
          justify-content: center;
          text-decoration: none;
          color: #fff;
          width: 2rem;
          height: 2rem;
        }

        & img {
          opacity: 1;
          transition: all 0.2s ease;
        }

        & img.active {
          position: absolute;
          opacity: 0;
          left: 0;
        }

        & a:hover {
          & img {
            opacity: 0;
          }

          & img.active {
            opacity: 1;
          }
        }
      }
    }

    & .contact-btn {
      margin-top: 1.5rem;
    }
  }
}
