/* ==================== PRODUCT LOADING SKELETON ====================
   The loading page loads product.css and reuses the real product page's
   DOM structure, so its layout is identical to the loaded page. This file
   only adds shimmer placeholder utilities (.sk) — the layout, grids, cards,
   responsive behaviour and the top loading header (spinner + status text,
   identical to the results page) all come from product.css. */

/* ---- shimmer block utility ---- */
.sk {
    display: block;
    border-radius: 6px;
    background: linear-gradient(100deg, var(--surface-alt, #F3F5F9) 0%, var(--surface-alt, #edf1f6) 35%, var(--bg-white, #ffffff) 52%, var(--surface-alt, #edf1f6) 68%, var(--surface-alt, #F3F5F9) 100%);
    background-size: 220% 100%;
    animation: shimmer 1.45s ease-in-out infinite;
}

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

/* ---- width / spacing helpers ---- */
.sk-line { height: 12px; }
.sk-title { height: 22px; }
.sk-h2 { height: 15px; }
.sk-w-25 { width: 25%; } .sk-w-35 { width: 35%; } .sk-w-40 { width: 40%; }
.sk-w-45 { width: 45%; } .sk-w-50 { width: 50%; } .sk-w-55 { width: 55%; }
.sk-w-60 { width: 60%; } .sk-w-65 { width: 65%; } .sk-w-70 { width: 70%; }
.sk-w-75 { width: 75%; } .sk-w-80 { width: 80%; } .sk-w-85 { width: 85%; }
.sk-w-90 { width: 90%; } .sk-w-95 { width: 95%; } .sk-w-100 { width: 100%; }
.sk-mt-6 { margin-top: 6px; }
.sk-mt-10 { margin-top: 10px; }
.sk-lines { display: flex; flex-direction: column; gap: 10px; }

/* ---- placeholders sized to the real product page elements ---- */
.sk-crumb { height: 11px; width: 64px; border-radius: 999px; }
.sk-media { border-radius: inherit; }
.sk-company { height: 13px; width: 80px; border-radius: 999px; margin: 4px 0 10px; }
.sk-action { width: 48px; height: 48px; border-radius: 16px; flex-shrink: 0; }
.sk-tag-icon { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.sk-price { display: inline-block; width: 84px; height: 22px; }
.sk-insight-icon { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.sk-scale-value { height: 17px; width: 64px; }
.sk-arrow { width: 18px; height: 18px; border-radius: 50%; }
.dot.sk { border-radius: 50%; }

/* ---- the skeleton is purely decorative: no interactions ---- */
.product-loading .product-dashboard,
.product-loading .lower-grid,
.product-loading .breadcrumbs {
    pointer-events: none;
}

/* ---- accessibility: static placeholders without motion ---- */
@media (prefers-reduced-motion: reduce) {
    .sk { animation: none; background: var(--surface-alt, #edf1f6); }
}

/* ==== v53: skeleton mirrors the chosen product page layout ====
   showcase (default): the product-hero grid from product.css.
   compact: the classic grid arrangement (mirrors .layout-classic). */
html[data-skeleton-layout="compact"] .product-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr);
    grid-template-areas:
        "summary summary"
        "media market"
        "media specs"
        "media desc"
        "charts charts";
    gap: 18px;
}
html[data-skeleton-layout="compact"] .product-hero,
html[data-skeleton-layout="compact"] .product-info-grid { display: contents; }
html[data-skeleton-layout="compact"] .product-summary-card { grid-area: summary; }
html[data-skeleton-layout="compact"] .listing-media-card { grid-area: media; }
html[data-skeleton-layout="compact"] .marketplace-card { grid-area: market; }
html[data-skeleton-layout="compact"] .specs-card { grid-area: specs; }
html[data-skeleton-layout="compact"] .description-card { grid-area: desc; }
html[data-skeleton-layout="compact"] .lower-grid {
    grid-area: charts;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

/* ==== v54: the showcase arrangement is pinned explicitly so it can never
   collapse into the compact grid, and gallery thumbnails get placeholders. */
html[data-skeleton-layout="showcase"] .product-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
html[data-skeleton-layout="showcase"] .lower-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}
html[data-skeleton-layout="showcase"] .product-info-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}
html[data-skeleton-layout="showcase"] .product-hero .listing-image-wrap { aspect-ratio: 4 / 3; }
.sk-thumb { width: 64px; height: 48px; border-radius: 8px; }
/* v113: calmer countdown presentation on the search -> product transition */
.loading-text {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.loading-header::after {
  content: "";
  display: block;
  width: min(280px, 70%);
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary, #1358ff), transparent);
  opacity: .55;
  animation: loading-header-sweep 1.8s ease-in-out infinite;
}
@keyframes loading-header-sweep {
  0% { transform: scaleX(.35); opacity: .25; }
  50% { transform: scaleX(1); opacity: .65; }
  100% { transform: scaleX(.35); opacity: .25; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-header::after { animation: none; }
}