/* ===== نظرات محصول — فقط متغیرهای موجود پالت سرمه‌ای/طلایی ===== */

.product-reviews {
  max-width: var(--max);
  margin: 0 auto;
  padding: 8px 24px 72px;
}

.reviews-glass {
  background: linear-gradient(
    160deg,
    rgba(13, 40, 61, 0.06),
    rgba(224, 177, 131, 0.08) 55%,
    rgba(13, 40, 61, 0.04)
  );
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(224, 177, 131, 0.35);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 8px 24px -12px rgba(13, 40, 61, 0.28);
}

.reviews-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.reviews-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--navy);
}
.reviews-head-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.reviews-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  padding: 20px 18px;
  margin-bottom: 18px;
}
.reviews-summary-score {
  text-align: center;
  min-width: 88px;
}
.reviews-avg-num {
  display: block;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.reviews-avg-stars { margin: 8px 0 6px; justify-content: center; }
.reviews-avg-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.reviews-dist { display: flex; flex-direction: column; gap: 7px; }
.reviews-dist-row {
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.reviews-dist-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(13, 40, 61, 0.08);
  overflow: hidden;
}
.reviews-dist-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mustard), var(--gold-cream));
  width: 0;
  transition: width 0.45s ease;
}

/* ستاره‌ها — ماسک SVG + گرادیان متغیرهای موجود */
.review-stars {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  direction: ltr;
}
.review-star {
  width: 28px;
  height: 28px;
  flex: none;
  border: 0;
  padding: 0;
  background: rgba(13, 40, 61, 0.12);
  cursor: default;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.7 6.2 6.7.6-5.1 4.4 1.5 6.5L12 16.9 6.2 20.3l1.5-6.5L2.6 9.4l6.7-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.7 6.2 6.7.6-5.1 4.4 1.5 6.5L12 16.9 6.2 20.3l1.5-6.5L2.6 9.4l6.7-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.15s ease, background 0.18s ease, filter 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.review-star.is-on {
  background: linear-gradient(145deg, var(--mustard), var(--gold-cream));
  filter: drop-shadow(0 1px 2px rgba(143, 107, 34, 0.35));
}
.review-star.is-half {
  background: linear-gradient(
    90deg,
    var(--mustard) 0 50%,
    rgba(13, 40, 61, 0.12) 50% 100%
  );
}
.review-stars--sm .review-star { width: 14px; height: 14px; gap: 2px; }
.review-stars--md .review-star { width: 18px; height: 18px; }
.review-stars--interactive .review-star {
  cursor: pointer;
  width: 36px;
  height: 36px;
}
.review-stars--interactive .review-star:hover,
.review-stars--interactive .review-star.is-preview {
  transform: scale(1.12);
}
.review-stars--interactive .review-star.is-on.is-preview,
.review-stars--interactive .review-star.is-on:hover {
  background: linear-gradient(145deg, var(--mustard-hover), var(--mustard));
}
@media (hover: hover) {
  .review-stars--interactive .review-star:hover { transform: scale(1.14); }
}

.reviews-form {
  padding: 18px 16px 16px;
  margin-bottom: 22px;
}
.reviews-form-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.reviews-form-hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 14px;
  line-height: 1.7;
}
.reviews-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.reviews-form-stars-wrap { margin-bottom: 14px; }
.reviews-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid rgba(224, 177, 131, 0.55);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.reviews-textarea:focus {
  outline: 2px solid var(--gold-cream);
  outline-offset: -1px;
}
.reviews-form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.reviews-char-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.reviews-submit {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 11px 22px;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--navy);
  cursor: pointer;
  background: linear-gradient(145deg, var(--mustard), var(--mustard-hover));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 12px rgba(13, 40, 61, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.reviews-submit:hover { background: linear-gradient(145deg, var(--mustard-hover), var(--mustard)); }
.reviews-submit:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px rgba(13, 40, 61, 0.2);
}
.reviews-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.reviews-status-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--mustard-text);
  background: rgba(220, 185, 85, 0.16);
  border: 1px solid rgba(220, 185, 85, 0.35);
}
.reviews-status-banner.is-rejected {
  color: var(--discount);
  background: rgba(178, 58, 46, 0.08);
  border-color: rgba(178, 58, 46, 0.25);
}
.reviews-login-gate {
  text-align: center;
  padding: 22px 16px;
  margin-bottom: 22px;
}
.reviews-login-gate p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
  line-height: 1.8;
}
.reviews-login-btn {
  appearance: none;
  border: 1px solid rgba(224, 177, 131, 0.45);
  border-radius: 999px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold-cream-soft);
  cursor: pointer;
  background: linear-gradient(160deg, rgba(13, 40, 61, 0.88), var(--navy));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 16px rgba(13, 40, 61, 0.28);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.review-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px 14px;
  animation: review-card-in 0.35s ease both;
}
@keyframes review-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .review-card { animation: none; }
  .reviews-dist-fill { transition: none; }
  .review-star { transition: none; }
}
.review-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold-cream-soft);
  background: linear-gradient(145deg, var(--navy-soft), var(--navy));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1.5px rgba(220, 185, 85, 0.45);
}
.review-card-main { min-width: 0; }
.review-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.review-author {
  font-weight: 800;
  color: var(--navy);
  font-size: 0.9rem;
}
.review-date {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.review-body {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.reviews-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 0.9rem;
}
/* تک پیام خالی بخش نظرات (جایگزین سه پیام/خط‌تیرهٔ قبلی روی محصول بدون نظر) */
.reviews-empty--solo {
  padding: 4px 12px 18px;
  font-weight: 600;
  color: var(--ink);
}

/* میانگین کوچک روی کارت لیست */
.product-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: var(--mustard-text);
  font-size: 0.74rem;
  font-weight: 700;
}
.product-card-rating .review-stars { gap: 2px; }
.product-card-rating-count {
  color: var(--muted);
  font-weight: 600;
}

/* امتیاز کنار قیمت صفحه محصول */
.product-detail-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--mustard-text);
  font-size: 0.88rem;
  font-weight: 700;
}
.product-detail-rating-count { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
/* باگ: display:inline-flex بالا از [hidden] قوی‌تر عمل می‌کرد (هر دو سلکتور با
   یک class/attribute، اما قانون author بر UA stylesheet مقدم است)، پس وقتی
   محصول نظر ندارد #pRating با hidden="" باز هم جا می‌گرفت (margin-top:8px +
   gap:4px ستون قیمت) و زیر قیمت فضای خالی می‌ساخت. */
.product-detail-rating[hidden] { display: none; }

@media (max-width: 700px) {
  .product-reviews { padding: 4px 14px 64px; }
  .reviews-summary {
    grid-template-columns: 1fr;
    gap: 16px;
    text-align: center;
  }
  .reviews-dist-row { grid-template-columns: 36px 1fr 24px; }
  .reviews-avg-num { font-size: 2.3rem; }
  .review-stars--interactive .review-star { width: 40px; height: 40px; }
  .review-stars--interactive { gap: 8px; justify-content: center; width: 100%; }
}
