/* SilverSupplements product cards — shared visual system.
 * Vanilla CSS, no build step. One file linked from every page that renders
 * product grids. Palette + fonts are defined in each page's Tailwind config
 * (pine/mist/font-display); everything below is custom card styling. */

.ss-card {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 12px 32px -12px rgba(15, 23, 42, 0.18);
  transition: box-shadow 0.35s ease-out;
}

/* Lift on hover via the independent `translate` property so it composes
 * with the JS-driven tilt `transform` instead of being overridden by it. */
.ss-lift {
  transition: translate 0.35s ease-out, box-shadow 0.35s ease-out;
}
.ss-lift:hover {
  translate: 0 -6px;
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 24px 48px -12px rgba(15, 23, 42, 0.25);
}

/* ---- Image area: soft spotlight, floating product ---- */
.ss-media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #ffffff 0%, #eef2f4 55%, #e3e9ee 100%);
}
.ss-img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.5s ease-out;
}
.ss-card:hover .ss-img {
  transform: scale(1.06);
}
.ss-noimg {
  color: #94a3b8;
  font-size: 0.875rem;
  padding: 1rem;
  text-align: center;
}

/* ---- Glass badge (Tested by me) ---- */
.ss-tested {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #083f30;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}
.ss-tested svg {
  width: 12px;
  height: 12px;
  flex: none;
  fill: currentColor;
}

/* ---- Body ---- */
.ss-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.ss-title {
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.ss-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ss-reviews {
  font-size: 0.875rem;
  color: #64748b;
}
.ss-blurb {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
}
.ss-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}
.ss-price-note {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: -8px;
}
.ss-buy {
  margin-top: auto;
  padding-top: 14px;
}

/* ---- CTA: full-width pill; the ::after stretches ONE link over the card ---- */
.ss-cta {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 999px;
  background: #0b6b4f;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.25s ease-out;
}
.ss-cta:hover {
  background: #08472f;
}
.ss-cta::after {
  content: "";
  position: absolute;
  inset: 0;
}
.ss-cta svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.25s ease-out;
}
.ss-cta:hover svg {
  transform: translateX(4px);
}
.ss-cta:focus-visible {
  outline: 3px solid #0b6b4f;
  outline-offset: 3px;
}
.ss-card:focus-within {
  box-shadow:
    0 0 0 3px rgba(11, 107, 79, 0.35),
    0 12px 32px -12px rgba(15, 23, 42, 0.18);
}
/* ---- Partial-fill SVG stars ---- */
.ss-stars {
  position: relative;
  display: inline-flex;
  line-height: 0;
}
.ss-star-row {
  display: inline-flex;
  gap: 2px;
  white-space: nowrap;
}
.ss-star-row svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.ss-star-row path {
  fill: currentColor;
}
.ss-stars-bg {
  color: #cbd5e1;
}
.ss-stars-fg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  overflow: hidden;
  width: var(--ss-fill, 100%);
  color: #f59e0b;
}

/* ---- Featured: horizontal on large screens, glowing conic border ---- */
@media (min-width: 1024px) {
  .ss-card-featured {
    flex-direction: row;
  }
  .ss-card-featured .ss-media {
    width: 42%;
    flex: none;
    aspect-ratio: auto;
    min-height: 280px;
  }
  .ss-card-featured .ss-body {
    justify-content: center;
    padding: 32px;
  }
  .ss-card-featured .ss-title {
    font-size: 1.6rem;
  }
}
.ss-glow {
  border-radius: 26px;
  padding: 2px;
  background: linear-gradient(135deg, #0b6b4f, #94a3b8);
  box-shadow: 0 16px 44px -14px rgba(11, 107, 79, 0.4);
}
@supports (background: conic-gradient(from 0deg, red, blue)) {
  .ss-glow {
    background: conic-gradient(from var(--ss-angle, 0deg), #0b6b4f, #cbd5e1, #f8fafc, #0b6b4f);
  }
}
@property --ss-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes ss-spin {
  to { --ss-angle: 360deg; }
}
.ss-glow {
  animation: ss-spin 9s linear infinite;
}

/* ---- Featured wrapper: article fills the frame so no gradient band shows
 * in stretched grid rows ---- */
.ss-glow {
  display: flex;
}
.ss-glow > .ss-card {
  flex: 1;
}

/* ---- Scroll reveal + stagger ---- */
.ss-reveal {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 0.6s ease-out, translate 0.6s ease-out;
}
.ss-reveal.ss-in {
  opacity: 1;
  translate: 0 0;
}
.ss-stagger-0 { transition-delay: 0ms; }
.ss-stagger-1 { transition-delay: 60ms; }
.ss-stagger-2 { transition-delay: 120ms; }
.ss-stagger-3 { transition-delay: 180ms; }
.ss-stagger-4 { transition-delay: 240ms; }
.ss-stagger-5 { transition-delay: 300ms; }
.ss-stagger-6 { transition-delay: 360ms; }
.ss-stagger-7 { transition-delay: 420ms; }

/* ---- Skeleton shimmer ---- */
.ss-skel {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 12px 32px -12px rgba(15, 23, 42, 0.12);
}
.ss-skel-media {
  aspect-ratio: 4 / 3;
  background: #e9edf1;
}
.ss-skel-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ss-skel-line {
  height: 14px;
  border-radius: 7px;
  background: #e9edf1;
}
.ss-skel-line:nth-child(1) { width: 70%; }
.ss-skel-line:nth-child(2) { width: 95%; }
.ss-skel-short:nth-child(3) { width: 45%; }
.ss-shimmer {
  position: relative;
  overflow: hidden;
}
.ss-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: ss-shimmer 1.2s infinite;
}
@keyframes ss-shimmer {
  to { transform: translateX(100%); }
}

/* ---- Empty state ---- */
.ss-empty {
  grid-column: 1 / -1;
  border: 2px dashed #cbd5e1;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.6);
  padding: 48px 32px;
  text-align: center;
  color: #64748b;
}
.ss-empty svg {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  color: #94a3b8;
}
.ss-empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
.ss-empty-text {
  font-size: 0.875rem;
}

/* ---- Reduced motion: everything static ---- */
@media (prefers-reduced-motion: reduce) {
  .ss-card,
  .ss-img,
  .ss-reveal,
  .ss-cta,
  .ss-cta svg {
    transition: none !important;
    animation: none !important;
  }
  .ss-reveal {
    opacity: 1;
    translate: none;
  }
  .ss-glow {
    animation: none;
  }
  .ss-lift:hover {
    translate: none;
  }
  .ss-card:hover .ss-img {
    transform: none;
  }
}
