/* Константа: меню в одну строку от 1180 px, бургер на меньшей ширине. */
@media (min-width: 1180px) and (max-width: 1399.98px) {
  .konstanta-header .konstanta-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    min-height: 104px;
    padding: 14px 24px;
  }

  .konstanta-header .konstanta-logo { flex: 0 0 190px; }
  .konstanta-header .konstanta-logo img { width: 190px; height: auto; }
  .konstanta-header nav.konstanta-nav { order: 0; flex: 1 1 auto; min-width: 0; }
  .konstanta-header .konstanta-nav .navbar-nav {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
  }
  .konstanta-header .konstanta-nav .navbar-nav .nav-link {
    padding: 14px 4px;
    font-size: 14px;
    line-height: 1.35;
    white-space: nowrap;
  }

  .konstanta-header .konstanta-main > .konstanta-phones { margin-left: 0; }
  .konstanta-header .konstanta-main > .konstanta-phones a {
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: 0;
  }
  .konstanta-header .konstanta-main > .konstanta-social { gap: 10px; }
  .konstanta-header .konstanta-main > .konstanta-social a { min-width: 28px; min-height: 36px; }
  .konstanta-header .konstanta-main > .konstanta-social img { width: 28px; height: 28px; }
  .konstanta-header .konstanta-main > .konstanta-social .konstanta-access { padding-left: 12px; }
}

/* Bootstrap раскрывает navbar-expand-md с 768 px: переносим порог на 1180. */
@media (max-width: 1179.98px) {
  .konstanta-header .konstanta-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
    column-gap: 12px;
    row-gap: 0;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .konstanta-header .konstanta-logo { grid-column: 1; grid-row: 1; min-width: 0; }
  .konstanta-header nav.konstanta-nav {
    position: static;
    display: block;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    order: 0;
    flex: none;
    padding: 0;
    margin: 0;
  }
  .konstanta-header .konstanta-main > .konstanta-phones,
  .konstanta-header .konstanta-main > .konstanta-social { display: none; }

  .konstanta-header .navbar-toggler {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 0 -8px 0 0;
  }
  .konstanta-header .navbar-toggler .navbar-toggler-icon {
    position: relative;
    width: 32px;
    height: 28px;
    background: linear-gradient(#36535f, #36535f) center / 100% 2px no-repeat;
    transition: background-size 180ms ease;
  }
  .konstanta-header .navbar-toggler .navbar-toggler-icon::before,
  .konstanta-header .navbar-toggler .navbar-toggler-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #36535f;
    transform-origin: center;
    transition: transform 220ms ease;
  }
  .konstanta-header .navbar-toggler .navbar-toggler-icon::before { top: 0; }
  .konstanta-header .navbar-toggler .navbar-toggler-icon::after { bottom: 0; }
  .konstanta-header .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon { background-size: 0 2px; }
  .konstanta-header .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before { transform: translateY(13px) rotate(45deg); }
  .konstanta-header .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after { transform: translateY(-13px) rotate(-45deg); }

  .konstanta-header #navbar-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0 18px;
    background: #fff;
    box-shadow: 0 12px 18px #0001;
    z-index: 40;
    max-height: calc(100vh - 100%);
    max-height: calc(100dvh - 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .konstanta-header #navbar-content.collapse:not(.show) { display: none !important; }
  .konstanta-header #navbar-content.collapse.show { display: block !important; padding-top: 12px; padding-bottom: 18px; }
  .konstanta-header #navbar-content.collapsing { display: block !important; overflow: hidden; }
  .konstanta-header .konstanta-nav .navbar-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .konstanta-header .konstanta-nav .navbar-nav .nav-link { padding: 12px 0; font-size: 16px; white-space: nowrap; }
  .konstanta-header .konstanta-nav .dropdown-menu { position: static; float: none; max-width: 100%; border: 0; }
  .konstanta-header .konstanta-nav .dropdown-menu:not(.show) { display: none; }
  .konstanta-header .konstanta-nav .dropdown-item { white-space: normal; }
  .konstanta-header .konstanta-access { display: none !important; }
}

/* На планшетах используем те же контакты внутри бургера, что на телефонах. */
@media (min-width: 768px) and (max-width: 1179.98px) {
  .konstanta-header .konstanta-wrap { padding-left: 24px; padding-right: 24px; }
  .konstanta-header .konstanta-top .konstanta-wrap { min-height: 0; padding-top: 8px; padding-bottom: 8px; }
  .konstanta-header .konstanta-top span:last-child { display: none; }
  .konstanta-header .konstanta-main { padding-top: 12px; padding-bottom: 12px; }
  .konstanta-header .konstanta-logo img { width: 200px; height: auto; }
  .konstanta-header #navbar-content {
    padding-left: 24px;
    padding-right: 24px;
  }
  .konstanta-header .konstanta-mobile-contacts { display: block; margin: 10px 0 0; padding: 20px 0 8px; border-top: 1px solid #e4edf1; }
  .konstanta-header .konstanta-mobile-contacts-title { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.4; color: #6b8793; margin: 0 0 10px; white-space: nowrap; }
  .konstanta-header .konstanta-mobile-contacts-title img { display: block; width: 16px; height: 16px; flex: 0 0 16px; object-fit: contain; }
  .konstanta-header .konstanta-mobile-contacts .konstanta-phones { display: flex; margin: 0; gap: 7px; }
  .konstanta-header .konstanta-mobile-contacts .konstanta-phones a { font-size: 21px; font-weight: 500; color: #294957; line-height: 1.3; letter-spacing: 0; white-space: nowrap; }
  .konstanta-header .konstanta-mobile-social { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
  .konstanta-header .konstanta-mobile-social a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid #e0eaf0; border-radius: 10px; color: #405e6b; font-size: 14px; line-height: 1.3; text-decoration: none; }
  .konstanta-header .konstanta-mobile-social img { display: block; width: 28px; height: 28px; }
}

@media (max-width: 1179.98px) and (prefers-reduced-motion: reduce) {
  .konstanta-header .navbar-toggler .navbar-toggler-icon,
  .konstanta-header .navbar-toggler .navbar-toggler-icon::before,
  .konstanta-header .navbar-toggler .navbar-toggler-icon::after { transition: none; }
}
