/* =====================================================
   VISHAL JEWELLERS — SKELETON LOADER LIBRARY
   ===================================================== */

/* Base shimmer animation */
@keyframes vj-shimmer {
  0% { background-position: -468px 0; }
  100% { background-position: 468px 0; }
}

.vj-skeleton {
  background: linear-gradient(
    90deg,
    #f0ece4 25%,
    #e8e2d8 37%,
    #f0ece4 63%
  );
  background-size: 400px 100%;
  animation: vj-shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm, 4px);
}

[data-theme="dark"] .vj-skeleton {
  background: linear-gradient(
    90deg,
    #252545 25%,
    #2D2D55 37%,
    #252545 63%
  );
  background-size: 400px 100%;
}

/* ── Product Card Skeleton ─────────────────────────── */
.skeleton-product-card {
  background: var(--vj-white, #fff);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--vj-border-light, #f2e8d4);
}
[data-theme="dark"] .skeleton-product-card {
  background: var(--vj-charcoal-mid, #16213E);
  border-color: var(--vj-border, #2D2D4A);
}

.skeleton-product-card .sk-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
}

.skeleton-product-card .sk-body {
  padding: 14px 16px 18px;
}

.skeleton-product-card .sk-meta {
  height: 10px;
  width: 40%;
  margin-bottom: 10px;
  border-radius: 20px;
}

.skeleton-product-card .sk-name {
  height: 14px;
  width: 75%;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-product-card .sk-name-2 {
  height: 14px;
  width: 55%;
  margin-bottom: 12px;
  border-radius: 4px;
}

.skeleton-product-card .sk-attrs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.skeleton-product-card .sk-pill {
  height: 18px;
  width: 48px;
  border-radius: 20px;
}

.skeleton-product-card .sk-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.skeleton-product-card .sk-price {
  height: 18px;
  width: 36%;
  border-radius: 4px;
}

.skeleton-product-card .sk-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

/* ── Rate Card Skeleton ────────────────────────────── */
.skeleton-rate-card {
  background: var(--vj-white, #fff);
  border: 1px solid var(--vj-border, #E8D5B0);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  text-align: center;
}

.skeleton-rate-card .sk-purity {
  height: 10px;
  width: 40%;
  margin: 0 auto 14px;
  border-radius: 20px;
}

.skeleton-rate-card .sk-value {
  height: 36px;
  width: 70%;
  margin: 0 auto 8px;
  border-radius: 4px;
}

.skeleton-rate-card .sk-unit {
  height: 10px;
  width: 30%;
  margin: 0 auto 14px;
  border-radius: 20px;
}

.skeleton-rate-card .sk-badge {
  height: 22px;
  width: 50%;
  margin: 0 auto;
  border-radius: 20px;
}

/* ── Banner Skeleton ───────────────────────────────── */
.skeleton-banner {
  width: 100%;
  aspect-ratio: 16 / 6;
  border-radius: var(--radius-xl, 24px);
}

/* ── Category Card Skeleton ────────────────────────── */
.skeleton-cat-card {
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

/* ── Text Skeletons ────────────────────────────────── */
.sk-line {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.sk-line.w-20 { width: 20%; }
.sk-line.w-30 { width: 30%; }
.sk-line.w-40 { width: 40%; }
.sk-line.w-50 { width: 50%; }
.sk-line.w-60 { width: 60%; }
.sk-line.w-70 { width: 70%; }
.sk-line.w-80 { width: 80%; }
.sk-line.w-90 { width: 90%; }
.sk-line.w-100 { width: 100%; }

.sk-heading {
  height: 28px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.sk-subheading {
  height: 20px;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* ── Circle / Avatar Skeleton ──────────────────────── */
.sk-circle {
  border-radius: 50%;
}

.sk-circle-sm  { width: 32px;  height: 32px; }
.sk-circle-md  { width: 48px;  height: 48px; }
.sk-circle-lg  { width: 64px;  height: 64px; }
.sk-circle-xl  { width: 96px;  height: 96px; }

/* ── Table Row Skeleton ────────────────────────────── */
.skeleton-table-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--vj-border-light, #f2e8d4);
}
[data-theme="dark"] .skeleton-table-row {
  border-bottom-color: var(--vj-border, #2D2D4A);
}

.skeleton-table-row .sk-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md, 8px);
  flex-shrink: 0;
}

.skeleton-table-row .sk-info {
  flex: 1;
}

/* ── Section Header Skeleton ───────────────────────── */
.skeleton-section-header {
  text-align: center;
  margin-bottom: 40px;
}
.skeleton-section-header .sk-kicker {
  height: 10px;
  width: 80px;
  border-radius: 20px;
  margin: 0 auto 12px;
}
.skeleton-section-header .sk-title {
  height: 32px;
  width: 280px;
  border-radius: 4px;
  margin: 0 auto 8px;
}
.skeleton-section-header .sk-divider {
  height: 2px;
  width: 60px;
  border-radius: 2px;
  margin: 8px auto;
}

/* ── Catalogue Filter Skeleton ─────────────────────── */
.skeleton-filter {
  padding: 20px;
}
.skeleton-filter .sk-filter-title {
  height: 12px;
  width: 50%;
  border-radius: 4px;
  margin-bottom: 16px;
}
.skeleton-filter .sk-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.skeleton-filter .sk-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
}
.skeleton-filter .sk-option-label {
  height: 12px;
  flex: 1;
  border-radius: 4px;
}

/* ── Product Detail Image Skeleton ─────────────────── */
.skeleton-product-gallery {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl, 24px);
  width: 100%;
}

.skeleton-product-info {
  padding: 0 0 0 32px;
}

/* ── Hide content while loading ────────────────────── */
.vj-loading-state .vj-product-grid > .vj-product-card { display: none; }
.vj-loading-state .skeleton-product-card { display: block; }

/* ── Fade in on load ───────────────────────────────── */
.vj-fade-in {
  animation: vjFadeIn 0.5s ease forwards;
}
@keyframes vjFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Stagger grid reveal ───────────────────────────── */
.vj-product-grid .vj-product-card:nth-child(1)  { animation-delay: 0ms; }
.vj-product-grid .vj-product-card:nth-child(2)  { animation-delay: 60ms; }
.vj-product-grid .vj-product-card:nth-child(3)  { animation-delay: 120ms; }
.vj-product-grid .vj-product-card:nth-child(4)  { animation-delay: 180ms; }
.vj-product-grid .vj-product-card:nth-child(5)  { animation-delay: 240ms; }
.vj-product-grid .vj-product-card:nth-child(6)  { animation-delay: 300ms; }
.vj-product-grid .vj-product-card:nth-child(7)  { animation-delay: 360ms; }
.vj-product-grid .vj-product-card:nth-child(8)  { animation-delay: 420ms; }
