.afps-ajax-loader {
  position: fixed;
  z-index: 1000001;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  min-width: 132px;
  max-width: calc(100vw - 32px);
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  color: #fff;
  background: #122b68;
  box-shadow: 0 14px 36px rgba(15, 35, 82, .28);
  font: 700 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  visibility: hidden;
}

.admin-bar .afps-ajax-loader { top: max(46px, calc(env(safe-area-inset-top) + 14px)); }
.afps-ajax-loader.is-active { opacity: 1; transform: translate(-50%, 0); visibility: visible; }

.afps-ajax-loader__spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  box-sizing: border-box;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: afps-ajax-loader-spin .68s linear infinite;
}

.afps-ajax-loader__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afps-ajax-loader__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #f2bd32 0 32%, #fff 50%, #f2bd32 68% 100%);
  background-size: 220% 100%;
  animation: afps-ajax-loader-bar 1.05s ease-in-out infinite;
}

@keyframes afps-ajax-loader-spin { to { transform: rotate(360deg); } }
@keyframes afps-ajax-loader-bar { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 782px) {
  .admin-bar .afps-ajax-loader { top: max(60px, calc(env(safe-area-inset-top) + 14px)); }
}

@media (prefers-reduced-motion: reduce) {
  .afps-ajax-loader { transition: none; }
  .afps-ajax-loader__spinner,
  .afps-ajax-loader__bar { animation-duration: 2.4s; }
}
