/* Inextrix Mega Menu — header + dynamic mega menu.
   Scoped to .site-header / .mega-menu / .mega-overlay so it won't fight the theme. */

.site-header {
  --purple: #7c3aed;
  --purple-2: #a855f7;
  --purple-deep: #6d28d9;
  --ink: #1f2430;
  --ink-soft: #4b5163;
  --muted: #6b7280;
  --line: #ece9f5;
  --ico-bg: #f1ecfd;
  --ico-fg: #7c3aed;
  --radius: 18px;
  --shadow: 0 24px 60px -20px rgba(76, 29, 149, 0.28), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.site-header *,
.mega-menu *,
.mega-overlay { box-sizing: border-box; }

.site-header a,
.mega-menu a { text-decoration: none; color: inherit; }
.site-header ul,
.mega-menu ul { list-style: none; margin: 0; padding: 0; }
.site-header button { font: inherit; cursor: pointer; border: 0; background: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(124, 58, 237, 0.06);
  box-shadow: 0 2px 18px -10px rgba(0, 0, 0, 0.18);
}

.site-header .header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Logo */
.site-header .logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-header .logo--custom img { max-height: 46px; width: auto; }
.site-header .logo-mark { display: grid; place-items: center; }
.site-header .logo-text { display: flex; flex-direction: column; line-height: 1; }
.site-header .logo-name { font-weight: 800; font-size: 22px; letter-spacing: 0.5px; color: var(--ink); }
.site-header .logo-sub { font-weight: 600; font-size: 9px; letter-spacing: 4px; color: var(--muted); margin-top: 3px; }

/* Primary nav */
.site-header .primary-nav { margin-left: auto; }
.site-header .nav-list { display: flex; align-items: center; gap: 6px; }
/* static so mega panels position relative to the header (centered on page) */
.site-header .nav-item { position: static; }

.site-header .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2124;
  border-radius: 10px;
  transition: color 0.18s ease, background 0.18s ease;
  background: transparent;
}
.site-header .nav-link:hover { color: #4b5563; }

.site-header .caret {
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
  opacity: 0.7;
}
.site-header .has-mega.open .caret { transform: rotate(-135deg) translateY(-2px); }
.site-header .has-mega.open .nav-link { color: #4b5563; }

/* CTA */
.site-header .mm-cta { display: inline-flex; }
.site-header .btn-cta {
  flex-shrink: 0;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #4b5563 0%, var(--purple-deep) 100%);
  box-shadow: 0 10px 22px -8px rgba(124, 58, 237, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.site-header .btn-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -8px rgba(124, 58, 237, 0.72); }

/* ---------- Mega menu ---------- */
.mega-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: min(1180px, calc(100vw - 48px));
  /*background: linear-gradient(180deg, #ffffff 0%, #fdfcff 100%);*/
  background: linear-gradient(180deg, #ffffff 0%, #fdfcff 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
/* transparent bridge so hover survives the gap between trigger and panel */
.mega-menu::before { content: ""; position: absolute; top: -28px; left: 0; right: 0; height: 28px; }

.has-mega.open .mega-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu .mega-bar { 
  height: 4px; 
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #8b5cf6); 
}
.mega-menu .mega-pad { padding: 32px 26px 36px; }

/* Multi-section columns (Services): packed into balanced columns. */
.mega-menu .mega-cols { column-count: 4; column-gap: 36px; }
.mega-menu .mega-cols .mega-col { display: inline-block; width: 100%; margin: 0 0 22px; break-inside: avoid; }

/* Single-section links spread across columns (Solutions). */
.mega-menu .mega-links.mm-multicol { column-count: 4; column-gap: 36px; }
.mega-menu .mega-links.mm-multicol li { break-inside: avoid; }

.mega-menu .mega-col { min-width: 0; }

/* Intro block (Our Products / Hire Developers) */
.mega-menu .mega-intro { margin-bottom: 22px; }
.mega-menu .mega-sub { margin: 10px 0 0; font-size: 15px; color: var(--muted); max-width: 70ch; line-height: 1.55; }

.mega-menu .mega-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.mega-menu .mega-ico {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 11px;
  background: #f0eeff !important; color: #7c3aed !important;
  flex-shrink: 0;
}
.mega-menu .mega-ico.sm { width: 34px; height: 34px; border-radius: 10px; }
.mega-menu .mega-title { font-weight: 700; font-size: 16.5px; color: var(--ink); }

.mega-menu .mega-links li { margin: 2px 0 10px; }
.mega-menu .mega-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 8px 24px;
  font-size: 14px;
  line-height: 21px;
  color: #4B5563;
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease, padding 0.16s ease;
}
.mega-menu .mega-links a::before {
  content: "";
  position: absolute;
  left: 8px;
  width: 6px; height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0.55;
  transition: border-color 0.16s ease;
}
.mega-menu .mega-links a:hover {
    color: #4b5563;
    background: #e2e8ff;
    padding-left: 28px;
}
.mega-menu .mega-links a:hover::before { border-color: #4b5563; opacity: 1; }

/* ---------- Our Products: product cards ---------- */
.mega-menu .product-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.mega-menu .product-card {
  display: block; padding: 20px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.mega-menu .product-card:hover { border-color: rgba(124, 58, 237, 0.4); box-shadow: 0 16px 40px -22px rgba(124, 58, 237, 0.5); transform: translateY(-2px); }
.mega-menu .product-logo { display: flex; flex-direction: column; line-height: 1; margin-bottom: 16px; }
.mega-menu .product-logo-name { font-size: 26px; font-weight: 800; color: var(--brand, #4b5563); letter-spacing: 0.3px; }
.mega-menu .product-logo-tag { font-size: 9.5px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.mega-menu .product-desc { margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: #4B5563; }
.mega-menu .product-features { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.mega-menu .product-features li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--e-global-color-secondary);
}
.mega-menu .product-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #4b5563;
    transform: translateY(-50%);
}

/* ---------- Hire Developers: tech logo cards ---------- */
.mega-menu .tech-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.mega-menu .tech-card {
  display: grid; place-items: center; height: 96px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.mega-menu .tech-card:hover { border-color: rgba(124, 58, 237, 0.4); box-shadow: 0 14px 34px -20px rgba(124, 58, 237, 0.5); transform: translateY(-2px); }
.mega-menu .tech-name { font-size: 22px; font-weight: 800; color: var(--brand, var(--ink)); letter-spacing: 0.3px; }
.mega-menu .tech-logo img {
    width: 120px;
}
/* ---------- About: link columns + CTA cards ---------- */
.mega-menu .about-grid { display: grid; grid-template-columns: 1fr 1fr 1.15fr 1.15fr; gap: 36px; align-items: start; }
.mega-menu .about-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mega-menu .about-card .mega-head { margin-bottom: 14px; }
.mega-menu .about-thumb {
  display: block; height: 132px; border-radius: 12px;
  background: #fff;
  background-repeat: no-repeat; margin-bottom: 18px;
}
.mega-menu .about-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mega-menu .btn-block {
  display: block; 
  text-align: center; 
}
.mega-menu .btn-block:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(124, 58, 237, 0.7); }

/* ---------- Overlay + mobile toggle ---------- */
.mega-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 12, 40, 0.4);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
  z-index: 90;
}
body.menu-open .mega-overlay { opacity: 1; visibility: visible; }

.site-header .nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    background-color: transparent;
    position: relative;
    z-index: 999;
}
.site-header .nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.site-header .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .site-header .nav-link { padding: 10px 10px; font-size: 15px; }
  .site-header .nav-list { gap: 2px; }
}

@media (max-width: 980px) {
  .site-header .nav-toggle { display: flex; margin-left: auto; }
  .site-header .mm-cta { display: none; }

  .site-header .primary-nav {
    position: fixed; top: 0; right: 0;
    height: 100dvh; width: min(380px, 88vw);
    background: #fff; margin: 0; padding: 84px 18px 32px;
    overflow-y: auto; transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -20px 0 50px -20px rgba(0, 0, 0, 0.35);
    z-index: 95;
  }
  body.menu-open .site-header .primary-nav { transform: translateX(0); }

  .site-header .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-header .nav-item { width: 100%; }
  .site-header .nav-link { width: 100%; justify-content: space-between; font-size: 17px; padding: 14px 12px; border-radius: 12px; }
  .site-header .nav-link:hover { background: rgba(124, 58, 237, 0.06); }

  .mega-menu {
    position: static; transform: none; width: 100%;
    box-shadow: none; border-radius: 12px; background: #faf8ff;
    max-height: 0; opacity: 1; visibility: visible; pointer-events: auto;
    transition: max-height 0.32s ease, margin 0.32s ease; margin: 0;
    border: 0px solid #e4e8f5 !important;
  }
  .has-mega.open .mega-menu { max-height: 2400px; margin: 4px 0 10px; transform: none; }
  .mega-menu::before { display: none; }
  .mega-menu .mega-bar { display: none; }
  .mega-menu .mega-pad { padding: 14px; }
  .mega-menu .mega-cols,
  .mega-menu .mega-links.mm-multicol { column-count: 1; }
  .mega-menu .product-cards,
  .mega-menu .tech-cards,
  .mega-menu .about-grid { grid-template-columns: 1fr; gap: 14px; }
  .mega-menu .mega-head { margin-bottom: 10px; }
  .mega-menu .mega-intro { margin-bottom: 14px; }
}

/* ---------- Layout classes used by the hand-authored mega partials ---------- */
.mega-menu .mega-grid--4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1.05fr; gap: 8px 36px; }
.mega-menu .sol-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px 36px; }
.mega-menu .mega-title--caps { letter-spacing: 0.6px; }
.mega-menu .mega-divider { height: 1px; background: var(--line); margin: 18px 0; }
.mega-menu .mega-head + .mega-divider { margin-top: 20px; }
.mega-menu .mega-headings li { margin: 4px 0 10px; }
.mega-menu .mega-headings a {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 8px; font-size: 16.5px; font-weight: 700;
  color: var(--ink); border-radius: 10px;
  transition: background 0.16s ease, color 0.16s ease;
}
.mega-menu .mega-headings a:hover { background: rgba(124, 58, 237, 0.06); color: #4b5563; }
.mega-menu .mega-headings a:hover .mega-ico { background: #4b5563; color: #fff; }

@media (max-width: 980px) {
  .mega-menu .mega-grid--4,
  .mega-menu .sol-grid { grid-template-columns: 1fr; gap: 6px 0; }
}

/* ============================================================
   Inline mode — [inextrix_menu] inside an Elementor header.
   Outputs only the nav (no logo / no sticky header chrome);
   mega panels float relative to the VIEWPORT so the Elementor
   column width can't clip or off-center them.
   ============================================================ */
.site-header.inx-inline {
  position: static;
  background: transparent;
  box-shadow: none;
  border: 0;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0;
}
.site-header.inx-inline .primary-nav { margin-left: 0; width: 100%; }
.site-header.inx-inline .nav-list { justify-content: flex-end; } /* change to center / flex-start to taste */

/* Floating panel: fixed to the viewport, centered, anchored under the trigger. */
.inx-inline .mega-menu {
  position: fixed;
  top: var(--inx-mega-top, 84px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 0;
}
.inx-inline .has-mega.open .mega-menu { transform: translateX(-50%) translateY(0); }

/* Mobile: revert to the in-flow accordion (override the fixed rule above). */
@media (max-width: 980px) {
  .site-header.inx-inline { display: block; }
  .site-header.inx-inline .nav-list { justify-content: stretch; }
  .inx-inline .mega-menu { position: static; top: auto; left: auto; transform: none; }
  .inx-inline .has-mega.open .mega-menu { transform: none; }
}
