/**
 * ALGORIZMS™ PRODUCT HEADER & DROPDOWN UNIVERSAL LOCK (v1.0)
 * Enforces 100% Option 1 Universal Architecture visual parity across all 22
 * EN & AR Products Lab pages, neutralizing legacy inline <style> overrides,
 * Tailwind resets, and mobile CSS drift. Must load LAST before </head>.
 */

header#product-site-header.hud-header.product-site-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1200 !important;
  box-sizing: border-box !important;
  background: rgba(6, 9, 19, 0.90) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(252, 211, 77, 0.16) !important;
}

header#product-site-header .product-header-inner {
  max-width: 1720px !important;
  margin: 0 auto !important;
  padding: 10px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  box-sizing: border-box !important;
}

header#product-site-header #product-identity-group,
header#product-site-header .product-topbar-right {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

/* LEFT AXIS LOCK: Command Cockpit Dropdown (#brand-cockpit-dropdown) */
header#product-site-header #product-identity-group .brand-cockpit-dropdown {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  left: 0 !important;
  right: auto !important;
  width: 340px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: min(82vh, 660px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 16px !important;
  border-radius: 18px !important;
  background: rgba(13, 10, 8, 0.98) !important;
  border: 1px solid rgba(252, 211, 77, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(252, 211, 77, 0.14) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  color: #FAF8F4 !important;
  text-align: left !important;
  direction: ltr !important;
  box-sizing: border-box !important;
  z-index: 10050 !important;
  display: block !important;
}

html[dir="rtl"] header#product-site-header #product-identity-group .brand-cockpit-dropdown,
[dir="rtl"] header#product-site-header #product-identity-group .brand-cockpit-dropdown {
  right: 0 !important;
  left: auto !important;
  text-align: right !important;
  direction: rtl !important;
  font-family: 'Noto Kufi Arabic', 'Alexandria', sans-serif !important;
}

/* RIGHT AXIS LOCK: Sovereign Ankh & User Dropdown (#user-sovereign-dropdown) */
header#product-site-header .product-topbar-right .user-sovereign-dropdown {
  position: absolute !important;
  top: calc(100% + 12px) !important;
  right: 0 !important;
  left: auto !important;
  width: min(340px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: min(82vh, 660px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 15px !important;
  border-radius: 18px !important;
  background: rgba(9, 13, 24, 0.995) !important;
  border: 1px solid rgba(252, 211, 77, 0.32) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.96), 0 0 28px rgba(252, 211, 77, 0.14) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  color: #FAF8F4 !important;
  text-align: left !important;
  direction: ltr !important;
  box-sizing: border-box !important;
  z-index: 10050 !important;
}

header#product-site-header .user-sovereign-dropdown .user-dropdown-auth-view,
header#product-site-header .user-sovereign-dropdown .user-dropdown-guest-view {
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

header#product-site-header .user-sovereign-dropdown .user-fast-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

header#product-site-header .user-sovereign-dropdown .user-handle-tier {
  flex-wrap: wrap !important;
  gap: 6px !important;
}

header#product-site-header .user-sovereign-dropdown .user-tier-badge {
  white-space: nowrap !important;
  width: fit-content !important;
}

header#product-site-header .user-sovereign-dropdown .user-feedback-ops-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  direction: inherit !important;
}

header#product-site-header .user-sovereign-dropdown .cockpit-feedback-grid {
  display: inline-flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  direction: inherit !important;
}

html[dir="rtl"] header#product-site-header .product-topbar-right .user-sovereign-dropdown,
[dir="rtl"] header#product-site-header .product-topbar-right .user-sovereign-dropdown {
  left: 0 !important;
  right: auto !important;
  text-align: right !important;
  direction: rtl !important;
  font-family: 'Noto Kufi Arabic', 'Alexandria', sans-serif !important;
}

/* Visibility Lock across all engines */
header#product-site-header #product-identity-group .brand-cockpit-dropdown:not(.is-visible):not(.active),
header#product-site-header .product-topbar-right .user-sovereign-dropdown:not(.is-visible):not(.active) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-10px) scale(0.98) !important;
}

header#product-site-header #product-identity-group .brand-cockpit-dropdown.is-visible,
header#product-site-header #product-identity-group .brand-cockpit-dropdown.active,
header#product-site-header .product-topbar-right .user-sovereign-dropdown.is-visible,
header#product-site-header .product-topbar-right .user-sovereign-dropdown.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Light / Marble-Bling Theme Parity */
[data-theme="marble-bling"] header#product-site-header.hud-header.product-site-header,
[data-theme="light"] header#product-site-header.hud-header.product-site-header,
body.light-theme header#product-site-header.hud-header.product-site-header {
  background: rgba(255, 252, 247, 0.94) !important;
  border-bottom-color: rgba(217, 119, 6, 0.28) !important;
}

[data-theme="marble-bling"] header#product-site-header .brand-cockpit-dropdown,
[data-theme="light"] header#product-site-header .brand-cockpit-dropdown,
body.light-theme header#product-site-header .brand-cockpit-dropdown,
[data-theme="marble-bling"] header#product-site-header .user-sovereign-dropdown,
[data-theme="light"] header#product-site-header .user-sovereign-dropdown,
body.light-theme header#product-site-header .user-sovereign-dropdown {
  background: rgba(255, 252, 247, 0.98) !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  color: #0F172A !important;
}

/* Document-level header direction lock (blocks inline body direction drift) */
html[dir="ltr"] header#product-site-header.hud-header.product-site-header,
html[lang="en"] header#product-site-header.hud-header.product-site-header {
  direction: ltr !important;
}

html[dir="rtl"] header#product-site-header.hud-header.product-site-header,
html[lang="ar"] header#product-site-header.hud-header.product-site-header {
  direction: rtl !important;
}

/* AR RTL User Profile Header: Avatar on LEFT, Name & @handle aligned next to photo */
html[dir="rtl"] header#product-site-header .user-dropdown-header.user-header-link,
[dir="rtl"] header#product-site-header .user-dropdown-header.user-header-link,
html[lang="ar"] header#product-site-header .user-dropdown-header.user-header-link {
  direction: ltr !important;
  justify-content: flex-start !important;
}

html[dir="rtl"] header#product-site-header .user-dropdown-header .user-header-avatar,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-header-avatar,
html[lang="ar"] header#product-site-header .user-dropdown-header .user-header-avatar {
  order: 1 !important;
}

html[dir="rtl"] header#product-site-header .user-dropdown-header .user-header-info,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-header-info,
html[lang="ar"] header#product-site-header .user-dropdown-header .user-header-info {
  order: 2 !important;
  align-items: flex-start !important;
  text-align: left !important;
}

html[dir="rtl"] header#product-site-header .user-dropdown-header .user-display-name,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-display-name,
html[lang="ar"] header#product-site-header .user-dropdown-header .user-display-name,
html[dir="rtl"] header#product-site-header .user-dropdown-header .user-handle-tier,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-handle-tier,
html[lang="ar"] header#product-site-header .user-dropdown-header .user-handle-tier {
  justify-content: flex-start !important;
}

html[dir="rtl"] header#product-site-header .user-dropdown-header #user-display-name-text,
html[dir="rtl"] header#product-site-header .user-dropdown-header .user-display-name > span:not(.user-pass-tier-ankh),
html[dir="rtl"] header#product-site-header .user-dropdown-header #user-handle-text,
html[dir="rtl"] header#product-site-header .user-dropdown-header .user-handle,
[dir="rtl"] header#product-site-header .user-dropdown-header #user-display-name-text,
[dir="rtl"] header#product-site-header .user-dropdown-header #user-handle-text {
  order: 1 !important;
  text-align: left !important;
}

html[dir="rtl"] header#product-site-header .user-dropdown-header .user-pass-tier-ankh,
html[dir="rtl"] header#product-site-header .user-dropdown-header .user-tier-badge,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-pass-tier-ankh,
[dir="rtl"] header#product-site-header .user-dropdown-header .user-tier-badge {
  order: 2 !important;
}

/* Cockpit Action Text Alignment & Verified Brand Icon Uniformity */
header#product-site-header .cockpit-action-item {
  text-align: left !important;
}

html[dir="rtl"] header#product-site-header .cockpit-action-item,
[dir="rtl"] header#product-site-header .cockpit-action-item {
  text-align: right !important;
}

header#product-site-header .cockpit-action-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0 !important;
}

header#product-site-header .cockpit-verified-icon,
.cockpit-verified-icon {
  width: 22px !important;
  height: 22px !important;
  object-fit: contain !important;
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.gateway-hint-icon {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
  display: block !important;
}

.notif-verified-icon {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
  display: block !important;
}

/* Neutralize Tailwind button/link resets inside dropdown slots */
header#product-site-header .brand-cockpit-dropdown button,
header#product-site-header .user-sovereign-dropdown button {
  font-family: inherit;
  line-height: normal;
}

@media (max-width: 768px) {
  header#product-site-header .product-header-inner {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  header#product-site-header #product-identity-group .brand-cockpit-dropdown,
  header#product-site-header .product-topbar-right .user-sovereign-dropdown {
    width: calc(100vw - 24px) !important;
    max-width: 320px !important;
  }
}

/* ==========================================================================
   ALGORIZMS MASTER TYPOGRAPHY ARCHITECTURE LOCK (EN & AR)
   Standard:
   - EN Titles: Pasajero Complete
   - EN Taglines & Stages: Bebas Neue
   - AR Titles: Cairo Bold (700/800/900)
   - AR Taglines: Alexandria
   - AR Stages: Cairo Bold / Alexandria
   ========================================================================== */
html[dir="ltr"] header#product-site-header .product-wordmark,
html[lang="en"] header#product-site-header .product-wordmark {
  font-family: 'Pasajero Complete', 'Pasajero', 'Space Grotesk', sans-serif !important;
  letter-spacing: 0.04em !important;
}

html[dir="ltr"] header#product-site-header .product-tagline,
html[lang="en"] header#product-site-header .product-tagline {
  font-family: 'Bebas Neue', 'Base', sans-serif !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

html[dir="ltr"] header#product-site-header .sts-stage-node,
html[lang="en"] header#product-site-header .sts-stage-node {
  font-family: 'Bebas Neue', 'Space Grotesk', sans-serif !important;
  font-size: 0.88rem !important;
  letter-spacing: 0.03em !important;
}

html[dir="rtl"] header#product-site-header .product-wordmark,
html[lang="ar"] header#product-site-header .product-wordmark {
  font-family: 'Cairo', sans-serif !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
}

html[dir="rtl"] header#product-site-header .product-tagline,
html[lang="ar"] header#product-site-header .product-tagline {
  font-family: 'Alexandria', sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.74rem !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

html[dir="rtl"] header#product-site-header .sts-stage-node,
html[lang="ar"] header#product-site-header .sts-stage-node {
  font-family: 'Cairo', 'Alexandria', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
}

/* ── RTL Stage Navigation Arrows Flow Lock ────────────────────────────────── */
html[dir="rtl"] .sts-pipeline-container,
[dir="rtl"] .sts-pipeline-container {
  direction: rtl !important;
}

/* ── Center Filter Tabs Mode (Non-numbered capsules, no arrows, no connectors) ── */
.sts-pipeline-container[data-pipeline-mode="filter-tabs"],
.sts-pipeline-container.filter-tabs-mode {
  gap: 6px !important;
  padding: 4px 10px !important;
}

.sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-stage-arrow,
.sts-pipeline-container.filter-tabs-mode .sts-stage-arrow {
  display: none !important;
}

.sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-pipeline-conn,
.sts-pipeline-container.filter-tabs-mode .sts-pipeline-conn {
  display: none !important;
}

.sts-pipeline-container[data-pipeline-mode="filter-tabs"] .cmd-stage-badge,
.sts-pipeline-container.filter-tabs-mode .cmd-stage-badge {
  display: none !important;
}

.sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-stage-node,
.sts-pipeline-container.filter-tabs-mode .sts-stage-node {
  padding: 5px 14px !important;
  border-radius: 999px !important;
  font-size: 0.88rem !important;
  gap: 4px !important;
}

html[dir="rtl"] .sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-stage-node,
[dir="rtl"] .sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-stage-node,
html[dir="rtl"] .sts-pipeline-container.filter-tabs-mode .sts-stage-node,
[dir="rtl"] .sts-pipeline-container.filter-tabs-mode .sts-stage-node,
html[lang="ar"] .sts-pipeline-container[data-pipeline-mode="filter-tabs"] .sts-stage-node,
html[lang="ar"] .sts-pipeline-container.filter-tabs-mode .sts-stage-node {
  font-family: 'Cairo', 'Alexandria', sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 5px 14px !important;
}

/* ── Contextual Notifications Dual-Tab Switcher Universal Lock ───────────── */
.notif-context-tabs {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  margin-bottom: 7px !important;
}

.notif-tab-btn {
  flex: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 5px 8px !important;
  font-family: inherit !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  color: #A8A29E !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.notif-tab-btn:hover {
  color: #FAF8F4 !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.notif-tab-btn.is-active {
  color: #FCD34D !important;
  background: rgba(252, 211, 77, 0.12) !important;
  border-color: rgba(252, 211, 77, 0.35) !important;
  box-shadow: 0 0 10px rgba(252, 211, 77, 0.15) !important;
}

.notif-tab-icon {
  font-size: 0.72rem !important;
  line-height: 1 !important;
}

.notif-tab-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 15px !important;
  height: 15px !important;
  padding: 0 4px !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.54rem !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #FAF8F4 !important;
}

.notif-tab-btn.is-active .notif-tab-badge {
  background: #FCD34D !important;
  color: #060913 !important;
}

.notif-product-tag {
  display: inline-block !important;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 0.52rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 1px 5px !important;
  margin-inline-end: 5px !important;
  border-radius: 4px !important;
  background: rgba(2, 132, 199, 0.18) !important;
  border: 1px solid rgba(2, 132, 199, 0.35) !important;
  color: #38BDF8 !important;
  vertical-align: middle !important;
}
