/* UA PANEL MOTION V1
 * Drop-in visual layer for portal.html.
 * No inline handlers are replaced. All motion has a reduced-motion escape hatch.
 */

:root {
  --ua-orange-1: #ff8a4c;
  --ua-orange-2: #d84b1d;
  --ua-orange-3: #8e2e12;
  --ua-cyan: #73d6c0;
  --ua-gold: #f7d47a;
  --ua-header-shadow: 0 14px 42px rgba(0, 0, 0, .22);
}

/* Keep the compact top strip distinct from the primary navigation. */
.topbar {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(17, 24, 22, .98), rgba(25, 34, 31, .94) 52%, rgba(17, 24, 22, .98));
  border-bottom-color: var(--line);
}

@supports (color: color-mix(in srgb, white, black)) {
  .topbar { border-bottom-color: color-mix(in srgb, var(--line) 78%, var(--ua-orange-2)); }
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 93, 42, .34), transparent);
  pointer-events: none;
}

header {
  isolation: isolate;
  box-shadow: var(--ua-header-shadow);
  border-bottom-color: var(--line);
  background:
    linear-gradient(180deg, rgba(20, 29, 26, .95), rgba(14, 21, 19, .90));
}

@supports (color: color-mix(in srgb, white, black)) {
  header { border-bottom-color: color-mix(in srgb, var(--line) 72%, var(--ua-orange-2)); }
}

/* A quiet signal trace gives the panel a technical identity without flashing. */
header::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(232, 93, 42, .12) 18%,
    rgba(232, 93, 42, .92) 48%,
    rgba(115, 214, 192, .52) 62%,
    rgba(232, 93, 42, .12) 82%,
    transparent 100%);
  background-size: 220% 100%;
  opacity: .76;
  transform-origin: left center;
  animation: ua-signal-scan 8s linear infinite;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  min-height: 56px;
  gap: clamp(12px, 1.6vw, 24px);
}

/* Brand block: stronger silhouette and a restrained orange halo. */
.logo {
  position: relative;
  isolation: isolate;
  min-height: 40px;
  padding: 4px 8px 4px 4px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 138, 76, .08), transparent 58%);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.logo::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px 4px;
  border-radius: 12px;
  background: radial-gradient(circle, rgba(232, 93, 42, .20), transparent 70%);
  opacity: 0;
  filter: blur(9px);
  transition: opacity .2s ease;
  pointer-events: none;
}

.logo:hover,
.logo:focus-visible {
  border-color: rgba(232, 93, 42, .32);
  background-color: rgba(232, 93, 42, .07);
  transform: translateY(-1px);
}

.logo:hover::after,
.logo:focus-visible::after { opacity: 1; }

.logo-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 5px 12px rgba(185, 68, 24, .28));
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), filter .26s ease;
}
.logo-icon img { width: 100%; height: 100%; display: block; }
.logo-wordmark { font-weight: 800; letter-spacing: -.02em; }
.logo-lockup-image {
  display: block;
  width: 176px;
  height: auto;
  max-width: min(19vw, 176px);
  filter: drop-shadow(0 6px 16px rgba(185, 68, 24, .25));
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), filter .26s ease;
}
.logo:hover .logo-lockup-image,
.logo:focus-visible .logo-lockup-image {
  transform: translateY(-1px) scale(1.025);
  filter: drop-shadow(0 8px 18px rgba(232, 93, 42, .46));
}
.logo > .logo-lockup-image { background: none; }

.logo:hover .logo-icon,
.logo:focus-visible .logo-icon {
  transform: rotate(-3deg) scale(1.06);
  filter: drop-shadow(0 7px 16px rgba(232, 93, 42, .48));
}

.logo > :last-child {
  background: linear-gradient(110deg, #ffb078 0%, var(--ua-orange-1) 38%, #df5a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 22px rgba(232, 93, 42, .12);
}

/* Main navigation becomes a calm row of instrument controls. */
nav.main-nav {
  gap: 4px;
  justify-content: flex-start;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .045);
  border-radius: 15px;
  background: rgba(0, 0, 0, .11);
}

nav.main-nav a.nav-item {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
}

nav.main-nav a.nav-item::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ua-orange-1), var(--ua-cyan));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}

nav.main-nav a.nav-item:hover,
nav.main-nav a.nav-item:focus-visible {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(232, 93, 42, .16), rgba(232, 93, 42, .06));
  border-color: rgba(232, 93, 42, .28);
  box-shadow: 0 8px 18px -12px rgba(232, 93, 42, .92);
}

nav.main-nav a.nav-item:hover::after,
nav.main-nav a.nav-item:focus-visible::after,
nav.main-nav a.nav-item.active::after { transform: scaleX(1); }

nav.main-nav a.nav-item .nav-ico {
  transition: transform .22s ease, color .22s ease, opacity .22s ease;
}

nav.main-nav a.nav-item:hover .nav-ico,
nav.main-nav a.nav-item:focus-visible .nav-ico {
  transform: translateY(-1px) scale(1.08);
  opacity: 1;
}

/* Keep the important conversion action legible without a permanent glow. */
nav.main-nav a.nav-item-kb-featured {
  color: #fff3ed;
  background: linear-gradient(135deg, rgba(216, 75, 29, .86), rgba(143, 47, 18, .88));
  border-color: rgba(255, 171, 128, .28);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 6px 14px -10px rgba(232, 93, 42, .9);
}

nav.main-nav a.nav-item-kb-featured:hover,
nav.main-nav a.nav-item-kb-featured:focus-visible {
  background: linear-gradient(135deg, rgba(236, 101, 49, .98), rgba(164, 53, 19, .96));
  box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 10px 22px -12px rgba(232, 93, 42, 1);
}

nav.main-nav a.nav-item-kb-featured::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #9df0ce;
  box-shadow: 0 0 0 3px rgba(157, 240, 206, .14), 0 0 10px rgba(157, 240, 206, .7);
  animation: ua-live-dot 2.4s ease-in-out infinite;
}

/* The external layer is loaded after the legacy inline stylesheet, so keep the
 * intended compact breakpoints explicit here as well. */
@media (max-width: 1450px) {
  nav.main-nav a.nav-item { padding: 7px 8px; font-size: 12px; gap: 5px; }
}

@media (max-width: 1280px) {
  nav.main-nav a.nav-item { padding: 7px 7px; font-size: 11.5px; gap: 4px; }
  nav.main-nav a.nav-item .nav-ico { display: none; }
}

@media (max-width: 1140px) {
  nav.main-nav a.nav-item { padding: 6px 6px; font-size: 11px; }
  nav.main-nav .nav-badge { display: none; }
}

/* Actions read as one coherent control cluster. */
.header-actions {
  gap: 8px;
  padding-left: 4px;
}

.auth-header-btn,
.cart-btn,
.burger-btn {
  min-height: 38px;
  border-radius: 11px;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease,
    transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
}

.auth-header-btn:hover,
.auth-header-btn:focus-visible,
.cart-btn:hover,
.cart-btn:focus-visible,
.burger-btn:hover,
.burger-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(232, 93, 42, .44);
  background: rgba(232, 93, 42, .10);
  box-shadow: 0 7px 18px -12px rgba(232, 93, 42, .9);
}

.cart-btn { border: 1px solid transparent; }

/* A class can be added by cart code after a count change. */
.cart-btn.ua-cart-updated,
.floating-cart.ua-cart-updated {
  animation: ua-cart-pop .45s cubic-bezier(.2, .8, .2, 1);
}

.cart-badge {
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 2px rgba(232, 93, 42, .16), 0 3px 8px rgba(0, 0, 0, .35);
}

/* The quick row remains touch friendly, but gains a shared glass surface. */
.mobile-quicknav-row {
  background: rgba(17, 24, 22, .90);
  border-bottom-color: rgba(232, 93, 42, .20);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
}

.mobile-quicknav-row a:focus-visible { transform: translateY(-1px); }

/* Avoid accidental clipping of the focus ring on narrow screens. */
@media (max-width: 960px) {
  .header-inner { min-height: 52px; }
  .logo { padding-left: 2px; }
  .logo-icon { width: 36px; height: 36px; }
  .logo-lockup-image { width: 146px; max-width: 42vw; }
  .mobile-quicknav-row { top: 60px; }
}

@media (max-width: 430px) {
  .logo { gap: 6px !important; }
  .logo > :last-child { font-size: 14px !important; }
  .logo-icon { width: 32px; height: 32px; }
  .logo-lockup-image { width: 130px; max-width: 48vw; }
}

@keyframes ua-signal-scan {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

@keyframes ua-live-dot {
  0%, 100% { opacity: .72; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes ua-cart-pop {
  0% { transform: scale(1); }
  42% { transform: scale(1.13) rotate(-2deg); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
