/* Loading skeletons — Phase 3 */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 0%,
    var(--bg-hover) 45%,
    var(--bg-elevated) 90%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.product-card--skeleton {
  pointer-events: none;
  border-color: var(--border-subtle);
}

.product-card--skeleton:hover {
  transform: none;
  box-shadow: none;
}

.skeleton--media {
  aspect-ratio: 16 / 10;
  width: 100%;
  border-radius: 0;
}

.skeleton--text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton--text.skeleton--sm { width: 40%; height: 10px; }
.skeleton--text.skeleton--md { width: 70%; height: 14px; }
.skeleton--text.skeleton--lg { width: 90%; height: 14px; }

.product-gallery__main.is-loading {
  position: relative;
  min-height: 280px;
}

.product-gallery__main.is-loading .skeleton--hero {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
}

.product-gallery__main img.is-loaded {
  animation: img-fade-in 0.3s ease;
}

@keyframes img-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.grid[aria-busy="true"] {
  min-height: 200px;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--bg-elevated); }
  .product-gallery__main img.is-loaded { animation: none; }
}
