/* component-skeleton.css — Skeleton loading screen styles */

/* ─── Shared shimmer animation ──────────────────────────────────────────── */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
  border-radius: 4px;
}

/* ─── Product card skeleton ─────────────────────────────────────────────── */
.skeleton-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(#1f1f21, #1f1f21) padding-box,
              linear-gradient(135deg, rgba(227, 252, 2, 0.15), rgba(0, 216, 214, 0.08)) border-box;
  pointer-events: none;
}

.skeleton-card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.skeleton-card__body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.skeleton-card__title {
  height: 1.1rem;
  width: 75%;
  border-radius: 3px;
}

.skeleton-card__price {
  height: 1rem;
  width: 35%;
  border-radius: 3px;
}

/* Stagger shimmer phase across siblings */
.product-grid .skeleton-card:nth-child(2) .skeleton-card__image,
.product-grid .skeleton-card:nth-child(2) .skeleton { animation-delay: 0.15s; }
.product-grid .skeleton-card:nth-child(3) .skeleton-card__image,
.product-grid .skeleton-card:nth-child(3) .skeleton { animation-delay: 0.30s; }
.product-grid .skeleton-card:nth-child(4) .skeleton-card__image,
.product-grid .skeleton-card:nth-child(4) .skeleton { animation-delay: 0.45s; }

/* ─── Quick view skeleton ────────────────────────────────────────────────── */
.quick-view__skeleton {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.quick-view__skeleton-image {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

.quick-view__skeleton-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-top: 0.5rem;
}

.quick-view__skeleton-title  { height: 2rem;   width: 80%; border-radius: 4px; }
.quick-view__skeleton-price  { height: 1.4rem; width: 30%; border-radius: 4px; }

.quick-view__skeleton-variants {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

.quick-view__skeleton-swatch { width: 44px; height: 44px; border-radius: 50%; }
.quick-view__skeleton-button { height: 52px; border-radius: 8px; margin-top: 1rem; }

@media (max-width: 640px) {
  .quick-view__skeleton { grid-template-columns: 1fr; }
}

/* ─── Cart skeleton ──────────────────────────────────────────────────────── */
.cart-skeleton__item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-skeleton__image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
}

.cart-skeleton__info {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cart-skeleton__title  { height: 1rem;    width: 60%; border-radius: 3px; }
.cart-skeleton__meta   { height: 0.85rem; width: 35%; border-radius: 3px; }
.cart-skeleton__price  { height: 1.4rem;  width: 60px; border-radius: 3px; }

/* ─── Predictive search skeleton ─────────────────────────────────────────── */
.predictive-search__skeleton-item {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.6rem;
}

.predictive-search__skeleton-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 6px;
}

.predictive-search__skeleton-text {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.predictive-search__skeleton-name  { height: 0.9rem; width: 55%; border-radius: 3px; }
.predictive-search__skeleton-price { height: 0.8rem; width: 25%; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton-card__image,
  .quick-view__skeleton-image {
    animation: none;
    background: rgba(255, 255, 255, 0.06);
  }
}
