/* Premium navigation drawer — Teravex Market (2026) */

#root nav.fixed [class*="md:hidden"][class*="pb-4"],
#root nav.fixed .md\:hidden.pb-4 {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#ir-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  z-index: 1000010;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
}

#ir-nav-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto !important;
}

#ir-nav-overlay:not(.open) {
  pointer-events: none !important;
}

#ir-gesture-shield {
  position: fixed;
  inset: 0;
  z-index: 1000030;
  display: none;
  background: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

#ir-gesture-shield.is-on {
  display: block;
}

#ir-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(100%, 380px);
  max-width: 100vw;
  height: auto;
  max-height: none;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(139, 124, 255, 0.12) 0%, transparent 55%),
    linear-gradient(165deg, #0c0c10 0%, #050506 48%, #000000 100%);
  border-left: 1px solid rgba(240, 240, 250, 0.1);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.55);
  z-index: 1000020;
  display: flex;
  flex-direction: column;
  transform: translate3d(104%, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.35s;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) 0;
  box-sizing: border-box;
  overflow: hidden;
  will-change: transform;
  font-family: var(--ir-font, 'D-DIN', 'Arial Narrow', Arial, sans-serif);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 430px) {
  #ir-nav-drawer {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    border-left: none;
  }
}

#ir-nav-drawer.open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}

#ir-nav-drawer .ir-drawer-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  padding: 0 0 max(0.85rem, env(safe-area-inset-bottom, 0px));
}

#ir-nav-drawer.open a[href],
#ir-nav-drawer.open button {
  pointer-events: auto;
  touch-action: manipulation;
}

#ir-nav-drawer,
#ir-nav-drawer * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#ir-nav-drawer .ir-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  touch-action: manipulation;
  padding:
    1rem
    max(1.15rem, env(safe-area-inset-right, 0px))
    0.85rem
    1.15rem;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(240, 240, 250, 0.08);
  box-sizing: border-box;
}

#ir-nav-drawer .ir-drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 0.35rem;
}

#ir-nav-drawer .ir-drawer-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}

#ir-nav-drawer .ir-drawer-brand-copy {
  min-width: 0;
}

#ir-nav-drawer .ir-drawer-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: #f0f0fa;
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
}

#ir-nav-drawer .ir-drawer-tagline {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(240, 240, 250, 0.48);
}

#ir-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(240, 240, 250, 0.14);
  border-radius: 12px;
  background: rgba(240, 240, 250, 0.04);
  color: #f0f0fa;
  cursor: pointer;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#ir-drawer-close::before {
  content: '';
  position: absolute;
  inset: -12px;
}

#ir-drawer-close:hover {
  background: rgba(240, 240, 250, 0.08);
  border-color: rgba(240, 240, 250, 0.22);
}

#ir-drawer-close span {
  position: absolute;
  width: 14px;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  pointer-events: none;
}

#ir-drawer-close span:first-child {
  transform: rotate(45deg);
}

#ir-drawer-close span:last-child {
  transform: rotate(-45deg);
}

#ir-nav-drawer .ir-drawer-links {
  list-style: none;
  margin: 0;
  padding: 0.85rem 1rem 0.35rem;
  flex: 0 0 auto;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#ir-nav-drawer .ir-drawer-item {
  list-style: none;
  margin: 0;
}

#ir-nav-drawer a.ir-drawer-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  min-height: max(3.25rem, 44px);
  pointer-events: auto;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(240, 240, 250, 0.08);
  background: rgba(240, 240, 250, 0.03);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#ir-nav-drawer a.ir-drawer-nav-card:hover,
#ir-nav-drawer a.ir-drawer-nav-card:focus-visible {
  background: rgba(240, 240, 250, 0.07);
  border-color: rgba(240, 240, 250, 0.16);
}

#ir-nav-drawer a.ir-drawer-nav-card:active {
  transform: scale(0.99);
}

#ir-nav-drawer a.ir-drawer-nav-card.is-active {
  border-color: rgba(139, 124, 255, 0.45);
  background: linear-gradient(135deg, rgba(139, 124, 255, 0.14), rgba(12, 12, 15, 0.92));
}

#ir-nav-drawer .ir-drawer-nav-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  text-align: left;
}

#ir-nav-drawer .ir-drawer-nav-label {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #f0f0fa;
  line-height: 1.25;
}

#ir-nav-drawer .ir-drawer-nav-hint {
  font-size: 0.74rem;
  font-weight: 450;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(240, 240, 250, 0.52);
  line-height: 1.35;
}

#ir-nav-drawer .ir-drawer-nav-chevron {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-right: 1.5px solid rgba(240, 240, 250, 0.45);
  border-bottom: 1.5px solid rgba(240, 240, 250, 0.45);
  transform: rotate(-45deg);
  margin-right: 0.1rem;
}

/* Portfolio entry card */
#ir-nav-drawer .ir-drawer-portfolio-entry {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.35rem 1rem 0;
}

#ir-nav-drawer a.ir-drawer-portfolio-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(139, 124, 255, 0.38);
  background: linear-gradient(135deg, rgba(139, 124, 255, 0.18), rgba(8, 8, 12, 0.95));
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

#ir-nav-drawer a.ir-drawer-portfolio-btn:hover {
  border-color: rgba(139, 124, 255, 0.55);
  transform: translateY(-1px);
}

#ir-nav-drawer .ir-drawer-portfolio-btn-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  background: rgba(139, 124, 255, 0.22);
  color: #c4b8ff;
}

#ir-nav-drawer .ir-drawer-portfolio-btn-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  min-width: 0;
  flex: 1;
}

#ir-nav-drawer .ir-drawer-portfolio-btn-label {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f0f0fa;
  line-height: 1.25;
}

#ir-nav-drawer .ir-drawer-portfolio-btn-desc {
  font-size: 0.74rem;
  color: rgba(240, 240, 250, 0.58);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

#ir-nav-drawer .ir-drawer-account {
  padding: 0.65rem 1rem 0.35rem;
  flex-shrink: 0;
}

#ir-nav-drawer .ir-drawer-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 69, 58, 0.38);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.12), rgba(12, 8, 8, 0.95));
  color: #ff8a82;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

#ir-nav-drawer .ir-drawer-logout:hover {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.18), rgba(12, 8, 8, 0.98));
  border-color: rgba(255, 69, 58, 0.55);
}

#ir-nav-drawer .ir-drawer-logout:active {
  transform: scale(0.99);
}

#ir-nav-drawer .ir-drawer-footer {
  margin: 0;
  padding: 0.85rem 1.15rem 1.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: rgba(240, 240, 250, 0.38);
  flex-shrink: 0;
}

html.ir-nav-open,
body.ir-nav-open {
  overflow: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.ir-nav-open {
  left: 0 !important;
  right: 0 !important;
}

/* The drawer is mounted on the document element, so the support page can
   stay viewport-locked. Growing the body to auto height opened a document
   scrollbar that covered the right edge of the menu. */
html.support-standalone-active body.support-page.ir-nav-open,
html.beneficiary-standalone-active body.ir-nav-open {
  position: static !important;
  top: auto !important;
  height: 100svh !important;
  max-height: 100svh !important;
  overflow: hidden !important;
}

/* Menu trigger — premium outline control */
.ir-static-menu-btn,
#root nav.fixed button.ir-react-menu-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(240, 240, 250, 0.14);
  border-radius: 12px;
  background: rgba(240, 240, 250, 0.04);
  color: #f0f0fa;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ir-static-menu-btn:hover,
#root nav.fixed button.ir-react-menu-btn:hover {
  background: rgba(240, 240, 250, 0.08);
  border-color: rgba(240, 240, 250, 0.22);
}

.ir-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 18px;
  height: 14px;
}

.ir-burger span {
  display: block;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#root nav.fixed button.ir-react-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(1),
.ir-static-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

#root nav.fixed button.ir-react-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(2),
.ir-static-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#root nav.fixed button.ir-react-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(3),
.ir-static-menu-btn[aria-expanded="true"] .ir-burger span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Legacy portfolio fold — retired */
.ir-drawer-portfolio,
.ir-drawer-portfolio-links,
.ir-drawer-portfolio-toggle {
  display: none !important;
}
