/* Подвал — как шапка: логотип | меню по центру контейнера | телефон+соцсети справа */

#bb-footer.bb-footer,
#bb-page-footer.bb-footer,
#bb-footer.bb-footer *,
#bb-page-footer.bb-footer * {
  box-sizing: border-box;
}

#bb-footer.bb-footer,
#bb-page-footer.bb-footer {
  --bb-bg: #ffffff;
  --bb-navy: #1a2e40;
  --bb-gray: #445566;
  --bb-muted: #8899aa;
  --bb-line: #eeeeee;
  --bb-accent: #c87a4a;
  --bb-container: 1200px;
  --bb-gutter: 20px;
  background: var(--bb-bg);
  color: var(--bb-navy);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  width: 100%;
}

#bb-footer.bb-footer {
  border-top: 1px solid var(--bb-line);
}

#bb-footer .bb-footer__container,
#bb-page-footer .bb-footer__container {
  max-width: var(--bb-container);
  margin: 0 auto;
  padding: 32px var(--bb-gutter) 32px;
}

/* Десктоп: симметричные колонки — меню строго по центру 1200px */
#bb-footer .bb-footer__main,
#bb-page-footer .bb-footer__main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--bb-line);
}

#bb-footer .bb-footer__logo,
#bb-page-footer .bb-footer__logo {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

#bb-footer .bb-footer__logo-img,
#bb-page-footer .bb-footer__logo-img {
  display: block;
  width: auto;
  height: 40px;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

#bb-footer .bb-footer__nav,
#bb-page-footer .bb-footer__nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

#bb-footer .bb-footer__nav-link,
#bb-page-footer .bb-footer__nav-link {
  color: var(--bb-gray);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

#bb-footer .bb-footer__nav-link:hover,
#bb-page-footer .bb-footer__nav-link:hover {
  color: var(--bb-navy);
}

#bb-footer .bb-footer__contacts,
#bb-page-footer .bb-footer__contacts {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px 16px;
}

/* Старая вложенная разметка — не ломаем, если где-то осталась */
#bb-footer .bb-footer__nav-group,
#bb-page-footer .bb-footer__nav-group {
  display: none;
}

#bb-footer .bb-footer__phone,
#bb-page-footer .bb-footer__phone {
  color: var(--bb-navy);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

#bb-footer .bb-footer__phone:hover,
#bb-page-footer .bb-footer__phone:hover {
  color: var(--bb-accent);
}

#bb-footer .bb-footer__messengers,
#bb-page-footer .bb-footer__messengers {
  display: flex;
  align-items: center;
  gap: 10px;
}

#bb-footer .bb-footer__icon-btn,
#bb-page-footer .bb-footer__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

#bb-footer .bb-footer__icon-btn:hover,
#bb-page-footer .bb-footer__icon-btn:hover {
  opacity: 0.82;
}

#bb-footer .bb-footer__icon-img,
#bb-page-footer .bb-footer__icon-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

#bb-footer .bb-footer__meta,
#bb-page-footer .bb-footer__meta {
  padding-top: 24px;
}

#bb-footer .bb-footer__legal,
#bb-page-footer .bb-footer__legal {
  margin: 0 0 16px;
  color: var(--bb-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

#bb-footer .bb-footer__legal a,
#bb-page-footer .bb-footer__legal a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

#bb-footer .bb-footer__legal a:hover,
#bb-page-footer .bb-footer__legal a:hover {
  color: var(--bb-navy);
  text-decoration: underline;
}

#bb-footer .bb-footer__bottom,
#bb-page-footer .bb-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

#bb-footer .bb-footer__copy,
#bb-page-footer .bb-footer__copy {
  margin: 0;
  color: var(--bb-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

#bb-footer .bb-footer__policy,
#bb-page-footer .bb-footer__policy {
  margin: 0;
  color: var(--bb-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease;
}

#bb-footer .bb-footer__policy:hover,
#bb-page-footer .bb-footer__policy:hover {
  color: var(--bb-navy);
}

@media (max-width: 959px) {
  #bb-footer .bb-footer__main,
  #bb-page-footer .bb-footer__main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }

  #bb-footer .bb-footer__logo,
  #bb-page-footer .bb-footer__logo {
    grid-column: auto;
    justify-self: auto;
  }

  #bb-footer .bb-footer__nav,
  #bb-page-footer .bb-footer__nav {
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
  }

  #bb-footer .bb-footer__nav-link,
  #bb-page-footer .bb-footer__nav-link {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--bb-line);
    font-size: 17px;
    white-space: normal;
  }

  #bb-footer .bb-footer__contacts,
  #bb-page-footer .bb-footer__contacts {
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 0 14px;
  }
}

@media (max-width: 639px) {
  #bb-footer .bb-footer__container,
  #bb-page-footer .bb-footer__container {
    padding-top: 32px;
    padding-bottom: 28px;
  }

  #bb-footer .bb-footer__phone,
  #bb-page-footer .bb-footer__phone {
    font-size: 16px;
  }

  #bb-footer .bb-footer__bottom,
  #bb-page-footer .bb-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
