/* Подвал. Figma: Блок 15. Текст-Подвал 611:3803 (1920×558, top 4936),
   Phooter/mb 611:4588 (390×1807, top 6473).
   Все колонки и ссылки переведены в flex/grid поток с min-height. */

.footer {
  position: relative;
  min-height: 558px;
  background: var(--footer-bg);
  color: var(--white);
  overflow: hidden;
}

.footer__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Сетка колонок подвала: 6 колонок с точными координатами начала колонок из замера */
.footer__cols {
  display: grid;
  padding-left: 96px;
  padding-top: 94px;
  grid-template-columns: 503px 227px 227px 263px 339px auto;
  align-items: start;
}

/* Логотип 611:3850: 135×40.342, верхний отступ 7px от ряда колонок (top 101) */
.footer__logo {
  grid-column: 1;
  grid-row: 1;
  margin-top: 7px;
  width: 135px;
  height: 40.342px;
  background: var(--white);
  -webkit-mask-image: url("../assets/img/logo-mask.webp");
  mask-image: url("../assets/img/logo-mask.webp");
  -webkit-mask-size: 135px 40.342px;
  mask-size: 135px 40.342px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.footer__col {
  display: flex;
  flex-direction: column;
}

/* «Топ позиции» есть ТОЛЬКО в подвале главной pc (611:3803, x 599).
   На остальных страницах выключена, каталог остаётся в своей колонке 3 */
.footer__col--top { display: none; }
.footer--home .footer__col--top { display: flex; grid-column: 2; grid-row: 1 / span 2; }
.footer__col--catalog { grid-column: 3; grid-row: 1 / span 2; }
.footer__col--info { grid-column: 4; grid-row: 1 / span 2; }
.footer__col--certs { grid-column: 5; grid-row: 1 / span 2; }
.footer__col--help {
  grid-column: 6;
  grid-row: 1 / span 2;
  gap: 25.33px;
}

/* Колонка контактов во 2-й строке под логотипом, отступ 38.66px (top 180) */
.footer__col--contacts {
  grid-column: 1;
  grid-row: 2;
  margin-top: 38.658px;
}

/* Заголовок колонки: Rubik Regular 12px, tracking 1.2px */
.footer__label {
  margin: 0;
  font-size: 12px;
  line-height: normal;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

/* Пары «подпись / значение» в контактах и помощи */
.footer__pair {
  display: flex;
  flex-direction: column;
  gap: 14.67px;
}

.footer__col--contacts .footer__pair + .footer__pair {
  margin-top: 24px;
}

/* Телефон и почта в колонке контактов */
.footer__phone {
  margin: 0;
  font-weight: 500;
  font-size: 20px;
  line-height: normal;
  letter-spacing: 1px;
  white-space: nowrap;
}

.footer__mail {
  margin: 0;
  font-weight: 500;
  font-size: 20px;
  line-height: normal;
  white-space: nowrap;
}

/* Телефоны помощи */
.footer__help-phone {
  margin: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* Ряд соцсетей: flex с gap 29px, корректно при 1, 2 и 3 иконках */
.footer__socials {
  display: flex;
  align-items: flex-start;
  gap: 29px;
  margin-top: 39px;
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

/* Бейдж в потоке ряда соцсетей */
.footer__badge {
  width: 73.064px;
  height: 28.999px;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Вертикальный список ссылок внутри колонок с gap 28.33px */
.footer__links {
  display: flex;
  flex-direction: column;
  gap: 28.33px;
  margin-top: 38.67px;
}

.footer__col--catalog .footer__links {
  gap: 31px;
}

/* Пункт колонки: Rubik Medium 16px */
.footer__link {
  margin: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: normal;
  white-space: nowrap;
}

/* Сертификаты — единственная колонка с длинными подписями: «Сертификат
   соответствия № 54595959» в одну строку не влезает в 254px и обрезается.
   nowrap остальных колонок оставлен: там короткие названия из макета. */
.footer__col--certs .footer__link {
  white-space: normal;
}

/* Компенсация круглых координат из Figma для 5-го пункта */
.footer__links .footer__link--5 {
  margin-top: -2.9px;
}

.footer__links .footer__link--6 {
  margin-top: -1.9px;
}

/* Ссылочные пункты подвала */
a.footer__link,
a.footer__phone,
a.footer__mail,
a.footer__help-phone,
a.footer__social {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a.footer__link:hover,
a.footer__phone:hover,
a.footer__mail:hover,
a.footer__help-phone:hover {
  text-decoration: underline;
}

a.footer__link:active,
a.footer__phone:active,
a.footer__mail:active,
a.footer__help-phone:active,
a.footer__social:active {
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  a.footer__link,
  a.footer__phone,
  a.footer__mail,
  a.footer__help-phone,
  a.footer__social {
    transition: none;
  }
}

/* Нижняя плашка в потоке после колонок: отступ 85px, min-height 95px */
.footer__strip {
  margin-top: 85px;
  width: 100%;
  min-height: 95px;
  background: var(--footer-strip);
  display: flex;
  align-items: flex-start;
  padding: 38px 96px 0 96px;
  box-sizing: border-box;
}

/* Юридическая строка: Rubik Medium 14px/23, uppercase */
.footer__legal {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
  line-height: 23px;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer__legal--ogrn { margin-left: 43.33px; }
.footer__legal--kpp { margin-left: 45.12px; }
.footer__legal--company { margin-left: 44.93px; }
.footer__legal--copy { margin-left: auto; }

.footer__legal br {
  display: none;
}

@media (max-width: 1199px) {
  .footer {
    min-height: 1807px;
    height: auto;
  }

  /* В mb весь подвал выстроен в одну колонку на left 91 */
  .footer__cols {
    display: flex;
    flex-direction: column;
    padding-left: 91px;
    padding-top: 70px;
    align-items: flex-start;
  }

  .footer__logo {
    margin-top: 0;
    margin-left: 0;
  }

  .footer--home .footer__col--top {
    display: none;
  }

  .footer__col--contacts {
    margin-top: 38.66px;
  }

  .footer__col--catalog {
    margin-top: 67px;
  }

  .footer__col--info {
    margin-top: 72px;
  }

  .footer__col--certs {
    margin-top: 72px;
  }

  .footer__col--help {
    margin-top: 72px;
    gap: 25px;
  }

  .footer__pair {
    gap: 14px;
  }

  .footer__links {
    gap: 28px;
    margin-top: 38px;
  }

  .footer__col--catalog .footer__links {
    gap: 31px;
  }

  .footer__links .footer__link--5 {
    margin-top: 0;
  }

  .footer__links .footer__link--6 {
    margin-top: -2px;
  }

  /* Плашка 611:4626: в потоке после блоков, отступ 50px */
  .footer__strip {
    margin-top: 50px;
    min-height: 393px;
    height: auto;
    padding: 50px 0 0 91px;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  /* Плашка отступает слева на 91, поэтому самая длинная строка (копирайт, 305)
     не влезала в 390 и вылезала за экран на 6px. Запрет переноса снимаем: строки
     юридического блока в mb стоят столбиком, и перенос никого не сдвигает. */
  .footer__legal {
    margin-left: 0;
    padding-right: 14px;
    white-space: normal;
  }

  .footer__legal br {
    display: inline;
  }
}
