/* =====================================================
   Saste Tools — Reviews System (homepage widget +
   dedicated reviews.php page). Loaded after product-page.css
   so these rules win the cascade for anything they override.
   ===================================================== */

/* ---------- Compact rating pill (replaces old rating-badge look) ---------- */
.rating-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  white-space: nowrap;
}
.rating-pill-score {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.rating-pill-score span { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.rating-pill-meta { display: flex; flex-direction: column; gap: 2px; }
.rating-pill-meta .stars { color: var(--gold); font-size: 0.78rem; display: flex; align-items: center; gap: 3px; }
.rating-pill-meta small { color: var(--text-muted); font-size: 0.72rem; }

/* ---------- Testimonials header: title left, rating + review boxed top-right ---------- */
.testimonials-header-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.testimonials-header-text { flex: 1 1 320px; }
.testimonials-header-split .section-title,
.testimonials-header-split .section-sub { text-align: left; }
.testimonials-header-split .section-sub { margin-bottom: 0; }

.testimonials-header-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
  flex-shrink: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.testimonials-header-actions .rating-pill {
  border: none;
  background: none;
  padding: 0;
}

/* ---------- Review avatars: real photo OR initials fallback ---------- */
.review-avatar {
  overflow: hidden; /* keeps uploaded photos clipped to the circle */
}
.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.review-card {
  display: flex;
  flex-direction: column;
  transition: var(--transition-fast);
}
.review-card:hover {
  border-color: var(--card-border-hover);
  transform: translateY(-3px);
}
.review-card .review-text { flex-grow: 1; }
.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  flex-wrap: wrap;
}
.review-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.review-date::before {
  content: '\f073'; /* fa-calendar */
  font-family: 'Font Awesome 6 Free';
  font-weight: 400;
  opacity: 0.7;
}
.review-card-footer .review-product-tag { margin: 0; padding: 0; border: 0; }

/* ---------- "All Reviews" heading row (reviews.php) ---------- */
.reviews-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.reviews-list-heading h2 { font-size: 1.3rem; font-weight: 700; }
.reviews-list-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 5px 14px;
  white-space: nowrap;
}

/* ---------- Reviews page header (reviews.php) ---------- */
.reviews-hero { padding: 26px 0 6px; }
.reviews-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.reviews-hero-text { flex: 1 1 320px; }
.reviews-hero-side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Attractive write-review card ---------- */
.review-form-box-attractive {
  max-width: 720px;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--card-bg) 0%, var(--black-soft) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  padding: 32px 34px;
}
.review-form-heading { margin-bottom: 18px; }
.review-form-heading h3 { font-size: 1.25rem; margin-bottom: 6px; }
.review-form-heading p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

.optional-tag { color: var(--text-faint); font-weight: 400; font-size: 0.78rem; }

/* ---------- Optional profile picture upload ---------- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.avatar-upload-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--black-soft);
  border: 1.5px dashed var(--card-border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 1.4rem;
}
.avatar-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-upload-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.avatar-upload-btn { white-space: nowrap; cursor: pointer; }
.avatar-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.avatar-upload-hint {
  color: var(--text-faint);
  font-size: 0.72rem;
  width: 100%;
}

/* =========================================================
   Responsive — laptop down to small mobile.
   ========================================================= */
@media (max-width: 900px) {
  .reviews-hero-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .reviews-hero-text { flex: 0 0 auto; }
  .reviews-hero-side { width: 100%; justify-content: space-between; }
}

@media (max-width: 768px) {
  .review-form-box-attractive { padding: 24px 20px; }
  .testimonials-header-split { flex-direction: column; align-items: stretch; gap: 10px; }
  .testimonials-header-text { flex: 0 0 auto; }
  .testimonials-header-split .section-title,
  .testimonials-header-split .section-sub { text-align: center; white-space: normal; }
  .testimonials-header-actions {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    margin-top: 0;
  }
  .rating-pill { justify-content: center; }
}

@media (max-width: 420px) {
  .testimonials-header-actions { flex-direction: column; gap: 10px; padding: 14px; }
  .testimonials-header-actions .rating-pill { width: 100%; justify-content: center; }
  .testimonials-header-actions .btn { width: 100%; }
}

@media (max-width: 600px) {
  .reviews-hero { padding: 18px 0 4px; }
  .reviews-hero-side { flex-direction: column; align-items: stretch; gap: 10px; }
  .reviews-hero-side .rating-pill { justify-content: center; }
  .reviews-hero-side .btn { text-align: center; justify-content: center; }
  .avatar-upload { justify-content: center; text-align: center; }
  .avatar-upload-controls { justify-content: center; width: 100%; }
  .avatar-upload-hint { text-align: center; }
  .review-card-footer { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 480px) {
  .review-form-box-attractive { padding: 20px 16px; }
  .rating-pill-score { font-size: 1.1rem; }
  .reviews-list-heading { flex-wrap: wrap; }
  .reviews-list-heading h2 { font-size: 1.1rem; }
}
