/* =========================================================
   FULFILIX CLOUD — Navigation Layer
   Floating glass header shell, mega menu, mobile overlay.
   Loaded after style.css / responsive.css / refine.css.
   ========================================================= */

:root {
  --nav-shell-h: 68px;
  --nav-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-ink: #cbbfe0;
  --nav-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Shell ---------- */
.navbar {
  height: auto;
  padding: 18px 0 0;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: padding 0.45s var(--nav-ease);
}
.navbar.scrolled { padding-top: 10px; }

.navbar .nav-container {
  max-width: 1320px;
  padding: 0 24px;
  display: block;
}

.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-shell-h);
  padding: 0 10px 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(168, 85, 247, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(100deg, rgba(24, 12, 48, 0.72) 0%, rgba(12, 8, 26, 0.78) 52%, rgba(24, 12, 48, 0.72) 100%);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 46px -24px rgba(4, 0, 14, 0.85);
  transition: border-color 0.4s var(--nav-ease), background 0.4s var(--nav-ease),
    box-shadow 0.4s var(--nav-ease);
}
.nav-shell::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 132, 252, 0.42), transparent);
  opacity: 0.7;
  pointer-events: none;
}
.navbar.scrolled .nav-shell {
  border-color: rgba(168, 85, 247, 0.26);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.07) inset,
    0 22px 54px -26px rgba(4, 0, 14, 0.95);
}

/* ---------- Brand ---------- */
.navbar .nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-right: 6px;
}
.navbar .nav-logo img {
  height: 32px;
  width: auto;
  transition: opacity 0.3s var(--nav-ease), filter 0.4s var(--nav-ease);
}
.navbar .nav-logo:hover img {
  filter: drop-shadow(0 0 14px rgba(196, 132, 252, 0.45));
}

/* ---------- Desktop links ---------- */
.navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}

.navbar .nav-link,
.navbar .mega-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  font-family: var(--nav-mono);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--nav-ink);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s var(--nav-ease), background 0.3s var(--nav-ease);
}
.navbar .nav-link::after,
.navbar .mega-trigger::after {
  content: '';
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, rgba(196, 132, 252, 0.9), rgba(236, 72, 153, 0.85));
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.4s var(--nav-ease), opacity 0.3s var(--nav-ease);
}
.navbar .nav-link:hover,
.navbar .mega-trigger:hover,
.navbar .nav-link:focus-visible,
.navbar .mega-trigger:focus-visible {
  color: #fff;
  background: rgba(168, 85, 247, 0.08);
}
.navbar .nav-link:hover::after,
.navbar .mega-trigger:hover::after,
.navbar .nav-link.active::after,
.navbar .mega-trigger[aria-expanded='true']::after,
.navbar .mega-trigger.active::after {
  transform: scaleX(1);
  opacity: 1;
}
.navbar .nav-link.active,
.navbar .mega-trigger.active { color: #fff; }
.navbar .nav-link svg,
.navbar .mega-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform 0.4s var(--nav-ease);
}
.navbar .mega-trigger[aria-expanded='true'] svg { transform: rotate(180deg); }

/* ---------- Header actions ---------- */
.navbar .nav-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  flex-shrink: 0;
}
.nav-login {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-family: var(--nav-mono);
  font-size: 0.8125rem;
  color: var(--nav-ink);
  transition: color 0.3s var(--nav-ease), background 0.3s var(--nav-ease);
}
.nav-login:hover { color: #fff; background: rgba(168, 85, 247, 0.08); }

.navbar .nav-trial {
  height: 44px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.875rem;
  gap: 8px;
}
.btn-arrow {
  display: inline-block;
  transition: transform 0.4s var(--nav-ease);
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Mega menu ---------- */
.nav-dropdown { position: static; }
.mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  width: min(760px, calc(100vw - 48px));
  transform: translate(-50%, -8px);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(194, 116, 255, 0.18);
  background: linear-gradient(180deg, rgba(20, 10, 40, 0.96) 0%, rgba(10, 5, 22, 0.97) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 26px 70px -20px rgba(4, 0, 14, 0.9), 0 0 40px rgba(168, 85, 247, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s var(--nav-ease), transform 0.42s var(--nav-ease),
    visibility 0.32s linear;
  z-index: 120;
}
.nav-dropdown.open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mega-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 22px;
}
.mega-col + .mega-col {
  padding-left: 22px;
  border-left: 1px solid rgba(168, 85, 247, 0.14);
}
.mega-label {
  font-family: var(--nav-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b7bb0;
  margin-bottom: 12px;
}
.mega-list { display: flex; flex-direction: column; gap: 2px; }

.mega-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  color: #e6dff5;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  transition: color 0.3s var(--nav-ease), background 0.3s var(--nav-ease);
}
.mega-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(100deg, rgba(124, 58, 237, 0.22), rgba(236, 72, 153, 0.1));
  opacity: 0;
  transition: opacity 0.35s var(--nav-ease);
}
.mega-link:hover { color: #fff; }
.mega-link:hover::before { opacity: 1; }
.mega-link > * { position: relative; z-index: 1; }

.mega-link-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.26);
  background: linear-gradient(150deg, rgba(124, 58, 237, 0.24), rgba(24, 12, 48, 0.6));
  transition: border-color 0.35s var(--nav-ease), box-shadow 0.35s var(--nav-ease);
}
.mega-link-icon svg { width: 17px; height: 17px; color: #d8b9ff; }
.mega-link:hover .mega-link-icon {
  border-color: rgba(216, 185, 255, 0.5);
  box-shadow: 0 0 16px -4px rgba(196, 132, 252, 0.5);
}
.mega-link-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mega-link-text small {
  font-size: 0.75rem;
  font-weight: 400;
  color: #8b7bb0;
  letter-spacing: 0;
}

.mega-promo {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: linear-gradient(150deg, rgba(124, 58, 237, 0.16), rgba(20, 10, 40, 0.4));
}
.mega-promo strong { display: block; font-size: 0.9rem; color: #fff; font-weight: 600; }
.mega-promo p { margin: 5px 0 12px; font-size: 0.78rem; color: #9d8dc0; line-height: 1.55; }
.mega-promo .btn { width: 100%; justify-content: center; height: 40px; min-height: 40px; font-size: 0.8125rem; }

/* ---------- Mobile toggle ---------- */
.navbar .mobile-menu-btn {
  width: 42px;
  height: 42px;
  margin-left: 0;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.06);
}
.navbar .mobile-menu-btn span { width: 18px; background: #e6dff5; }

/* ---------- Mobile overlay ---------- */
.mobile-nav {
  top: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(12, 6, 26, 0.98) 0%, rgba(7, 4, 16, 0.99) 100%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateY(-14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--nav-ease), transform 0.5s var(--nav-ease),
    visibility 0.4s linear;
}
.mobile-nav.open { transform: translateY(0); opacity: 1; visibility: visible; }

.mobile-nav-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-shell-h) + 34px) 22px 26px;
}
.mobile-nav .mobile-nav-links { gap: 0; flex: 1 1 auto; }
.mobile-nav-link {
  padding: 16px 2px;
  font-family: var(--nav-mono);
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #e6dff5;
  border-radius: 0;
  border-bottom: 1px solid rgba(168, 85, 247, 0.12);
}
.mobile-nav-link:hover { background: transparent; color: #fff; }

.m-acc { border-bottom: 1px solid rgba(168, 85, 247, 0.12); }
.m-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px;
  font-family: var(--nav-mono);
  font-size: 1.0625rem;
  color: #e6dff5;
  background: none;
  border: 0;
}
.m-acc-trigger svg { width: 16px; height: 16px; transition: transform 0.4s var(--nav-ease); }
.m-acc.open .m-acc-trigger svg { transform: rotate(180deg); }
.m-acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--nav-ease);
}
.m-acc.open .m-acc-panel { max-height: 460px; }
.m-acc-panel-inner { padding: 2px 0 14px; display: flex; flex-direction: column; gap: 2px; }
.m-sub-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: #b9abd6;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.1);
  transition: color 0.3s var(--nav-ease), border-color 0.3s var(--nav-ease),
    background 0.3s var(--nav-ease);
}
.m-sub-link:hover { color: #fff; border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.1); }

.mobile-nav .mobile-nav-cta {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(168, 85, 247, 0.14);
  gap: 10px;
}
.mobile-nav .mobile-nav-cta .btn { border-radius: 999px; height: 50px; min-height: 50px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .navbar .nav-link,
  .navbar .mega-trigger { padding: 0 10px; font-size: 0.78rem; }
  .nav-login { padding: 0 10px; }
}
@media (max-width: 1024px) {
  .navbar .nav-links,
  .navbar .nav-cta { display: none !important; }
  .navbar .mobile-menu-btn { display: flex !important; margin-left: auto; }
  .nav-shell { padding-right: 12px; }
}
@media (max-width: 560px) {
  .navbar { padding-top: 12px; }
  .navbar .nav-container { padding: 0 16px; }
  .nav-shell { height: 60px; padding-left: 14px; border-radius: 16px; }
  .navbar .nav-logo img { height: 28px; }
  :root { --nav-shell-h: 60px; }
}
