/* ================================================================
   Social Proof Reviews Grid — v2.0
   Matches 5astore.com layout exactly
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Reset inside wrapper ── */
.spr-wrapper *,
.spr-wrapper *::before,
.spr-wrapper *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ── */
.spr-wrapper {
  --spr-bg:       #0a0a0a;
  --spr-card:     #111111;
  --spr-accent:   #00e5ff;
  --spr-text:     #ffffff;
  --spr-muted:    rgba(255,255,255,0.45);
  --spr-border:   rgba(255,255,255,0.08);
  --spr-star-on:  #f5c518;
  --spr-verified: #10B981;
  --spr-cols:     4;
  --spr-gap:      14px;
  --spr-radius:   10px;

  background: var(--spr-bg);
  color: var(--spr-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 40px 20px 48px;
  position: relative;
  width: 100%;
}

/* ── Section Header ── */
.spr-header { text-align: center; margin-bottom: 28px; }

.spr-title {
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.spr-title__first { color: var(--spr-accent); }
.spr-title__rest  { color: #fff; }

/* ── Summary Bar (4.9 ★★★★★ + Sort) ── */
.spr-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.spr-summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spr-avg-score {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.spr-avg-stars {
  display: flex;
  gap: 1px;
}

.spr-avg-stars .spr-star--on { color: var(--spr-star-on); font-size: 18px; }
.spr-avg-stars .spr-star      { font-size: 18px; color: rgba(255,255,255,0.2); }

.spr-caret {
  width: 12px;
  height: 12px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

/* ── Sort Button & Dropdown ── */
.spr-sort-wrap { position: relative; }

.spr-sort-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--spr-border);
  color: var(--spr-text);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s;
}
.spr-sort-toggle:hover { background: rgba(255,255,255,0.11); }
.spr-sort-toggle svg   { width: 15px; height: 15px; flex-shrink: 0; }
.spr-sort-arrow        { transition: transform 0.2s; }
.spr-sort-wrap.open .spr-sort-arrow { transform: rotate(180deg); }

.spr-sort-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: #1c1c1c;
  border: 1px solid var(--spr-border);
  border-radius: 9px;
  list-style: none;
  min-width: 155px;
  z-index: 9999;
  display: none;
  box-shadow: 0 14px 40px rgba(0,0,0,0.7);
  overflow: hidden;
}
.spr-sort-wrap.open .spr-sort-dropdown { display: block; }

.spr-sort-dropdown li {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  transition: background 0.12s, color 0.12s;
}
.spr-sort-dropdown li:hover,
.spr-sort-dropdown li.spr-sort-active {
  background: rgba(255,255,255,0.06);
  color: var(--spr-accent);
}

/* ── Source Filter Row ── */
.spr-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
}

.spr-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--spr-border);
  color: rgba(255,255,255,0.55);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.spr-filter-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.spr-filter-btn:hover { border-color: rgba(255,255,255,0.3); color: #fff; }
.spr-filter-btn--active {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 600;
}

/* ═══════════════════════════════════
   MASONRY GRID  (CSS columns)
   ═══════════════════════════════════ */
.spr-masonry {
  columns: var(--spr-cols);
  column-gap: var(--spr-gap);
}

/* ── Card ── */
.spr-card {
  background: var(--spr-card);
  border: 1px solid var(--spr-border);
  border-radius: var(--spr-radius);
  overflow: hidden;
  break-inside: avoid;
  margin-bottom: var(--spr-gap);
  display: block;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: default;
}

.spr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
}

.spr-card--animate {
  animation: sprReveal 0.38s ease both;
}

@keyframes sprReveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card Image Wrap ── */
.spr-card__img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.spr-card__photo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.spr-card:hover .spr-card__photo { transform: scale(1.04); }

/* Gradient placeholder (demo) */
.spr-card__photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.35s ease;
}

.spr-card:hover .spr-card__photo-placeholder { transform: scale(1.04); }

.spr-card__photo-label {
  font-size: 20px;
  font-weight: 900;
  color: rgba(255,255,255,0.2);
  letter-spacing: -0.03em;
  text-align: center;
  pointer-events: none;
  user-select: none;
  padding: 8px;
}

/* Stars badge — sits at bottom of image, on a dark scrim */
.spr-card__stars-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
  padding: 20px 10px 8px;
  display: flex;
  gap: 2px;
}

.spr-card__stars-badge .spr-star--on { color: var(--spr-star-on); font-size: 15px; }
.spr-card__stars-badge .spr-star     { font-size: 15px; color: rgba(255,255,255,0.22); }

/* ── Card Body ── */
.spr-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Source icon row (when image present — icon only) */
.spr-card__source-row {
  display: flex;
  align-items: center;
}

.spr-card__source-icon svg { width: 18px; height: 18px; display: block; }

/* Top row when NO image: icon + stars inline */
.spr-card__top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spr-card__stars-inline { display: flex; gap: 2px; }
.spr-card__stars-inline .spr-star--on { color: var(--spr-star-on); font-size: 14px; }
.spr-card__stars-inline .spr-star     { font-size: 14px; color: rgba(255,255,255,0.18); }

/* ── Verified row ── */
.spr-card__verified-row {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  line-height: 1;
  flex-wrap: wrap;
}

.spr-verified-icon { width: 13px; height: 13px; flex-shrink: 0; }
.spr-qualified { color: var(--spr-verified); font-weight: 500; }
.spr-reviewer  { color: rgba(255,255,255,0.85); font-weight: 600; }

/* ── Review text ── */
.spr-card__text {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
}

.spr-card__text p { margin: 0; }

/* ── Product row ── */
.spr-card__product-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--spr-border);
  border-radius: 6px;
}

.spr-product-thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  display: block;
}

.spr-product-name {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Footer: likes + time ── */
.spr-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2px;
}

.spr-card__actions { display: flex; gap: 5px; }

.spr-like-btn,
.spr-dislike-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid var(--spr-border);
  color: rgba(255,255,255,0.38);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
}

.spr-like-btn:hover   { border-color: var(--spr-accent); color: var(--spr-accent); }
.spr-dislike-btn:hover { border-color: rgba(248,113,113,0.5); color: #f87171; }
.spr-like-btn--active  { background: var(--spr-accent); border-color: var(--spr-accent); color: #000 !important; }

.spr-like-btn svg,
.spr-dislike-btn svg { width: 12px; height: 12px; }

.spr-card__time {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}

/* ── Load More Button ── */
.spr-load-more-wrap { text-align: center; margin-top: 8px; }

.spr-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--spr-accent);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 11px 32px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  letter-spacing: 0.01em;
}
.spr-load-more-btn svg   { width: 16px; height: 16px; }
.spr-load-more-btn:hover { opacity: 0.86; transform: translateY(-1px); }
.spr-load-more-btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }

/* ── Spinner ── */
.spr-spinner-wrap { display: none; text-align: center; padding: 24px; }
.spr-spinner-wrap.spr-loading--active { display: block; }

.spr-spinner {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--spr-accent);
  border-radius: 50%;
  animation: sprSpin 0.65s linear infinite;
}

@keyframes sprSpin { to { transform: rotate(360deg); } }

/* ── No results ── */
.spr-no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--spr-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════ */

/* 4-col default */
.spr-masonry { columns: 4; }

/* Explicit col classes from PHP */
.spr-masonry[data-cols="1"] { columns: 1; }
.spr-masonry[data-cols="2"] { columns: 2; }
.spr-masonry[data-cols="3"] { columns: 3; }
.spr-masonry[data-cols="5"] { columns: 5; }
.spr-masonry[data-cols="6"] { columns: 6; }

@media (max-width: 1280px) {
  .spr-masonry { columns: 3; }
}
@media (max-width: 960px) {
  .spr-masonry { columns: 2; }
  .spr-filter-row .spr-filter-btn:nth-child(n+4) { display: none; }
}
@media (max-width: 560px) {
  .spr-masonry { columns: 1; }
  .spr-summary-bar { flex-direction: column; align-items: flex-start; }
  .spr-filter-row { display: none; }
  .spr-wrapper { padding: 28px 14px 36px; }
  .spr-load-more-btn { width: 100%; justify-content: center; }
}
