/* ===== Протокол24 — global footer unstick fix v2.0.5 ===== */

/*
  Footer должен быть обычным блоком после контента, а не sticky/fixed
  и не прижиматься к низу viewport через flex min-height:100vh.
*/

/* Общий footer сайта */
footer,
.p24-footer,
.p24-site-footer,
.p24-legal-footer-v13,
.p24-auth-v201-footer,
.p24-auth-footer-v200 {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  transform: none !important;
  margin-top: 0 !important;
}

/* Убираем искусственное прижатие footer к низу на auth/legal страницах */
body.p24-auth-v201-body .p24-auth-v201-page,
body.p24-auth-designed-v200 .p24-auth-shell-v200 {
  min-height: 0 !important;
  height: auto !important;
  display: block !important;
}

body.p24-auth-v201-body .p24-auth-v201-main,
body.p24-auth-designed-v200 .p24-auth-main-v200 {
  flex: none !important;
  min-height: 0 !important;
}

body.p24-auth-v201-body .p24-auth-v201-footer,
body.p24-auth-designed-v200 .p24-auth-footer-v200 {
  flex: none !important;
}

/* Если какой-то wrapper сайта растягивает страницу как flex-column, не даём footer прилипать */
body[class*="p24"] .p24-page,
body[class*="p24"] .p24-wrapper,
body[class*="p24"] .p24-layout,
body[class*="p24"] .p24-site {
  min-height: 0 !important;
}

/* Нормальный зазор между последним контентом и footer, чтобы он не выглядел как приклеенный к экрану */
main + footer,
section + footer,
.p24-auth-v201-main + .p24-auth-v201-footer,
.p24-legal-page-v13 + .p24-legal-footer-v13 {
  margin-top: 0 !important;
}

/* Footer не должен перекрывать контент */
body {
  padding-bottom: 0 !important;
}

/* На юридических и auth-страницах footer должен начинаться после блока страницы */
body.p24-legal-v13-body .p24-legal-footer-v13,
body.p24-auth-v201-body .p24-auth-v201-footer {
  clear: both !important;
  width: 100% !important;
}

/* Мобильная версия: без fixed и без viewport-привязки */
@media (max-width: 767px) {
  footer,
  .p24-footer,
  .p24-site-footer,
  .p24-legal-footer-v13,
  .p24-auth-v201-footer,
  .p24-auth-footer-v200 {
    position: static !important;
    margin-top: 0 !important;
  }

  body.p24-auth-v201-body .p24-auth-v201-page,
  body.p24-auth-designed-v200 .p24-auth-shell-v200 {
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
  }
}