/* Shared product discovery, kept within the header while the page stays in place. */
.product-icon {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--lime);
}

.nav .desktop-nav { align-items: center; }

.products-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 500 13px/1.5 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: color 160ms ease;
}

.products-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.products-toggle:hover,
.products-toggle[aria-expanded='true'] { color: var(--lime); }
.products-toggle[aria-expanded='true']::after { transform: translateY(3px) rotate(225deg); }
.products-toggle:focus-visible { outline-offset: 5px; }
.nav-drawer .products-toggle { justify-content: flex-start; width: 100%; min-height: 48px; font-size: 16px; }

.products-mega {
  position: absolute;
  z-index: 25;
  inset-inline: 0;
  top: 100%;
  max-height: calc(100vh - 85px);
  max-height: calc(100dvh - 85px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  isolation: isolate;
}

.products-mega[hidden] { display: none !important; }
.products-mega:not([hidden]) { animation: products-menu-enter 180ms ease-out both; }
.products-mega-inner {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 36px;
  padding-block: 32px;
}

.products-mega-intro { min-width: 0; padding-top: 3px; }
.products-mega .products-mega-intro .eyebrow {
  display: block;
  margin-bottom: 20px;
  color: var(--lime);
  font-size: 10px;
  letter-spacing: .08em;
}
.products-mega .products-mega-intro h2 {
  max-width: 13ch;
  color: var(--ink);
  font: 500 29px/1.16 var(--display);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.products-mega .products-mega-intro p:not(.eyebrow) {
  max-width: 28ch;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}
.products-mega-intro > a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 16px;
  color: var(--lime);
  font-size: 12px;
  line-height: 1.6;
}
.products-mega-intro > a:hover { text-decoration: underline; text-underline-offset: 5px; }

.products-mega-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
}
.products-mega-group { min-width: 0; }
.products-mega .products-mega-group h3 {
  margin: 0 0 12px;
  padding: 0 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 500 11px/1.5 var(--font);
  letter-spacing: .025em;
}
.products-mega-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 92px;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink);
  transition: background 160ms ease, border-color 160ms ease;
}
.products-mega-card + .products-mega-card { margin-top: 4px; }
.products-mega-card:hover {
  background: var(--surface);
  border-color: var(--line);
}
.products-mega-card:focus-visible {
  z-index: 1;
  outline: 2px solid var(--lime);
  outline-offset: 2px;
  background: var(--surface);
}
.products-mega-card[aria-current='page'] {
  background: var(--surface-2);
  border-color: var(--line);
}
.products-mega-card > .product-icon { width: 20px; height: 20px; margin-top: 2px; }
.products-mega-card > div { flex: 1; min-width: 0; }
.products-mega-card strong {
  display: block;
  color: var(--ink);
  font: 500 14px/1.45 var(--display);
}
.products-mega-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 400 12px/1.65 var(--font);
}
.products-mega-card > span:last-child {
  flex: none;
  margin-top: 1px;
  color: var(--muted);
  font: 14px/1.5 var(--font);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.products-mega-card:hover > span:last-child,
.products-mega-card:focus-visible > span:last-child,
.products-mega-card[aria-current='page'] > span:last-child {
  color: var(--lime);
  opacity: 1;
  transform: none;
}

.products-mega-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  min-height: 66px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.products-mega-footer > a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  color: var(--lime);
  font-weight: 500;
}
.products-mega-footer > a:hover { text-decoration: underline; text-underline-offset: 5px; }
.products-mega-footer > p,
.products-mega-footer > span { color: var(--muted); font-size: 11px; line-height: 1.7; }
.products-mega-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}
.products-mega-close:hover { color: var(--ink); border-color: var(--lime); }

/* Compact identities share the same icon language outside the menu. */
.product-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.product-identity > .product-icon { width: 26px; height: 26px; }
.product-identity strong { color: var(--ink); font: 500 14px/1.6 var(--display); }
.product-identity small { color: var(--muted); font-size: 11px; }
.product-identity > div { min-width: 0; }
.product-card-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-card-title .product-icon { width: 24px; height: 24px; }
.product-card-title strong { min-width: 0; }

html[lang='fa'] .products-mega .products-mega-intro h2 { font-size: 27px; line-height: 1.55; letter-spacing: 0; }
html[lang='fa'] .products-mega .products-mega-intro .eyebrow,
html[lang='fa'] .products-mega .products-mega-group h3 { letter-spacing: 0; }
html[lang='fa'] .products-mega-card strong { line-height: 1.7; }
html[lang='fa'] .products-mega-card small { line-height: 1.85; }

@keyframes products-menu-enter {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1280px) {
  .products-mega-inner { grid-template-columns: 210px minmax(0,1fr); gap: 40px; }
  .products-mega-groups { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px 24px; }
  .products-mega-card { min-height: 76px; padding: 10px; gap: 12px; }
  .products-mega .products-mega-group h3 { margin-bottom: 8px; padding-bottom: 12px; }
  .products-mega-card > span:last-child { opacity: 1; transform: none; }
  .products-mega-card strong { font-size: 14px; }
}

@media (max-width: 960px) {
  .products-mega-inner { grid-template-columns: minmax(0,1fr); gap: 28px; padding-block: 28px; }
  .products-mega-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
  .products-mega .products-mega-intro .eyebrow { grid-column: 1/-1; margin-bottom: 0; }
  .products-mega .products-mega-intro h2 { grid-row: 2/4; max-width: 15ch; }
  .products-mega .products-mega-intro p:not(.eyebrow) { max-width: 44ch; margin-top: 0; }
  .products-mega-intro > a { margin-top: 0; min-height: 36px; }
  .products-mega-groups { gap: 24px; }
  .products-mega-card { min-height: 72px; }
  .products-mega-card > .product-icon { width: 22px; height: 22px; }
}

@media (max-width: 700px) {
  .products-mega { max-height: calc(100vh - 73px); max-height: calc(100dvh - 73px); }
  .products-mega-inner { gap: 24px; padding-block: 24px; }
  .products-mega-intro { display: block; }
  .products-mega .products-mega-intro .eyebrow { margin-bottom: 12px; }
  .products-mega .products-mega-intro h2 { max-width: 18ch; font-size: 27px; }
  .products-mega .products-mega-intro p:not(.eyebrow) { max-width: 48ch; margin-top: 12px; font-size: 13px; }
  .products-mega-intro > a { margin-top: 10px; min-height: 44px; }
  .products-mega-groups { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .products-mega .products-mega-group h3 { margin-bottom: 6px; padding-inline: 10px; font-size: 12px; }
  .products-mega-card { min-height: 76px; gap: 14px; padding: 12px 10px; }
  .products-mega-card strong { font-size: 15px; }
  .products-mega-card small { font-size: 12px; }
  .products-mega-footer { gap: 8px 20px; padding-block: 14px 20px; }
  .products-mega-footer > p,
  .products-mega-footer > span { width: 100%; }
  html[lang='fa'] .products-mega .products-mega-intro h2 { font-size: 25px; }
}

@media (max-width: 380px) {
  .products-mega-card { gap: 12px; padding-inline: 8px; }
  .products-mega-card > span:last-child { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .products-mega:not([hidden]) { animation: none; }
  .products-toggle,
  .products-toggle::after,
  .products-mega-card,
  .products-mega-card > span:last-child { transition: none; }
}
/* Language navigation is crawlable on the prerendered locale routes. */
.language .lang__btn { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.lang__btn[aria-current='page'] { color:var(--ink); }
.product-identity>div { display:flex; flex-direction:column; gap:4px; }
.product-identity strong { font-size:15px; line-height:1.5; }
.product-identity small { font-size:11px; color:var(--muted); }
.product-hero-copy>.product-identity { margin-bottom:24px; }
/* The close control is outside the menu's content grid. */
.products-mega-inner { position:relative; padding-top:76px; }
.products-mega-close { position:absolute; top:16px; inset-inline-end:0; }
@media(min-width:1101px) {
  .products-mega-inner { grid-template-columns:190px minmax(0,1fr); gap:28px; }
  .products-mega-groups { grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
  .products-mega-card { padding:10px 6px; gap:9px; }
  .products-mega-card small { font-size:11px; }
  .products-mega-card>span:last-child { display:none; }
}
@media(max-width:960px) { .products-mega-inner { padding-top:76px; } }
/* Product identities occupy the introductory row of wide editorial heroes. */
.exp-pipelines-page .product-hero-copy>.product-identity,
.exp-quiver .product-hero-copy>.product-identity,
.exp-compass-page .product-hero-copy>.product-identity,
.exp-map .product-hero-copy>.product-identity { grid-column:1/-1; }
.exp-logic .product-hero-copy>.product-identity { justify-content:center; }
/* Desktop menu follows the page container and floats above its content. */
.products-mega-close { width:44px; height:44px; padding:10px; }
@media(min-width:961px) {
  .products-mega { width:min(var(--shell),calc(100% - 112px)); margin-inline:auto; top:calc(100% + 8px); border:1px solid var(--line); border-radius:8px; max-height:calc(100dvh - 110px); box-shadow:0 24px 64px #00000040,0 5px 18px #00000024; }
  .products-mega>.shell { width:calc(100% - 48px); }
  html[data-theme='light'] .products-mega { box-shadow:0 24px 64px #20321b24,0 5px 18px #20321b12; }
}
@media(min-width:961px) and (max-width:1180px) {
  .products-mega { width:calc(100% - 64px); }
}
