 /*
 * Адаптивное меню футера.
 * Используется для тем 1, 2, 3 и 5.
 */

/* Тема 1 */

.site-footer.theme1 .footerInfo {
  min-width: 0;
  max-width: 100%;
}

.site-footer.theme1 .footerNav {
  flex: 1 1 520px;
  width: min(707px, 100%);
  min-width: 0;
  max-width: 100%;
  height: auto;
}

/* Тема 2 */

footer.site-footer.theme2 .footerNav {
  flex: 1 1 420px;
  width: min(536px, 100%);
  min-width: 0;
  max-width: 100%;
  height: auto;
}

/* Тема 3 */

.site-footer.theme3 .footerNav {
  width: min(501px, calc(100% - 32px));
  min-width: 0;
  max-width: calc(100% - 32px);
  height: auto;
}

/* Тема 5 */

footer.site-footer.theme5 .footerNav {
  width: min(779px, calc(100% - 32px));
  min-width: 0;
  max-width: calc(100% - 32px);
  height: auto;
}

/* Общая раскладка пунктов */

.site-footer.theme1 .footerNav ul,
footer.site-footer.theme2 .footerNav ul,
.site-footer.theme3 .footerNav ul,
footer.site-footer.theme5 .footerNav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  row-gap: 12px;
  list-style: none;
}

.site-footer.theme1 .footerNav ul {
  column-gap: clamp(16px, 4vw, 80px);
}

footer.site-footer.theme2 .footerNav ul,
.site-footer.theme3 .footerNav ul {
  column-gap: clamp(12px, 1.6vw, 23px);
}

footer.site-footer.theme5 .footerNav ul {
  column-gap: clamp(16px, 5vw, 104px);
}

.site-footer.theme1 .footerNav li,
footer.site-footer.theme2 .footerNav li,
.site-footer.theme3 .footerNav li,
footer.site-footer.theme5 .footerNav li {
  flex: 0 1 auto;
  min-width: 0;
  height: auto;
}

.site-footer.theme1 .footerNav a,
footer.site-footer.theme2 .footerNav a,
.site-footer.theme3 .footerNav a,
footer.site-footer.theme5 .footerNav a {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

/* Мобильная тема 1 */

@media (max-width: 768px) {
  .site-footer.theme1 .footerNav {
    flex: 0 1 auto;
    width: min(320px, calc(100% - 32px));
    min-width: 0;
    max-width: calc(100% - 32px);
    height: auto;
  }

  .site-footer.theme1 .footerNav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    height: auto;
  }

  .site-footer.theme1 .footerNav li,
  .site-footer.theme1 .footerNav a {
    width: 100%;
    height: auto;
  }
}

/* Мобильная тема 2 */

@media (max-width: 767px) {
  footer.site-footer.theme2 .footerNav {
    flex: 0 1 auto;
    width: min(320px, calc(100% - 32px));
    min-width: 0;
    max-width: calc(100% - 32px);
    height: auto;
  }

  footer.site-footer.theme2 .footerNav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    height: auto;
  }

  footer.site-footer.theme2 .footerNav li,
  footer.site-footer.theme2 .footerNav a {
    width: 100%;
    height: auto;
  }
}

/* Мобильная тема 3 */

@media (max-width: 900px) {
  .site-footer.theme3 .footerNav {
    width: min(320px, calc(100% - 32px));
    min-width: 0;
    max-width: calc(100% - 32px);
    height: auto;
  }

  .site-footer.theme3 .footerNav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    height: auto;
  }

  .site-footer.theme3 .footerNav li,
  .site-footer.theme3 .footerNav a {
    width: 100%;
    height: auto;
  }
}

/* Мобильная тема 5 */

@media (max-width: 768px) {
  footer.site-footer.theme5 .footerNav {
    width: min(320px, calc(100% - 32px));
    min-width: 0;
    max-width: calc(100% - 32px);
    height: auto;
  }

  footer.site-footer.theme5 .footerNav ul {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    height: auto;
  }

  footer.site-footer.theme5 .footerNav li,
  footer.site-footer.theme5 .footerNav a {
    width: 100%;
    height: auto;
  }
}

/* =========================================================
   Автоматическая высота футеров
   ========================================================= */

/* Тема 1 */

.site-footer.theme1 {
  height: auto;
  min-height: 390.84px;
}

.site-footer.theme1 > .container {
  height: auto;
  min-height: 390.84px;
}

@media (max-width: 1199px) and (min-width: 769px) {
  .site-footer.theme1 {
    height: auto;
    min-height: 420px;
  }

  .site-footer.theme1 > .container {
    height: auto;
    min-height: 420px;
  }
}

@media (max-width: 768px) {
  .site-footer.theme1 {
    height: auto;
    min-height: 448.11px;
  }

  .site-footer.theme1 > .container {
    height: auto;
    min-height: 448.11px;
  }
}

/* Тема 2 */

footer.site-footer.theme2 {
  height: auto;
  min-height: 390.84px;
}

footer.site-footer.theme2 > .container {
  height: auto;
  min-height: 390.84px;
}

@media (max-width: 1023px) and (min-width: 768px) {
  footer.site-footer.theme2 {
    height: auto;
    min-height: 420px;
  }

  footer.site-footer.theme2 > .container {
    height: auto;
    min-height: 420px;
  }
}

@media (max-width: 767px) {
  footer.site-footer.theme2 {
    height: auto;
    min-height: 464px;
  }

  footer.site-footer.theme2 > .container {
    height: auto;
    min-height: 464px;
    padding-bottom: 40px;
  }
}

/* =========================================================
   Тема 3
   На мобильных убираем absolute, чтобы меню увеличивало футер
   ========================================================= */

.site-footer.theme3 {
  height: auto;
  min-height: 395.81px;
}

.site-footer.theme3 > .container {
  min-height: 395.81px;
}

@media (max-width: 900px) {
  .site-footer.theme3 {
    box-sizing: border-box;
    height: auto;
    min-height: 448px;
    padding: 128.76px 16px 26px;
    overflow: hidden;
  }

  .site-footer.theme3 > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  .site-footer.theme3 .logo {
    position: static;
    flex: 0 0 auto;
    margin: 0;
    transform: none;
  }

  .site-footer.theme3 .footerInfo {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
  }

  .site-footer.theme3 .button.buttonRed {
    position: static;
    flex: 0 0 auto;
    margin: 0;
    transform: none;
  }

  .site-footer.theme3 .footerNav {
    position: static;
    flex: 0 0 auto;
    height: auto;
    margin: 0;
    transform: none;
  }
}

/* =========================================================
   Тема 5
   На мобильных также переводим содержимое в обычный поток
   ========================================================= */

footer.site-footer.theme5 {
  height: auto;
  min-height: 424.39px;
}

@media (max-width: 768px) {
  footer.site-footer.theme5 {
    box-sizing: border-box;
    height: auto;
    min-height: 590px;
    padding: 50px 16px 40px;
    overflow: hidden;
  }

  footer.site-footer.theme5 > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 736px;
    height: auto;
    min-height: 352.65px;
    margin: 0 auto;
    padding: 114.86px 16px 70px;
    overflow: visible;
  }

  footer.site-footer.theme5 .logo {
    position: static;
    flex: 0 0 auto;
    margin: 0;
    transform: none;
  }

  footer.site-footer.theme5 .footerInfo {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(30px, 7vw, 52px);
    width: 100%;
    max-width: none;
    height: auto;
    margin: clamp(35px, 7vw, 55px) 0 0;
    padding: 0;
    pointer-events: auto;
  }

  footer.site-footer.theme5 .button.buttonRed {
    position: static;
    flex: 0 0 auto;
    margin: 0;
    transform: none;
  }

  footer.site-footer.theme5 .footerNav {
    position: static;
    flex: 0 0 auto;
    height: auto;
    margin: 0;
    transform: none;
  }
}

/* =========================================================
   Исправление меню футера — тема 1
   ========================================================= */

.site-footer.theme1 .footerNav a {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* Полноценный десктоп */

@media (min-width: 1400px) {
  .site-footer.theme1 > .container {
    gap: clamp(40px, 5.94vw, 114px);
  }

  .site-footer.theme1 .footerInfo {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    gap: clamp(32px, 4vw, 80px);
  }

  .site-footer.theme1 .footerNav {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
  }

  .site-footer.theme1 .footerNav ul {
    flex-wrap: nowrap;
    justify-content: space-between;
    column-gap: clamp(16px, 2vw, 38px);
    row-gap: 0;
    height: auto;
  }

  .site-footer.theme1 .footerNav a {
    font-size: 18px;
    line-height: 23px;
  }
}

/* Планшеты и небольшие ноутбуки */

@media (min-width: 769px) and (max-width: 1399px) {
  .site-footer.theme1 {
    height: auto;
    min-height: 420px;
  }

  .site-footer.theme1 > .container {
    flex-direction: column;
    gap: 30px;
    width: calc(100% - 48px);
    height: auto;
    min-height: 420px;
    padding: 40px 0;
  }

  .site-footer.theme1 .logo {
    flex: 0 0 100px;
    width: 245px;
    min-width: 245px;
    max-width: 245px;
    height: 100px;
  }

  .site-footer.theme1 .footerInfo {
    flex-direction: column;
    gap: 30px;
    width: 100%;
    min-width: 0;
  }

  .site-footer.theme1 .footerNav {
    flex: 0 1 auto;
    width: min(783px, 100%);
    min-width: 0;
    max-width: 100%;
    height: auto;
  }

  .site-footer.theme1 .footerNav ul {
    flex-wrap: wrap;
    justify-content: center;
    column-gap: clamp(24px, 5vw, 55px);
    row-gap: 12px;
    height: auto;
  }

  .site-footer.theme1 .footerNav a {
    font-size: 17px;
    line-height: 21px;
  }
}

/* Мобильные */

@media (max-width: 768px) {
  .site-footer.theme1 .footerNav a {
    font-size: 16px;
    line-height: 20px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }
}