/* Выпадающее menu «Услуги» + фиксированная шапка */

/* —— Fixed header —— */
body.bb-has-fixed-header {
  padding-top: var(--bb-header-h, 96px);
}

/* Только главная: hero сам даёт отступ под fixed-шапку */
body.bb-has-fixed-header:has(#bb-hero-root.bb-hero:not(.bb-hero--header-only):not(.bb-hero--service)) {
  padding-top: 0;
}

/* Лендинги услуг: отступ в #bb-service-hero, не на body */
body.bb-has-fixed-header:has(#bb-service-hero) {
  padding-top: 0;
}

#bb-hero-root .bb-hero__header,
.bb-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100 !important;
  box-sizing: border-box;
  background: #fbf8f6;
  padding-top: 20px !important;
  padding-bottom: 20px !important;
  transition: box-shadow 0.2s ease;
  overflow: visible;
}

#bb-hero-root.bb-hero.is-menu-open,
body.bb-header-menu-open {
  overflow: visible;
}

body.is-header-scrolled #bb-hero-root .bb-hero__header,
body.is-header-scrolled .bb-header {
  box-shadow: 0 1px 0 rgba(26, 46, 64, 0.08);
}

#bb-hero-root .bb-hero__header-inner,
.bb-header__inner {
  align-items: center !important;
  min-height: 48px;
}

/* Логотип в шапке — единый размер (главная + лендинги услуг) */
#bb-hero-root .bb-hero__logo,
.bb-header__logo {
  display: inline-flex;
  align-items: center;
  height: 48px;
  line-height: 0;
}

#bb-hero-root .bb-hero__logo-img,
.bb-header__logo-img {
  display: block;
  width: auto;
  height: 48px;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

#bb-hero-root .bb-hero__nav-menu,
.bb-header__nav-menu {
  align-items: center !important;
}

#bb-hero-root .bb-hero__nav-contacts,
.bb-header__nav-contacts {
  align-items: center !important;
}

#bb-hero-root.bb-hero--header-only {
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

/* Главная: отступ до заголовка на планшете/телефоне — в inline-стилях hero-tilda.html */

/* Первый блок после hero на лендингах услуг — тот же верхний ритм, что у .section (как «О бюро» на главной) */
#bb-service-hero.bb-hero--service + .section {
  padding-top: 64px;
}

@media (max-width: 767px) {
  #bb-service-hero.bb-hero--service + .section {
    padding-top: 48px;
  }
}

@media (min-width: 1200px) {
  #bb-service-hero.bb-hero--service + .section {
    padding-top: 80px;
  }
}

/* Резерв ширины под font-weight:500 */
.bb-nav-link__text {
  display: inline-grid;
  vertical-align: middle;
}

.bb-nav-link__ghost,
.bb-nav-link__visible {
  grid-area: 1 / 1;
}

.bb-nav-link__ghost {
  font-weight: 500;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.bb-nav-link__visible {
  font-weight: 400;
  transition: color 0.2s ease, font-weight 0.15s ease;
}

.bb-hero__nav-link,
.bb-header__nav-link,
.bb-nav-services__trigger,
.bb-footer__nav-link {
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
  display: inline-flex !important;
  align-items: center !important;
}

.bb-nav-services__rich {
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
  display: block;
}

.bb-hero__nav-link::after,
.bb-header__nav-link::after,
.bb-nav-services__trigger::after,
.bb-footer__nav-link::after {
  display: none !important;
  content: none !important;
}

#bb-hero-root .bb-hero__nav-link:hover,
#bb-hero-root .bb-hero__nav-link.is-active,
.bb-header__nav-link:hover,
.bb-header__nav-link.is-active,
.bb-footer__nav-link:hover,
.bb-nav-services__trigger:hover,
.bb-nav-services__trigger.is-active,
.bb-nav-services__trigger[aria-expanded="true"],
.bb-nav-services:hover .bb-nav-services__trigger,
.bb-nav-services__rich:hover,
.bb-nav-services__rich:focus-visible,
.bb-nav-services__rich[aria-current="page"] {
  color: #1a2e40 !important;
  text-decoration: none !important;
}

#bb-hero-root .bb-hero__nav-link:hover .bb-nav-link__visible,
#bb-hero-root .bb-hero__nav-link.is-active .bb-nav-link__visible,
.bb-header__nav-link:hover .bb-nav-link__visible,
.bb-header__nav-link.is-active .bb-nav-link__visible,
.bb-footer__nav-link:hover .bb-nav-link__visible,
.bb-nav-services__trigger:hover .bb-nav-link__visible,
.bb-nav-services__trigger.is-active .bb-nav-link__visible,
.bb-nav-services__trigger[aria-expanded="true"] .bb-nav-link__visible,
.bb-nav-services:hover .bb-nav-services__trigger .bb-nav-link__visible {
  font-weight: 500;
}

.bb-nav-services {
  position: relative;
  display: inline-flex;
  align-items: center !important;
  vertical-align: middle;
}

.bb-nav-services__trigger {
  display: inline-flex;
  align-items: center !important;
  gap: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
  color: inherit;
  text-decoration: none;
  line-height: inherit;
}

.bb-nav-services__chevron {
  display: block;
  flex-shrink: 0;
  align-self: center;
  width: 7px;
  height: 7px;
  margin-top: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 0.25s ease;
  opacity: 0.7;
}

.bb-nav-services__trigger[aria-expanded="true"] .bb-nav-services__chevron,
.bb-nav-services.is-open .bb-nav-services__chevron,
.bb-nav-services:hover .bb-nav-services__chevron {
  transform: rotate(-135deg);
}

.bb-nav-services__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
  margin: 0;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e8e4df;
  border-radius: 14px;
  box-shadow: 0 20px 56px rgba(26, 46, 64, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  transition:
    opacity 0.22s ease,
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.22s;
  pointer-events: none;
}

/* Невидимый мост между триггером и меню */
.bb-nav-services__menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.bb-nav-services.is-open .bb-nav-services__menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.bb-nav-services__rich {
  padding: 12px 14px;
  border-radius: 10px;
}

.bb-nav-services__rich:hover,
.bb-nav-services__rich:focus-visible {
  background: #f9f7f4;
}

.bb-nav-services__rich[aria-current="page"] {
  background: #f3efe9;
}

.bb-nav-services__rich-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 6px;
}

.bb-nav-services__rich-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a2e40;
  line-height: 1.25;
}

.bb-nav-services__rich-price {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: #c87a4a;
  white-space: nowrap;
}

.bb-nav-services__rich-desc {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: #445566;
}

@media (min-width: 1200px) {
  #bb-hero-root .bb-hero__nav-menu .bb-hero__nav-link,
  #bb-hero-root .bb-hero__nav-menu .bb-nav-services__trigger,
  .bb-header__nav-menu .bb-header__nav-link {
    padding-top: 2px !important;
    padding-bottom: 6px !important;
  }

  #bb-hero-root .bb-hero__nav-link.is-active,
  .bb-header__nav-link.is-active,
  .bb-nav-services__trigger.is-active,
  .bb-nav-services__trigger[aria-expanded="true"],
  .bb-nav-services:hover .bb-nav-services__trigger {
    box-shadow: inset 0 -2px 0 #c87a4a !important;
  }

  /* Hover открывает меню — :hover учитывает абсолютное позиционирование дочерних элементов */
}

@media (min-width: 1200px) and (hover: hover) {
  .bb-nav-services:hover .bb-nav-services__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
  }
}

@media (max-width: 1199px) {
  #bb-hero-root .bb-hero__nav-link.is-active,
  .bb-nav-services__trigger.is-active,
  .bb-nav-services__trigger[aria-expanded="true"] {
    box-shadow: none !important;
  }

  /* Панель меню — bb-mobile-menu.css */

  .bb-nav-services {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    border-bottom: 1px solid rgba(26, 46, 64, 0.08);
  }

  .bb-nav-services__trigger {
    width: 100%;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 400 !important;
    border-bottom: none;
  }

  .bb-nav-services__trigger .bb-nav-link__visible,
  .bb-nav-services__trigger:hover .bb-nav-link__visible,
  .bb-nav-services__trigger.is-active .bb-nav-link__visible,
  .bb-nav-services__trigger[aria-expanded="true"] .bb-nav-link__visible {
    font-weight: 400 !important;
  }

  .bb-nav-services__menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    opacity: 1;
    visibility: visible;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    pointer-events: none;
    order: 2;
  }

  .bb-nav-services__menu::before {
    display: none !important;
    content: none !important;
  }

  .bb-nav-services.is-open .bb-nav-services__menu {
    max-height: 640px;
    padding: 0 0 8px !important;
    pointer-events: auto;
  }

  .bb-nav-services__rich {
    padding: 12px 0;
    border-bottom: 1px solid rgba(26, 46, 64, 0.08);
    border-radius: 0;
  }

  .bb-nav-services__rich:last-child {
    border-bottom: none;
  }

  .bb-nav-services__rich-top {
    gap: 20px;
  }

  .bb-nav-services__rich-name {
    font-size: 16px;
  }

  .bb-nav-services__rich-desc {
    font-size: 14px;
  }
}
