/* Header stabilization r100 — kosmoenergetika.online + /en.
   Loaded after the legacy bundles so these focused layout corrections win the cascade. */
.header .masthead,
.header .site-navigation,
.site-navigation .mobile-bar {
  min-width: 0;
}

/* On desktop keep the social/contact modules intact; allow the brand column
   to yield first instead of squeezing the tagline into narrow vertical lines. */
@media (min-width: 1201px) {
  .header .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .header .brand > span:last-child {
    min-width: 0;
  }

  .header .wordmark {
    overflow-wrap: anywhere;
  }

  .header .masthead-social {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .header .masthead-social > .micro {
    white-space: nowrap;
  }

  .header .consultation {
    flex: 0 0 auto;
  }
}

/* Anchor the responsive menu popover to its own trigger, not to the whole
   sticky navigation bar. Keep the panel inside the viewport on narrow screens. */
@media (max-width: 1200px) {
  .site-navigation .mobile-nav {
    position: relative;
    flex: 0 0 auto;
  }

  .site-navigation .mobile-panel {
    right: 0;
    left: auto;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
  }
}

/* The legacy 360px rule added 18px to --nav-height and another 16px to the
   mobile bar, causing a sudden header jump between 361px and 360px. Keep the
   compact bar at the same height on both sides of that breakpoint. */
@media (max-width: 360px) {
  :root {
    --nav-height: 108px;
  }

  .site-navigation .mobile-bar {
    min-height: 108px;
    padding-bottom: 44px;
  }
}
