/* Gemeinsame Desktop-Geometrie der Hauptnavigation.
   Diese Datei wird nach seitenbezogenen Styles geladen, damit Route-spezifische
   Regeln weder Containerbreite noch CTA-Position verschieben können. */

html,
body {
  overflow-x: clip;
}

@media (min-width: 1121px) {
  .nav {
    --header-nav-width: min(725px, calc(100vw - 384px));
    box-sizing: border-box;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, var(--header-nav-width)) minmax(0, 1fr);
    align-items: center;
    height: var(--site-nav, var(--nav-h));
    min-height: 0;
    padding-inline: max(24px, calc((100vw - var(--site-wrap, 1180px)) / 2));
  }

  /* trades.css/funktionen.css set their own inner-nav padding. Keep the
     route-independent shell authoritative after those page styles. */
  body.trade-page .nav {
    padding-inline: max(24px, calc((100vw - var(--site-wrap, 1180px)) / 2));
  }

  body.trade-page .inner-nav .nav-links {
    display: flex;
    gap: 6px;
  }

  body.trade-page .inner-nav .nav-links a {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 15px;
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 20px;
    white-space: nowrap;
    color: rgba(255, 255, 255, .78);
  }

  body.trade-page .inner-nav .nav-links a:hover,
  body.trade-page .inner-nav .nav-links a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .16);
  }

  body.trade-page .inner-nav .nav-links a[aria-current] {
    color: #e1bd63;
  }

  .nav-brand {
    justify-self: start;
  }

  .nav-links {
    display: flex !important;
    grid-column: 2;
    justify-content: center;
    width: var(--header-nav-width);
    gap: 6px;
  }

  .nav-links a,
  .nav-link-btn {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 15px;
    font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 20px;
    white-space: nowrap;
  }

  .nav-item {
    display: flex;
    align-items: center;
  }

  .nav-link-btn {
    gap: 7px;
    color: rgba(255, 255, 255, .78);
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
  }

  .nav-link-btn:hover,
  .nav-link-btn:focus-visible,
  .nav-item.open .nav-link-btn {
    color: #fff;
    background: rgba(255, 255, 255, .16);
  }

  .nav-caret {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    transition: transform .18s ease;
  }

  .nav-item.open .nav-caret {
    transform: rotate(180deg);
  }

  .nav.mega-open {
    background: rgba(12, 13, 15, .97);
  }

  .mega {
    position: absolute;
    top: var(--site-nav, var(--nav-h));
    right: 0;
    left: 0;
    max-height: calc(100vh - var(--site-nav, var(--nav-h)));
    overflow: auto;
    color: #16181d;
    background: #fff;
    border-bottom: 1px solid #e4e4e6;
    box-shadow: 0 44px 80px -44px rgba(8, 9, 11, .5);
  }

  .mega-inner {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 24px;
  }

  .mega-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mega-grid li {
    margin: 0;
    padding: 0;
  }

  .mega-grid li::before {
    content: none;
  }

  .nav-links .mega-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    width: 100%;
    min-height: 0;
    padding: 8px;
    white-space: normal;
    text-decoration: none;
    border-radius: 12px;
    transition: background .18s ease;
  }

  .nav-links .mega-card:hover,
  .nav-links .mega-card:focus-visible {
    background: #f4f4f5;
  }

  .mega-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #f4f4f5;
    border: 1px solid #e4e4e6;
    border-radius: 9px;
  }

  .mega-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .mega-title {
    display: block;
    margin: 0;
    color: #16181d;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1.35;
    text-align: left;
  }

  .mega-foot {
    margin-top: 20px;
    padding-top: 16px;
    text-align: center;
    border-top: 1px solid #e4e4e6;
  }

  .nav-links .mega-all {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    min-height: 0;
    padding: 0;
    color: #8a6c1f;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }

  .nav-links .mega-all:hover,
  .nav-links .mega-all:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  @keyframes kindel-mega-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .nav-item.open .mega {
    animation: kindel-mega-in .18s ease;
  }

  .nav > .nav-links > a {
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s, color .15s;
  }

  .nav > .nav-links > a:not([aria-current]):hover,
  .nav > .nav-links > a:not([aria-current]):focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .16);
  }

  .nav > .nav-links > a[aria-current] {
    color: #e1bd63;
  }

  .nav-right,
  .inner-nav-actions {
    display: flex;
    grid-column: 3;
    justify-self: end;
    align-items: center;
    min-width: 158px;
    margin-left: 0;
  }

  .nav-pilot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 158px;
    height: 40px;
    padding: 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .inner-menu {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-item.open .mega {
    animation: none;
  }

  .nav-caret {
    transition: none;
  }
}

/* The five full labels plus the fixed pilot CTA need at least 1121 px.
   Switch as one unit before a link can run underneath the CTA. */
@media (max-width: 1120px) {
  .nav > .nav-links,
  body.trade-page .inner-nav .nav-links {
    display: none !important;
  }

  .nav .nav-pilot {
    display: none !important;
  }

  .landing-page .nav-burger {
    display: inline-flex;
  }

  .inner-nav .inner-menu {
    display: block !important;
  }
}
