
/* === Scoped Nav & Sticky Fallback (.tx-header) - Modernized === */
.tx-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  box-sizing: border-box;
  background: rgba(10,14,26,.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  transform: translateZ(0);
  will-change: transform;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tx-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(108,140,255,.05) 0%, transparent 100%);
  pointer-events: none;
}
.is-fixed .tx-header { 
  position: fixed !important; 
  left: 0; 
  right: 0; 
  background: rgba(10,14,26,.85);
}

/* Prevent ancestors from breaking sticky */
.sticky-fix-parent { overflow: visible !important; }

/* Body scroll lock compatibility - Enhanced */
body.noscroll, body.nav-open {
  position: fixed;
  overflow: hidden;
  width: 100%;
  padding-right: 0;
}

/* Mobile mega accordion only on small screens - Modern Animations */
@media (max-width: 992px) {
  .tx-header .has-mega > .mega { 
    display: none; 
    animation: slideDown .3s ease-out;
  }
  .tx-header .has-mega.open > .mega { 
    display: block; 
    animation: slideDown .3s ease-out;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  /* In case theme doesn't hide menu by default, keep a safe collapse */
  #mainmenu.menu:not(.is-open):not(.open) { 
    max-height: 0; 
    opacity: 0; 
    overflow: hidden; 
    transition: max-height .3s ease, opacity .3s ease;
  }
  #mainmenu.menu.is-open, #mainmenu.menu.open { 
    max-height: 85vh; 
    opacity: 1; 
    transition: max-height .3s ease, opacity .3s ease;
  }
}

/* Avoid double scrollbars on iOS */
@supports (-webkit-touch-callout: none) {
  body.noscroll, body.nav-open { position: fixed; }
}

/* Modern Scrollbar Styles */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(10,14,26,.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(108,140,255,.4);
  border-radius: 10px;
  border: 2px solid rgba(10,14,26,.5);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(108,140,255,.6);
}
