/* Grondkracht shared responsive header/menu – v17 */
@media (max-width: 980px) {
  header {
    overflow: visible;
  }

  header .nav {
    position: relative;
    width: min(calc(100% - 28px), var(--max, 1280px));
    min-height: 72px;
    height: auto;
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
  }

  header .brand {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(.88rem, 4vw, 1.05rem);
    letter-spacing: .11em !important;
  }

  /* Keep the conversion CTA visible on every page, but compact on mobile. */
  header .header-cta,
  header .btn.header-cta {
    display: inline-flex;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 9px 13px;
    margin: 0;
    border-radius: 999px;
    font-size: .78rem;
    line-height: 1.15;
    white-space: nowrap;
    flex: 0 0 auto;
    transform: none;
  }

  header .menu-toggle,
  header .menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--green, var(--green-900, #143a29));
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
    position: relative;
    z-index: 42;
  }

  header .menu-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
  }

  /* The navigation becomes a dropdown panel below the header row. */
  header nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 40;
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    background: #fbfaf6;
    border: 1px solid rgba(20, 58, 41, .14);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 18px 40px rgba(20, 58, 41, .12);
    padding: 10px 18px 16px;
  }

  header nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  header nav ul,
  header nav.is-open ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  header nav li {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(20, 58, 41, .10);
  }

  header nav li:last-child {
    border-bottom: 0;
  }

  header nav a {
    display: block;
    width: 100%;
    padding: 13px 4px;
    font-size: 1rem;
    line-height: 1.25;
  }

  header nav a::after {
    display: none;
  }
}

@media (max-width: 430px) {
  header .nav {
    gap: 8px;
  }

  header .brand {
    font-size: .84rem;
  }

  header .header-cta,
  header .btn.header-cta {
    padding: 8px 10px;
    font-size: .72rem;
  }

  header .menu-toggle,
  header .menu {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    font-size: 1.45rem;
  }
}

@media (max-width: 360px) {
  header .brand {
    font-size: .76rem;
    letter-spacing: .08em !important;
  }

  header .header-cta,
  header .btn.header-cta {
    padding-inline: 8px;
    font-size: .68rem;
  }
}

/* v28: robust mobile-menu visibility and stacking. */
@media (max-width: 980px) {
  header {
    z-index: 1000 !important;
    overflow: visible !important;
  }

  header .nav {
    overflow: visible !important;
  }

  header #gk-primary-navigation {
    display: block !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
  }

  header #gk-primary-navigation.is-open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  header #gk-primary-navigation ul,
  header #gk-primary-navigation.is-open ul {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
}

@media (min-width: 981px) {
  header #gk-primary-navigation[aria-hidden="true"] {
    visibility: visible !important;
  }
}
