/* Nano Soft — definitive nav layout (loads last) */

.nav-start { display: contents !important; }

.menu-toggle {
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(16, 32, 56, 0.09);
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: rgba(26, 102, 224, 0.2);
  touch-action: manipulation;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #102038;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
body.nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand {
  z-index: 20;
  display: inline-flex !important;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.brand img {
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.nav-links a.nav-cta,
a.nav-cta {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(120deg, #0b3d91, #1a66e0 45%, #2fbf3a 100%) !important;
}

/* ========== PC / tablet landscape ========== */
@media (min-width: 821px) {
  .navbar {
    position: sticky !important;
    top: 0;
    z-index: 80;
  }

  .nav-inner {
    position: relative;
    max-width: var(--max, 1140px);
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 1rem;
  }

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

  /* Logo LEFT on PC */
  .brand {
    position: static !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    margin-right: auto !important;
    max-width: none;
    order: 1;
  }

  .nav-links {
    position: static !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.15rem !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    transform: none !important;
    order: 2;
  }

  .nav-links > li {
    width: auto !important;
    position: relative;
    flex: 0 0 auto;
  }

  .nav-links a,
  .nav-links button.nav-parent {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
    min-height: 42px;
    width: auto !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }

  .submenu {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    right: auto !important;
    min-width: 240px;
    display: none !important;
  }
  .has-open > .submenu {
    display: block !important;
  }
  .submenu-l2 {
    position: absolute !important;
    top: 0 !important;
    left: calc(100% + 6px) !important;
    display: none !important;
  }
  .submenu .has-open > .submenu-l2 {
    display: block !important;
  }
}

/* ========== Mobile ========== */
@media (max-width: 820px) {
  .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
    background: #ffffff !important;
  }

  .nav-inner {
    position: relative !important;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .menu-toggle {
    display: inline-flex !important;
    position: relative;
    z-index: 110;
  }

  /* Logo CENTER on mobile */
  .brand {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: min(200px, 52vw);
    z-index: 105;
  }

  /*
    Full-bleed drawer under header, flush LEFT — same edge as hamburger.
    Override any justify-self/margin that pushed the panel to the right.
  */
  .nav-links {
    position: fixed !important;
    top: var(--header-h, 76px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    inset-inline: 0 !important;
    justify-self: stretch !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.2rem;
    /* Match hamburger inset: nav-inner padding 1.25rem */
    padding: 0.75rem 1.25rem 1.1rem !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(16, 32, 56, 0.09);
    box-shadow: 0 18px 40px rgba(16, 50, 100, 0.1);
    max-height: calc(100svh - var(--header-h, 76px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 250 !important;
    text-align: left !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
    box-sizing: border-box !important;
  }

  body.nav-open .nav-links {
    display: flex !important;
    animation: ns-nav-drop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .nav-links > li {
    width: 100% !important;
    max-width: 100% !important;
  }

  .nav-links a,
  .nav-links button.nav-parent {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    color: #3a4d66 !important;
    -webkit-text-fill-color: #3a4d66 !important;
    background: transparent;
    box-sizing: border-box !important;
  }

  .nav-links a.active,
  .has-open > .nav-parent {
    background: rgba(26, 102, 224, 0.08) !important;
    color: #0b3d91 !important;
    -webkit-text-fill-color: #0b3d91 !important;
  }

  .nav-links a.nav-cta {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    justify-content: center !important;
    margin-left: 0 !important;
  }

  .submenu {
    position: static !important;
    display: none !important;
    box-shadow: none !important;
    border: 0 !important;
    background: #eef5ff !important;
    margin-top: 0.2rem;
    min-width: 0 !important;
    width: 100% !important;
    left: auto !important;
    right: auto !important;
  }
  .has-open > .submenu {
    display: block !important;
  }
  .submenu-l2 {
    position: static !important;
    left: auto !important;
    right: auto !important;
    display: none !important;
    margin: 0.2rem 0 0.35rem 0.6rem !important;
    background: #e8f2ff !important;
    box-shadow: none !important;
    border: 0 !important;
    width: auto !important;
  }
  .submenu .has-open > .submenu-l2 {
    display: block !important;
  }
}

@keyframes ns-nav-drop {
  from { transform: translate3d(0, -8px, 0); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body.nav-open .nav-links {
    animation: none !important;
  }
}
