/* ==========================================================================
   PunRoyal - jQuery Skeleton Loader Styles
   Premium luxury shimmering skeleton placeholders for images, videos & cards
   ========================================================================== */

:root {
  --skeleton-base: #f0ece3;
  --skeleton-shimmer: rgba(255, 255, 255, 0.85);
  --skeleton-border: #e8e2d5;
  --skeleton-gold-accent: #CE9E40;
}

/* --- Base Shimmer Animation --- */
@keyframes punroyalSkeletonShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes punroyalSkeletonPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

.skeleton-shimmer-active {
  position: relative;
  overflow: hidden;
  background-color: var(--skeleton-base) !important;
}

.skeleton-shimmer-active::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 30%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.6) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: punroyalSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
  z-index: 3;
}

/* --- Media Wrapper (Images & Videos) --- */
.skeleton-media-wrapper {
  position: relative !important;
  overflow: hidden !important;
  background-color: var(--skeleton-base);
}

/* Media overlay that stays visible while image/video loads */
.skeleton-media-overlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: var(--skeleton-base) !important;
  z-index: 4 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: opacity 0.4s ease, visibility 0.4s ease !important;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  overflow: hidden;
}

.skeleton-media-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 30%,
    rgba(255, 255, 255, 0.9) 50%,
    rgba(255, 255, 255, 0.6) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: punroyalSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Subtle luxury emblem in center of loading media */
.skeleton-media-overlay .skeleton-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(206, 158, 64, 0.15);
  border: 1px solid rgba(206, 158, 64, 0.25);
  animation: punroyalSkeletonPulse 1.8s ease-in-out infinite;
  z-index: 5;
}

.skeleton-media-overlay .skeleton-brand-icon svg,
.skeleton-media-overlay .skeleton-brand-icon i {
  color: var(--skeleton-gold-accent);
  font-size: 20px;
}

/* While loading, hide or fade real content */
.skeleton-media-wrapper img,
.skeleton-media-wrapper video {
  transition: opacity 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  opacity: 0;
}

/* Once loaded, reveal content and fade out overlay */
.skeleton-media-wrapper.skeleton-loaded .skeleton-media-overlay {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.skeleton-media-wrapper.skeleton-loaded img,
.skeleton-media-wrapper.skeleton-loaded video {
  opacity: 1 !important;
}

/* --- Product Card Skeleton (Grid) --- */
.skeleton-product-card {
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--skeleton-border);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.skeleton-product-card .skeleton-card-media {
  position: relative;
  width: 100%;
  padding-top: 133.33%; /* 3:4 aspect ratio matching luxury clothing */
  background-color: var(--skeleton-base);
  overflow: hidden;
}

.skeleton-product-card .skeleton-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 110px;
  height: 20px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 2;
}

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

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

.skeleton-block {
  background-color: var(--skeleton-base);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: punroyalSkeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}

.skeleton-line-title {
  height: 16px;
  width: 85%;
}

.skeleton-line-title-sub {
  height: 14px;
  width: 60%;
}

.skeleton-line-price {
  height: 18px;
  width: 45%;
}

.skeleton-line-btn {
  height: 38px;
  border-radius: 30px;
  width: 100%;
  margin-top: 6px;
}

/* --- Influencer Reel Skeleton --- */
.skeleton-reel-card {
  border-radius: 14px;
  background: var(--skeleton-base);
  position: relative;
  overflow: hidden;
  height: 480px;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.skeleton-reel-card .skeleton-reel-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 80px;
  height: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.skeleton-reel-card .skeleton-reel-bottom {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

/* --- Single Product Page Gallery Skeleton --- */
.skeleton-pd-main {
  width: 100%;
  padding-top: 125%;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background: var(--skeleton-base);
}

.skeleton-pd-thumb {
  width: 100%;
  padding-top: 120%;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: var(--skeleton-base);
  margin-bottom: 8px;
}

/* Smooth Fade In for Real Content Once Loaded */
.fade-in-media {
  animation: punroyalFadeIn 0.4s ease forwards;
}

@keyframes punroyalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
