/**
 * Product Reviews Section - Compact, Card-style Layout
 * Matches the redesigned compact reviews UI:
 *  - Top summary row (rating card | star bars | stat tiles + top mentions)
 *  - Toolbar (filter label | sort dropdown + write button)
 *  - Compact review cards with stars+title, body, pros/cons tags, footer
 */

/* ============================================================
   SECTION CONTAINER
   ============================================================ */
.product-reviews-section {
  background: transparent;
  padding: 1rem 0 2rem;
}
.product-reviews-section .container {
  max-width: 1200px;
}

/* ============================================================
   SUMMARY ROW (header)
   ============================================================ */
.rv-summary-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr minmax(260px, 340px);
  gap: 1rem;
  align-items: stretch;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

/* Left: Rating card (light blue) */
.rv-rating-card {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.rv-rating-score {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2563eb;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.rv-rating-stars {
  color: #f59e0b;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}
.rv-rating-stars .fa-star,
.rv-rating-stars .fa-star-half-alt {
  color: #f59e0b;
}
.rv-rating-stars .far.fa-star {
  color: #cbd5e1;
}
.rv-rating-count {
  font-size: 0.8rem;
  color: #64748b;
}

/* Middle: star distribution */
.rv-distribution {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 0.5rem;
}
.rv-dist-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #475569;
}
.rv-dist-star {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
  color: #475569;
}
.rv-dist-star .fa-star {
  color: #94a3b8;
  font-size: 0.65rem;
}
.rv-dist-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.rv-dist-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.rv-dist-count {
  text-align: right;
  font-weight: 500;
  color: #64748b;
}

/* Right: stat tiles + top mentions */
.rv-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rv-stats-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.rv-tile {
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border: 1px solid transparent;
}
.rv-tile-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.rv-tile-value i {
  margin-right: 4px;
  font-size: 0.85rem;
}
.rv-tile-label {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 2px;
}
.rv-tile--recommend {
  background: #ecfdf5;
  border-color: #d1fae5;
}
.rv-tile--recommend .rv-tile-value {
  color: #059669;
}
.rv-tile--verified {
  background: #F4E7F3;
  border-color: #E8DDEE;
}
.rv-tile--verified .rv-tile-value {
  color: #7c3aed;
}
.rv-mentions {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #9a3412;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.rv-mentions i {
  color: #ea580c;
}
.rv-mentions strong {
  color: #7c2d12;
  font-weight: 600;
}

/* ============================================================
   TOOLBAR
   ============================================================ */
.rv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
  flex-wrap: wrap;
}
.rv-toolbar-left {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.rv-toolbar-left i {
  color: #6b7280;
}
.rv-toolbar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.rv-sort {
  appearance: none;
  -webkit-appearance: none;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%236b7280' stroke-width='1.5' d='M1 1l4 4 4-4'/></svg>")
    no-repeat right 0.65rem center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.4rem 1.75rem 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  min-width: 140px;
}
.rv-sort:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.rv-write-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.rv-write-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ============================================================
   REVIEW LIST + CARDS
   ============================================================ */
.rv-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.rv-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rv-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

/* Top: stars + title (left) | indicator icons (right) */
.rv-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.rv-item-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.rv-item-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.85rem;
  color: #f59e0b;
}
.rv-item-stars .far.fa-star {
  color: #cbd5e1;
}
.rv-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}
.rv-item-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.rv-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.rv-icon--verified {
  color: #059669;
}
.rv-icon--source {
  color: #2563eb;
}

/* Body */
.rv-item-body {
  margin: 0.45rem 0 0.6rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #374151;
}

/* Pros/cons tags */
.rv-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.rv-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.4;
}
.rv-tag--pro {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.rv-tag--con {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Footer: meta + helpful chip */
.rv-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f3f4f6;
}
.rv-item-meta {
  font-size: 0.78rem;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.rv-meta-author {
  font-weight: 600;
  color: #111827;
}
.rv-meta-source {
  color: #4b5563;
}
.rv-meta-dot {
  width: 3px;
  height: 3px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
}
.rv-helpful-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.78rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rv-helpful-chip:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
.rv-helpful-chip i {
  color: #6b7280;
}

/* Empty state */
.rv-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  background: #fff;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  color: #6b7280;
}
.rv-empty p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .rv-summary-row {
    grid-template-columns: 1fr 1fr;
  }
  .rv-stats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .rv-summary-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .rv-rating-card {
    padding: 0.75rem;
  }
  .rv-rating-score {
    font-size: 2rem;
  }
  .rv-toolbar {
    align-items: stretch;
  }
  .rv-toolbar-right {
    flex-wrap: wrap;
  }
  .rv-item-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ============================================================
   LEGACY COMPATIBILITY (review modal styles untouched elsewhere)
   ============================================================ */
.reviews-section-header {
  display: none; /* Section title moved into tab header */
}
