/* ── Mega-menu — v12.1.0 ─────────────────────────────────────────────────── */

/*
 * position: fixed so left:50% is relative to the viewport, not the parent li.
 * The main stylesheet puts position:relative on every li, which makes
 * position:absolute + left:50% centre on the narrow "Calculators" text (~120px)
 * and shift the menu ~460px off-screen to the left.
 * Using fixed + top:var(--header-height) anchors it right below the sticky header.
 */
.has-dropdown .nav-megamenu {
  display: none;
  position: fixed;
  top: var(--header-height, 64px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 999;
  overflow: hidden;
}
.has-dropdown:hover .nav-megamenu,
.has-dropdown:focus-within .nav-megamenu {
  display: flex;
  flex-direction: column;
}

/* Body — 6-column grid */
.nav-megamenu__body {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding: 20px 16px 8px;
}

/* Column */
.nav-megamenu__col {
  padding: 0 8px 12px;
  border-right: 1px solid #f1f5f9;
}
.nav-megamenu__col:last-child {
  border-right: none;
}

/* Group heading */
.nav-megamenu__group-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  padding: 4px 4px 8px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

/* Tool link */
.nav-megamenu__item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 4px;
  border-radius: 6px;
  text-decoration: none;
  color: #111827;
  font-size: 12.5px;
  line-height: 1.3;
  transition: background .12s;
}
.nav-megamenu__item:hover {
  background: #f0fdf4;
  color: #166534;
}
.nav-megamenu__item-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.nav-megamenu__new {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border-radius: 3px;
  padding: 1px 4px;
  vertical-align: middle;
  margin-left: 3px;
  flex-shrink: 0;
}

/* Footer bar */
.nav-megamenu__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  font-size: 12.5px;
}
.nav-megamenu__footer a {
  color: #166534;
  font-weight: 600;
  text-decoration: none;
}
.nav-megamenu__footer a:hover { text-decoration: underline; }
.nav-megamenu__footer span { color: #6b7280; }

/* Login / Dashboard button in nav-right */
.nav-login,
.nav-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.nav-login:hover,
.nav-dashboard:hover {
  border-color: #166534;
  color: #166534;
}

/* ── Responsive: collapse to simple link list below 1024px ─────────────── */
@media (max-width: 1023px) {
  .has-dropdown .nav-megamenu {
    display: none !important;
  }
  .nav-login,
  .nav-dashboard {
    display: none;
  }
}
