/* Impact Logistic: lightweight rendering for the shared mobile header.
 * Loaded last from includes/pwa-head.php so page-specific skins keep their
 * colors while expensive effects are consistently reduced on weak devices.
 */

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  body.theme-premium .topbar.glass-panel,
  body.theme-premium .topbar.topbar-actions-only.glass-panel {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    box-shadow:
      0 7px 18px rgba(0, 8, 20, .22),
      inset 0 1px 0 rgba(255, 255, 255, .07) !important;
  }

  body.theme-premium .topbar.glass-panel::before,
  body.theme-premium .topbar.glass-panel::after,
  body.theme-premium .topbar.topbar-actions-only.glass-panel::before,
  body.theme-premium .topbar.topbar-actions-only.glass-panel::after {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  body.theme-premium .topbar .topbar-brand-logo,
  body.theme-premium .topbar .topbar-brand-wordmark {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  body.theme-premium .topbar .top-actions {
    scroll-behavior: auto !important;
    scroll-snap-type: none !important;
    scrollbar-width: none !important;
    touch-action: manipulation !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.theme-premium .topbar .top-actions::-webkit-scrollbar {
    display: none !important;
  }

  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip) {
    animation: none !important;
    transition: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    transform: none !important;
    will-change: auto !important;
    backface-visibility: visible !important;
    box-shadow:
      0 3px 8px rgba(0, 8, 20, .20),
      inset 0 1px 0 rgba(255, 255, 255, .16) !important;
  }

  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip)::before,
  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip)::after,
  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip) :is(img, svg, span)::before,
  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip) :is(img, svg, span)::after {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn, .user-chip.user-chip) :is(img, svg) {
    animation: none !important;
    transition: none !important;
    filter: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  body.theme-premium .topbar.topbar-actions-only .top-actions > :is(a.nav-link.nav-link, .ghost-btn.ghost-btn):active {
    transform: translateY(1px) !important;
    box-shadow:
      0 1px 3px rgba(0, 8, 20, .20),
      inset 0 2px 5px rgba(0, 8, 20, .26),
      inset 0 1px 0 rgba(255, 255, 255, .10) !important;
  }
}

/* During an active gesture remove the remaining large header shadow. The
 * performance.js helper changes this class only at gesture start/end, not on
 * every scroll frame. */
html.impact-is-scrolling body.theme-premium .topbar.glass-panel,
html.impact-is-scrolling body.theme-premium .topbar.topbar-actions-only.glass-panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05) !important;
}

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