/* BAKIPA responsive header navigation
   Wide desktop: full navigation + CTA, phone when space permits.
   Compact desktop/tablet: CTA + menu toggle.
   Mobile: menu toggle; CTA moves into the opened navigation. */

.site-header .container {
  max-width: 1720px;
}

.main-nav .nav-link,
.header-phone {
  white-space: nowrap;
}

.main-nav .nav-link {
  padding-inline: clamp(.55rem, .72vw, .8rem);
}

/* The phone is useful, but lower priority than the primary navigation and CTA. */
@media (min-width: 1121px) and (max-width: 1450px) {
  .header-phone {
    display: none;
  }
}

/* Content-driven collapse point: before the seven primary links can wrap. */
@media (max-width: 1120px) {
  .site-header {
    overflow: visible;
  }

  .header-inner {
    position: static;
  }

  .header-phone {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    bottom: auto;
    z-index: 210;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
    padding: 1rem max(1rem, env(safe-area-inset-right)) calc(1.5rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .35rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 18px 38px rgba(12, 47, 43, .16);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav .nav-link {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    padding: .82rem 1rem;
    white-space: nowrap;
  }

  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* Compact desktop/tablet keeps the high-value trial CTA visible in the header. */
@media (min-width: 721px) and (max-width: 1120px) {
  .header-cta .button-header {
    display: inline-flex;
  }

  .main-nav > .button {
    display: none;
  }
}

/* Mobile keeps the header lean and exposes the trial CTA inside the menu. */
@media (max-width: 720px) {
  .header-cta .button-header {
    display: none;
  }

  .main-nav > .button {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    margin-top: .65rem;
  }
}
