/**
 * Sockaki Loader — canonical `eyes` loading indicator.
 *
 * One shared SVG + one shared animation. No animation library, no GIF/video.
 */

.sk-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sk-space-2);
}

.sk-loader__eyes {
  display: inline-block;
  line-height: 0;
}

.sk-loader__eyes svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.sk-loader__label {
  color: var(--sk-text-muted);
  font-size: var(--sk-fs-sm);
  font-weight: var(--sk-fw-medium);
}

/* Pupil animation — both eyes glance together, restrained. */
.sk-loader__eyes .sk-eyes__pupil {
  transform-box: view-box;
  transform-origin: center;
  animation: sk-eyes-glance 900ms ease-in-out infinite;
}

@keyframes sk-eyes-glance {
  0%, 100% { transform: translate(0, 0); }
  20%      { transform: translate(4px, 0); }
  40%      { transform: translate(-4px, 0); }
  60%      { transform: translate(2px, -3px); }
  80%      { transform: translate(-2px, -2px); }
}

/* ── Variants ─────────────────────────────────────────────── */

.sk-loader--inline {
  width: 28px;
}

.sk-loader--panel {
  flex-direction: column;
  width: 48px;
  gap: var(--sk-space-2);
}

.sk-loader--overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  width: auto;
  flex-direction: column;
  background: color-mix(in srgb, var(--sk-paper) 72%, transparent);
  backdrop-filter: blur(1px);
}

/* Reduced motion: keep the eyes static, no animation required. */
@media (prefers-reduced-motion: reduce) {
  .sk-loader__eyes .sk-eyes__pupil {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Surface integration — Search + Wishlist
   ════════════════════════════════════════════════════════════ */

/* Search: replace Woodmart's CSS spinner with the canonical eyes. */
.wd-search-loader::after {
  display: none !important;
}

.wd-search-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-search-loader .sk-loader--panel {
  width: 52px;
}

/* Wishlist: show the eyes only while the native `loading` state is active. */
.wd-wishlist-btn a .sk-loader--inline {
  display: none;
}

.wd-wishlist-btn a.loading .wd-action-icon {
  display: none;
}

.wd-wishlist-btn a.loading .sk-loader--inline {
  display: inline-flex;
  width: 24px;
}
