/* ═══════════════════════════════════════════════════════════════════════════
   NR Investments – Production Skeleton Loading System
   Premium shimmer-based content placeholders
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Base Skeleton Bone ─────────────────────────────────────────────────── */
.skel {
  position: relative;
  overflow: hidden;
  background: #e2e8f8;
  border-radius: 2px;
  /* Prevent layout shift */
  min-height: 1px;
}

.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent 100%
  );
  animation: skel-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Dark variant (for dark backgrounds like the header/footer) */
.skel-dark {
  background: #2a2a2a;
}
.skel-dark::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.06) 60%,
    transparent 100%
  );
}

@keyframes skel-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Skeleton Card (matches shopCardHTML layout) ────────────────────────── */
.skel-card {
  border: 1px solid #c4c7c7;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.skel-card__image {
  aspect-ratio: 4 / 3;
  width: 100%;
}

@media (min-width: 768px) {
  .skel-card__image {
    aspect-ratio: 16 / 10;
  }
}

.skel-card__body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

@media (min-width: 768px) {
  .skel-card__body {
    padding: 16px;
  }
}

.skel-card__title {
  height: 14px;
  width: 75%;
}

@media (min-width: 768px) {
  .skel-card__title {
    height: 16px;
  }
}

.skel-card__price {
  height: 18px;
  width: 50%;
}

@media (min-width: 768px) {
  .skel-card__price {
    height: 22px;
  }
}

.skel-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skel-card__chip {
  height: 26px;
  width: 60px;
  border-radius: 1px;
}

@media (min-width: 768px) {
  .skel-card__chip {
    height: 28px;
    width: 72px;
  }
}

.skel-card__cta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #c4c7c7;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.skel-card__btn {
  height: 36px;
  border-radius: 1px;
}

.skel-card__wa {
  width: 44px;
  height: 36px;
  border-radius: 1px;
  background: #d4edda;
}

.skel-card__wa::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.45) 60%,
    transparent 100%
  );
  animation: skel-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ─── Skeleton Featured Card (matches newlyAddedCardHTML) ────────────────── */
.skel-featured {
  border: 1px solid #c4c7c7;
  overflow: hidden;
  background: #ffffff;
}

.skel-featured__image {
  height: 160px;
  width: 100%;
}

.skel-featured__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skel-featured__title {
  height: 14px;
  width: 70%;
}

.skel-featured__price {
  height: 20px;
  width: 55%;
}

/* ─── Car Detail Page Skeletons ──────────────────────────────────────────── */

/* Gallery skeleton */
.skel-gallery {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px solid #c4c7c7;
}

.skel-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .skel-thumbs {
    grid-template-columns: repeat(5, 1fr);
  }
}

.skel-thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1px solid #c4c7c7;
}

/* Info column skeleton */
.skel-detail-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skel-detail-subtitle {
  height: 12px;
  width: 40%;
}

.skel-detail-title {
  height: 36px;
  width: 85%;
}

@media (min-width: 1024px) {
  .skel-detail-title {
    height: 44px;
  }
}

.skel-detail-price {
  height: 32px;
  width: 60%;
}

@media (min-width: 1024px) {
  .skel-detail-price {
    height: 38px;
  }
}

/* Spec chips skeleton */
.skel-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .skel-chips {
    display: flex;
    flex-wrap: wrap;
  }
}

.skel-chip-lg {
  height: 48px;
  min-width: 120px;
  border-radius: 2px;
}

/* Action button skeletons */
.skel-action-btn {
  height: 52px;
  width: 100%;
  border-radius: 1px;
}

.skel-action-btn--green {
  background: #d4edda;
}

.skel-action-btn--green::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 40%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.4) 60%,
    transparent 100%
  );
  animation: skel-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.skel-action-btn--yellow {
  background: #fef3c7;
}

.skel-action-btn--yellow::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 40%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0.5) 60%,
    transparent 100%
  );
  animation: skel-shimmer 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Specs table skeleton */
.skel-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #c4c7c7;
}

.skel-spec-label {
  height: 14px;
  width: 30%;
}

.skel-spec-value {
  height: 14px;
  width: 20%;
}

/* Seller card skeleton */
.skel-seller {
  background: #1a1a1a;
  padding: 24px;
  border-radius: 2px;
  border-bottom: 4px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skel-seller__title {
  height: 14px;
  width: 65%;
}

.skel-seller__text {
  height: 12px;
  width: 90%;
}

.skel-seller__text--short {
  height: 12px;
  width: 60%;
}

.skel-seller__btn {
  height: 52px;
  width: 100%;
  border-radius: 2px;
}

.skel-seller__disclaimer {
  height: 40px;
  width: 100%;
  border-radius: 2px;
  background: #2a2a2a;
}

/* ─── Full-page Loader ───────────────────────────────────────────────────── */
.piston-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 249, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.piston-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.piston-loader__icon {
  width: 56px;
  height: 56px;
  position: relative;
}

/* Dual-ring spinner */
.piston-loader__ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 50%;
}

.piston-loader__ring--outer {
  border-top-color: #0B0B0B;
  border-right-color: #0B0B0B;
  animation: loader-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.piston-loader__ring--inner {
  inset: 8px;
  border-bottom-color: #FACC15;
  border-left-color: #FACC15;
  animation: loader-spin 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

.piston-loader__brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0B0B0B;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.piston-loader__brand-accent {
  color: #FACC15;
  font-size: 22px;
}

.piston-loader__dots {
  display: flex;
  gap: 5px;
}

.piston-loader__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c4c7c7;
  animation: loader-dot-bounce 1.2s ease-in-out infinite;
}

.piston-loader__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.piston-loader__dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loader-dot-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    background: #c4c7c7;
  }
  30% {
    transform: translateY(-6px);
    background: #FACC15;
  }
}

/* ─── Staggered entrance for skeleton cards ──────────────────────────────── */
.skel-card,
.skel-featured {
  opacity: 0;
  animation: skel-fade-in 0.4s ease forwards;
}

.skel-card:nth-child(1), .skel-featured:nth-child(1) { animation-delay: 0ms; }
.skel-card:nth-child(2), .skel-featured:nth-child(2) { animation-delay: 60ms; }
.skel-card:nth-child(3), .skel-featured:nth-child(3) { animation-delay: 120ms; }
.skel-card:nth-child(4), .skel-featured:nth-child(4) { animation-delay: 180ms; }
.skel-card:nth-child(5) { animation-delay: 240ms; }
.skel-card:nth-child(6) { animation-delay: 300ms; }
.skel-card:nth-child(7) { animation-delay: 360ms; }
.skel-card:nth-child(8) { animation-delay: 420ms; }
.skel-card:nth-child(9) { animation-delay: 480ms; }
.skel-card:nth-child(10) { animation-delay: 540ms; }
.skel-card:nth-child(11) { animation-delay: 600ms; }
.skel-card:nth-child(12) { animation-delay: 660ms; }

@keyframes skel-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
