/* ==========================================================================
   MAGNET4WATER NAV COMPONENT — PREMIUM FINAL
   Robust, fully scoped, compact one-column dropdowns.
   ========================================================================== */

#m4w-nav-root,
#m4w-nav-root * {
  box-sizing: border-box;
}

#m4w-nav-root {
  position: relative;
  z-index: 10000;
  width: 100%;
  font-family: "DM Sans", "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#m4w-nav-root a,
#m4w-nav-root button {
  font-family: inherit;
}

#m4w-nav-root a {
  text-decoration: none;
}

/* -------------------------
   GLOBAL NAV ROW
------------------------- */
#m4w-nav-root .m4w-nav {
  width: 100%;
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(148,163,184,.18);
  backdrop-filter: blur(12px);
}

#m4w-nav-root .m4w-nav-wrap {
  width: 100%;
  max-width: 1320px;
  height: 42px;
  min-height: 42px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 28px;
  flex-wrap: nowrap !important;
}

#m4w-nav-root .m4w-brand {
  flex: 0 0 auto;
  height: 42px;
  display: inline-flex;
  align-items: center;
  color: #0e7490;
  font-size: 15.5px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

#m4w-nav-root .m4w-nav-links {
  flex: 0 1 auto;
  margin-left: auto;
  height: 42px;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 22px;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  overflow: visible;
}

#m4w-nav-root .m4w-dropdown {
  position: relative;
  height: 42px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

/* Reset button styling — tabs are text, not buttons */
#m4w-nav-root .m4w-nav-link {
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;

  height: 42px;
  display: inline-flex;
  align-items: center;
  color: #263449;
  font-size: 14.5px;
  line-height: 1;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .075em;
  cursor: pointer;
  white-space: nowrap;
  transition: color .16s ease, transform .16s ease;
}

#m4w-nav-root a.m4w-nav-link {
  text-decoration: none;
}

#m4w-nav-root .m4w-nav-link:hover,
#m4w-nav-root .m4w-dropdown.open > .m4w-nav-link {
  color: #0e7490;
  transform: translateY(-1px);
}

/* -------------------------
   DROPDOWN PANELS
------------------------- */
#m4w-nav-root .m4w-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 258px;
  min-width: 258px;
  max-width: 258px;
  padding: 7px;
  display: block !important;
  border-radius: 14px;
  background: rgba(255,255,255,.985);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 16px 42px rgba(15,23,42,.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(.985);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 10001;
}

/* Keep right-side dropdowns on-screen */
#m4w-nav-root .m4w-dropdown:nth-last-child(-n+2) .m4w-dropdown-menu {
  left: auto;
  right: 0;
}

#m4w-nav-root .m4w-dropdown.open > .m4w-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Optional divider item */
#m4w-nav-root .m4w-menu-divider {
  height: 1px;
  margin: 5px 4px;
  background: rgba(148,163,184,.18);
}

/* Menu items */
#m4w-nav-root .m4w-dropdown-item {
  width: 100%;
  border-radius: 9px;
  margin: 0;
  color: #1f2d3d;
}

#m4w-nav-root .m4w-dropdown-item + .m4w-dropdown-item {
  margin-top: 2px;
}

#m4w-nav-root a.m4w-dropdown-item {
  display: block;
  padding: 7px 9px;
  line-height: 1.15;
  transition: background .14s ease, color .14s ease;
}

#m4w-nav-root a.m4w-dropdown-item:hover {
  background: linear-gradient(135deg, rgba(14,116,144,.07), rgba(37,99,235,.045));
}

#m4w-nav-root .m4w-dropdown-item strong {
  display: block;
  color: #1f2d3d;
  font-size: 11.5px;
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#m4w-nav-root .m4w-dropdown-item span {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 10.7px;
  line-height: 1.15;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Higher-priority top item in Docs */
#m4w-nav-root .m4w-dropdown-item.m4w-featured {
  background: rgba(14,116,144,.055);
}

#m4w-nav-root .m4w-dropdown-item.m4w-featured:hover {
  background: rgba(14,116,144,.09);
}

/* Platforms: dual-action row */
#m4w-nav-root .m4w-dropdown-item.m4w-dual {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 6px 6px 9px;
  transition: background .14s ease;
}

#m4w-nav-root .m4w-dropdown-item.m4w-dual:hover {
  background: linear-gradient(135deg, rgba(14,116,144,.075), rgba(37,99,235,.045));
}

#m4w-nav-root .m4w-item-main {
  min-width: 0;
  display: block;
  color: inherit;
  line-height: 1.1;
}

#m4w-nav-root .m4w-item-main strong,
#m4w-nav-root .m4w-item-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#m4w-nav-root .m4w-item-launch {
  justify-self: end;
  align-self: center;
  min-width: 64px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-left: 1px solid rgba(148,163,184,.30);
  border-radius: 999px;
  color: #0e7490;
  background: rgba(14,116,144,.04);
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}

#m4w-nav-root .m4w-item-launch:hover {
  background: rgba(14,116,144,.12);
  color: #075985;
  transform: translateX(1px);
}

/* -------------------------
   LOCAL PLATFORM ROW
------------------------- */
#m4w-nav-root .m4w-platform-nav {
  width: 100%;
  height: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

#m4w-nav-root .m4w-platform-wrap {
  width: 100%;
  max-width: 1320px;
  height: 24px;
  min-height: 24px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 13px;
  flex-wrap: nowrap !important;
  overflow: hidden;
}

#m4w-nav-root .m4w-platform-label {
  flex: 0 0 auto;
  color: #0e7490;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
  white-space: nowrap;
}

#m4w-nav-root .m4w-platform-label::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-left: 12px;
  vertical-align: -2px;
  background: rgba(148,163,184,.45);
}

#m4w-nav-root .m4w-platform-links {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: none;
}

#m4w-nav-root .m4w-platform-links::-webkit-scrollbar {
  display: none;
}

#m4w-nav-root .m4w-platform-links a {
  flex: 0 0 auto;
  color: #475569;
  font-size: 10.8px;
  line-height: 1;
  font-weight: 750;
  white-space: nowrap;
  transition: color .14s ease;
}

#m4w-nav-root .m4w-platform-links a:hover {
  color: #0e7490;
}

/* -------------------------
   RESPONSIVE
------------------------- */
@media (max-width: 860px) {
  #m4w-nav-root .m4w-nav {
    height: auto;
    min-height: 46px;
  }

  #m4w-nav-root .m4w-nav-wrap {
    height: auto;
    min-height: 46px;
    padding: 8px 18px;
    gap: 10px;
    flex-wrap: wrap !important;
  }

  #m4w-nav-root .m4w-nav-links {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap !important;
  }

  #m4w-nav-root .m4w-dropdown {
    height: 30px;
  }

  #m4w-nav-root .m4w-nav-link {
    height: 30px;
    font-size: 12.5px;
  }

  #m4w-nav-root .m4w-dropdown-menu {
    left: 0;
    right: auto;
    width: min(258px, calc(100vw - 36px));
    min-width: min(258px, calc(100vw - 36px));
    max-width: min(258px, calc(100vw - 36px));
  }

  #m4w-nav-root .m4w-platform-wrap {
    justify-content: flex-start;
    padding: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #m4w-nav-root *,
  #m4w-nav-root *::before,
  #m4w-nav-root *::after {
    transition: none !important;
    transform: none !important;
  }
}
