/* Reusable loading layer shared by the admin panel and the storefronts.
   The overlay is a calm, centered spinner on a subtle blurred backdrop that
   fades in and out, so a slow round trip never leaves the user staring at a
   blank page and a quick fetch never flashes a spinner in their face.
   The skeleton helpers from skeleton.css do the per-section work; this file
   owns the full-screen fallback and the smooth visibility transitions. */

.ac-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 1;
  transition: opacity 0.28s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ac-loader-overlay-hidden {
  opacity: 0;
  pointer-events: none;
}

.ac-loader-card {
  min-width: 200px;
  max-width: 320px;
  padding: 24px 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  color: #334155;
}

.ac-loader-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  animation: ac-loader-spin 0.7s linear infinite;
}

.ac-loader-message {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

@keyframes ac-loader-spin {
  to { transform: rotate(360deg); }
}

/* Whole-grid fade used by the storefront the moment skeletons become products. */
.ac-grid-fade-in {
  animation: ac-grid-fade 0.28s ease;
}

@keyframes ac-grid-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .ac-loader-overlay,
  .ac-grid-fade-in {
    transition: none;
    animation: none;
  }
  .ac-loader-spinner {
    animation-duration: 1.6s;
  }
}