/* ============================================================================
 * components/header-products.css — shared ForceX product header navigation
 * ============================================================================
 * Rendered/enhanced by: /assets/js/components/fx-header.js
 * Shared by: fx-web, fx-xplorer, fx-xamine
 * ========================================================================== */

.fx-header__actions {
  position: relative;
}

.fx-product-nav {
  gap: var(--space-6);
  justify-self: end;
  margin-left: auto;
}

.fx-product-nav__item {
  position: relative;
}

.fx-product-nav__item::after {
  content: "";
  height: 18px;
  left: -12px;
  position: absolute;
  right: -12px;
  top: 100%;
}

.fx-product-nav__button {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted2);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  gap: 5px;
  padding: var(--space-2) 0;
  transition: color var(--motion-fast) var(--easing-base);
}

.fx-product-nav__button::after {
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
  border-top: 4px solid transparent;
  content: "";
  display: inline-block;
  opacity: 0.72;
  transform: rotate(90deg);
}

.fx-header a:hover,
.fx-header a:focus-visible,
.fx-header summary:hover,
.fx-header summary:focus-visible {
  text-decoration: none;
}

.fx-product-nav__item:hover .fx-product-nav__button,
.fx-product-nav__item:focus-within .fx-product-nav__button {
  color: var(--text);
}

.fx-product-nav__mega {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 44%),
    var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: none;
  gap: var(--space-3);
  left: auto;
  padding: var(--space-2);
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 80;
}

.fx-product-nav__item:hover .fx-product-nav__mega,
.fx-product-nav__item:focus-within .fx-product-nav__mega {
  display: grid;
}

.fx-product-nav__mega--products {
  grid-template-columns: repeat(3, minmax(178px, 1fr));
  width: min(680px, calc(100vw - 48px));
}

.fx-product-nav__mega--about {
  grid-template-columns: 1fr;
  min-width: 300px;
}

.fx-product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  display: grid;
  min-height: 150px;
  overflow: hidden;
  padding: var(--space-4);
  position: relative;
  text-decoration: none;
}

.fx-product-card::before,
.fx-product-card::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.fx-product-card::before {
  opacity: 0.62;
  z-index: 0;
}

.fx-product-card::after {
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.24) 100%),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(148, 163, 184, 0.08) 15px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(148, 163, 184, 0.05) 23px);
  opacity: 0.7;
  z-index: 1;
}

.fx-product-card--xplorer::before {
  background:
    radial-gradient(circle at 78% 18%, rgba(96, 165, 250, 0.42), transparent 31%),
    linear-gradient(135deg, rgba(30, 64, 175, 0.28), rgba(15, 23, 42, 0.18));
}

.fx-product-card--xamine::before {
  background:
    radial-gradient(circle at 75% 18%, rgba(255, 195, 42, 0.36), transparent 31%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.24), rgba(15, 23, 42, 0.16));
}

.fx-product-card--xtract::before {
  background:
    radial-gradient(circle at 78% 18%, rgba(167, 139, 250, 0.38), transparent 31%),
    linear-gradient(135deg, rgba(88, 28, 135, 0.24), rgba(15, 23, 42, 0.16));
}

.fx-product-card > * {
  position: relative;
  z-index: 2;
}

.fx-product-card__eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.fx-product-card strong {
  align-self: end;
  font-size: var(--text-lg);
  line-height: 1.15;
}

.fx-product-card span:last-child {
  color: var(--muted2);
  font-size: var(--text-xs);
  line-height: 1.45;
  max-width: 19ch;
}

.fx-product-card:hover {
  border-color: rgba(96, 165, 250, 0.55);
  text-decoration: none;
}

.fx-product-card--disabled,
.fx-about-link--disabled {
  cursor: default;
  opacity: 0.54;
}

.fx-product-card--disabled:hover {
  border-color: var(--border);
}

.fx-about-link {
  border-radius: var(--radius-sm);
  color: var(--text);
  display: grid;
  gap: 3px;
  padding: var(--space-3);
  text-decoration: none;
}

.fx-about-link:hover {
  background: var(--surface2);
  text-decoration: none;
}

.fx-about-link span {
  font-size: var(--text-sm);
  font-weight: 700;
}

.fx-about-link small {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.fx-mobile-products {
  display: none;
  flex: 0 0 auto;
  line-height: 0;
  position: relative;
}

.fx-mobile-products__button {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--muted2);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  list-style: none;
  padding: 0;
  position: relative;
  transition:
    background var(--motion-fast) var(--easing-base),
    border-color var(--motion-fast) var(--easing-base),
    color var(--motion-fast) var(--easing-base);
  width: 36px;
}

.fx-mobile-products__button:hover,
.fx-mobile-products[open] .fx-mobile-products__button {
  border-color: var(--accent-lt);
  color: var(--text);
}

.fx-mobile-products__button::-webkit-details-marker {
  display: none;
}

.fx-mobile-products__button::marker {
  content: "";
}

.fx-mobile-products__button span {
  background: currentColor;
  border-radius: 999px;
  display: block;
  height: 2px;
  position: absolute;
  transform-origin: center;
  transition:
    opacity var(--motion-fast) var(--easing-base),
    transform var(--motion-fast) var(--easing-base);
  width: 16px;
}

.fx-mobile-products__button span:nth-child(1) {
  transform: translateY(-5px);
}

.fx-mobile-products__button span:nth-child(3) {
  transform: translateY(5px);
}

.fx-mobile-products[open] .fx-mobile-products__button span:nth-child(1) {
  transform: rotate(45deg);
}

.fx-mobile-products[open] .fx-mobile-products__button span:nth-child(2) {
  opacity: 0;
}

.fx-mobile-products[open] .fx-mobile-products__button span:nth-child(3) {
  transform: rotate(-45deg);
}

.fx-mobile-products__menu {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: var(--space-2);
  min-width: min(300px, calc(100vw - 32px));
  padding: var(--space-3);
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 120;
}

.fx-mobile-products__link {
  border-radius: var(--radius-sm);
  color: var(--text);
  display: grid;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
}

.fx-mobile-products__link:hover {
  background: var(--surface2);
  text-decoration: none;
}

.fx-mobile-products__link strong {
  font-size: var(--text-sm);
  line-height: 1.2;
}

.fx-mobile-products__link span {
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.fx-mobile-products__link--disabled {
  cursor: default;
  opacity: 0.54;
}

:root[data-theme="light"] .fx-product-nav__mega {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.03), transparent 48%),
    var(--surface);
}

:root[data-theme="light"] .fx-product-card::after {
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.64) 100%),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(15, 23, 42, 0.06) 15px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(15, 23, 42, 0.04) 23px);
}

@media (max-width: 800px) {
  .fx-product-nav {
    display: none;
  }

  .fx-mobile-products {
    display: block;
  }

  /* Full-width fixed dropdown on mobile so it never clips off the viewport
   * and gives long product descriptions room to wrap. Pinned to viewport
   * (not the parent) below the header so width is always exactly 100vw. */
  .fx-mobile-products__menu {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    min-width: 0;
    max-width: none;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--border2);
    border-radius: 0;
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-lg);
  }
}
