/* ==========================================================================
   HONEYVIA LUXURY SKELETON LOADING & SCROLL REVEAL SYSTEM
   Minimal Modern Light Grey Shimmer, Zero Layout Shift, Silky Smooth Dissolves
   ========================================================================== */

/* 1. Core Skeleton Shimmer Animation */
@keyframes honeyviaSkeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes honeyviaPulseGlow {
  0%, 100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.45;
  }
}

/* Skeleton Base Tokens - Light Grey with Subtle Opacity */
:root {
  --skeleton-base: #f0f2f5;
  --skeleton-shimmer-highlight: rgba(255, 255, 255, 0.7);
  --skeleton-shimmer-border: #e8ecf0;
}

/* Generic Skeleton Element Class */
.honeyvia-skeleton {
  background: linear-gradient(
    90deg,
    #edf0f3 0%,
    #edf0f3 25%,
    rgba(255, 255, 255, 0.75) 50%,
    #edf0f3 75%,
    #edf0f3 100%
  );
  background-size: 200% 100%;
  animation: honeyviaSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: 8px;
  display: block;
  position: relative;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

/* 2. Media Image Skeleton Wrappers */
.card-media.skeleton-loading,
.news-card-thumb-link.skeleton-loading,
.featured-article-media.skeleton-loading,
.benefit-card-media.skeleton-loading,
.skeleton-media-box {
  position: relative;
  background-color: #f1f3f6 !important;
  overflow: hidden;
}

.card-media.skeleton-loading::before,
.news-card-thumb-link.skeleton-loading::before,
.featured-article-media.skeleton-loading::before,
.benefit-card-media.skeleton-loading::before,
.skeleton-media-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(241, 243, 246, 0) 0%,
    rgba(255, 255, 255, 0.4) 30%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0.4) 70%,
    rgba(241, 243, 246, 0) 100%
  );
  background-size: 200% 100%;
  animation: honeyviaSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
}

/* Watermark Emoji removed completely as requested */
.card-media.skeleton-loading::after {
  display: none !important;
  content: none !important;
}

/* 3. Smooth Fade-in & Scale Reveal for Loaded Images */
.card-media.skeleton-loading .card-image,
.card-media.skeleton-loading .card-image-primary,
.news-card-thumb-link.skeleton-loading .news-card-thumb,
.featured-article-media.skeleton-loading .featured-article-img {
  opacity: 0 !important;
  transform: scale(0.985);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.card-media .card-image.img-loaded,
.card-media:not(.skeleton-loading) .card-image,
.news-card-thumb-link .news-card-thumb.img-loaded,
.news-card-thumb-link:not(.skeleton-loading) .news-card-thumb,
.featured-article-media .featured-article-img.img-loaded,
.featured-article-media:not(.skeleton-loading) .featured-article-img {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Hover state overrides maintain image scale */
.product-card:hover .card-media:not(.skeleton-loading) .card-image.img-loaded {
  transform: scale(1.045) !important;
}

/* 4. Complete Pre-rendered Skeleton Product Card Component */
.skeleton-product-card {
  background: #ffffff;
  border: 1px solid #eef1f4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
  pointer-events: none;
}

.skeleton-product-media {
  margin: 6px 6px 0;
  width: calc(100% - 12px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    #edf0f3 0%,
    #edf0f3 25%,
    rgba(255, 255, 255, 0.75) 50%,
    #edf0f3 75%,
    #edf0f3 100%
  );
  background-size: 200% 100%;
  animation: honeyviaSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  position: relative;
}

.skeleton-product-body {
  padding: 16px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-pill-brand {
  width: 72px;
  height: 12px;
  border-radius: 4px;
}

.skeleton-title-line-1 {
  width: 88%;
  height: 18px;
  border-radius: 6px;
}

.skeleton-title-line-2 {
  width: 62%;
  height: 18px;
  border-radius: 6px;
}

.skeleton-ratings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.skeleton-star-pill {
  width: 82px;
  height: 13px;
  border-radius: 4px;
}

.skeleton-review-pill {
  width: 44px;
  height: 13px;
  border-radius: 4px;
}

.skeleton-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(220, 225, 232, 0.6);
  gap: 12px;
}

.skeleton-price-pill {
  width: 78px;
  height: 24px;
  border-radius: 6px;
}

.skeleton-btn-pill {
  width: 108px;
  height: 38px;
  border-radius: 999px;
}

/* 5. Scroll-Driven Luxury Entrance Animation */
.honeyvia-scroll-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s cubic-bezier(0.16, 1, 0.3, 1), transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.honeyvia-scroll-reveal.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Stagger delays for grid items */
.products-grid > .honeyvia-scroll-reveal:nth-child(1),
.home-products-track > .honeyvia-scroll-reveal:nth-child(1) { transition-delay: 0.04s; }
.products-grid > .honeyvia-scroll-reveal:nth-child(2),
.home-products-track > .honeyvia-scroll-reveal:nth-child(2) { transition-delay: 0.10s; }
.products-grid > .honeyvia-scroll-reveal:nth-child(3),
.home-products-track > .honeyvia-scroll-reveal:nth-child(3) { transition-delay: 0.16s; }
.products-grid > .honeyvia-scroll-reveal:nth-child(4),
.home-products-track > .honeyvia-scroll-reveal:nth-child(4) { transition-delay: 0.22s; }

/* 6. Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .honeyvia-skeleton,
  .card-media.skeleton-loading::before,
  .news-card-thumb-link.skeleton-loading::before,
  .featured-article-media.skeleton-loading::before,
  .skeleton-product-media {
    animation: none !important;
  }

  .honeyvia-scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
