/*
  Khối "Đánh giá từ khách hàng" (Reviews/Views/Shared/Components/Review/Default.cshtml). JS: assets/js/product-reviews.js.
  1rem = 10px. Màu chính theo theme (--color-primary).
*/
.pr-reviews {
  --pr-line: #e6eaf0;
  --pr-muted: #5f6b7a;
  --pr-navy: #0B2D66;
  --pr-star: #F26522;
  --pr-soft: #EEF3FB;
}
.pr-reviews [hidden] { display: none !important; }
.pr-card { padding: 2.8rem; border: 1px solid var(--pr-line); border-radius: 1.6rem; background: #fff; }

.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; margin-bottom: 2.4rem; }
.pr-title { margin: 0; font-size: clamp(2rem, 2.4vw, 2.6rem); font-weight: 800; color: var(--pr-navy); }
.pr-write-btn { display: inline-flex; align-items: center; gap: .8rem; flex: 0 0 auto; }

/* ===== Sao (tô theo --rating, hỗ trợ số lẻ) ===== */
.pr-stars { --size: 1.6rem; position: relative; display: inline-block; font-size: var(--size); line-height: 1; letter-spacing: .2rem; color: #dfe3ea; }
.pr-stars::before { content: "★★★★★"; }
.pr-stars::after {
  content: "★★★★★"; position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: var(--pr-star);
  width: calc(var(--rating, 0) / 5 * 100%);
}
.pr-stars--lg { --size: 2.2rem; }
.pr-star-icon { color: var(--pr-star); }

/* ===== Tổng quan ===== */
.pr-summary { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 3.2rem; align-items: center; padding-bottom: 2.4rem; border-bottom: 1px solid var(--pr-line); }
.pr-score { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1.6rem; border-radius: 1.2rem; background: var(--pr-soft); text-align: center; }
.pr-score__value { font-size: 4.8rem; line-height: 1; font-weight: 800; color: var(--pr-navy); }
.pr-score__count { font-size: 1.4rem; color: var(--pr-muted); }
.pr-bars { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; max-width: 52rem; }
.pr-bar { width: 100%; display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) 3.2rem; align-items: center; gap: 1.2rem; padding: .3rem 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.pr-bar:disabled { cursor: default; opacity: .6; }
.pr-bar:not(:disabled):hover .pr-bar__fill { filter: brightness(.92); }
.pr-bar__label { font-size: 1.4rem; font-weight: 600; white-space: nowrap; }
.pr-bar__track { height: .8rem; border-radius: 99rem; background: #eef1f5; overflow: hidden; }
.pr-bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--pr-star); transition: width .4s; }
.pr-bar__count { font-size: 1.3rem; color: var(--pr-muted); text-align: right; }

/* ===== Form ===== */
.pr-form { margin-top: 2.4rem; padding: 2.4rem; border: 1px solid var(--pr-line); border-radius: 1.4rem; background: #fbfcfd; display: grid; gap: 1.4rem; }
.pr-form__field { display: flex; flex-direction: column; gap: .6rem; }
.pr-form__label { font-size: 1.4rem; font-weight: 600; color: var(--pr-navy); }
.pr-form__as { margin: 0; font-size: 1.4rem; color: var(--pr-muted); }
.pr-input { width: 100%; padding: 1rem 1.2rem; border: 1px solid var(--pr-line); border-radius: 1rem; background: #fff; font: inherit; font-size: 1.4rem; }
.pr-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(11, 45, 102, .14); }
textarea.pr-input { resize: vertical; min-height: 10rem; }
.pr-rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .4rem; }
.pr-rate input { position: absolute; opacity: 0; pointer-events: none; }
.pr-rate label { font-size: 3.2rem; line-height: 1; color: #dfe3ea; cursor: pointer; transition: color .15s, transform .15s; }
.pr-rate label:hover, .pr-rate label:hover ~ label, .pr-rate input:checked ~ label { color: var(--pr-star); }
.pr-rate label:active { transform: scale(.9); }
.pr-rate input:focus-visible + label { outline: 2px solid var(--color-primary); border-radius: .4rem; }
.pr-rate__text { font-size: 1.3rem; color: var(--pr-muted); }
.pr-form__errors { padding: 1rem 1.2rem; border-radius: 1rem; background: #fde8e8; color: #b42318; font-size: 1.4rem; }
.pr-form__errors p { margin: 0; }
.pr-form__actions { display: flex; justify-content: flex-end; gap: 1rem; }
.pr-form__note { margin: 0; font-size: 1.2rem; color: var(--pr-muted); text-align: right; }
.pr-btn-ghost { border: 1px solid var(--pr-line); background: #fff; color: var(--pr-navy); }
.pr-btn-ghost:hover { border-color: var(--pr-navy); }
.pr-reviews .btn.is-loading { opacity: .6; pointer-events: none; }
.pr-success { margin-top: 2.4rem; padding: 1.6rem 2rem; border-radius: 1.2rem; background: #EEF3FB; color: #0B2D66; font-size: 1.5rem; font-weight: 600; }

/* ===== Danh sách ===== */
.pr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin: 2.4rem 0 .8rem; }
.pr-toolbar__label { font-size: 1.4rem; font-weight: 600; margin-right: .4rem; }
.pr-chip { padding: .6rem 1.4rem; border: 1px solid var(--pr-line); border-radius: 99rem; background: #fff; font: inherit; font-size: 1.3rem; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.pr-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pr-chip.is-active { border-color: var(--color-primary); background: var(--pr-soft); color: var(--color-primary); font-weight: 600; }
.pr-list { margin: 0; padding: 0; list-style: none; }
.pr-item { display: flex; gap: 1.4rem; padding: 2rem 0; border-bottom: 1px solid var(--pr-line); }
.pr-item:last-child { border-bottom: 0; }
.pr-avatar {
  flex: 0 0 4.4rem; width: 4.4rem; height: 4.4rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--pr-soft); color: var(--color-primary); font-weight: 800; font-size: 1.7rem;
}
.pr-avatar--sm { flex-basis: 3.4rem; width: 3.4rem; height: 3.4rem; font-size: 1.4rem; background: var(--pr-navy); color: #fff; }
.pr-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .6rem; }
.pr-item__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; }
.pr-item__name { font-size: 1.5rem; color: var(--pr-navy); }
.pr-item__time { font-size: 1.2rem; color: var(--pr-muted); }
.pr-item__title { margin: 0; font-weight: 700; font-size: 1.5rem; }
.pr-item__text { margin: 0; font-size: 1.5rem; line-height: 1.65; color: #2a3443; white-space: pre-line; overflow-wrap: anywhere; }
.pr-reply { display: flex; gap: 1rem; margin-top: .8rem; padding: 1.2rem 1.4rem; border-radius: 1.2rem; background: #f6f8fb; border-left: 3px solid var(--color-primary); }
.pr-more { margin-top: 1.6rem; text-align: center; }
.pr-empty { margin: 1.6rem 0 0; color: var(--pr-muted); text-align: center; }
.pr-empty-state { margin-top: 2.4rem; padding: 3.2rem 1.6rem; border: 1px dashed var(--pr-line); border-radius: 1.2rem; text-align: center; color: var(--pr-muted); }
.pr-empty-state__icon { display: block; font-size: 3.6rem; color: var(--pr-star); line-height: 1; margin-bottom: .8rem; }
.pr-empty-state p { margin: 0; font-size: 1.5rem; }

@media (max-width: 767px) {
  .pr-card { padding: 1.8rem 1.4rem; border-radius: 1.4rem; }
  .pr-head { flex-direction: column; align-items: stretch; margin-bottom: 1.6rem; }
  .pr-write-btn { justify-content: center; }
  .pr-summary { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .pr-score { flex-direction: row; justify-content: center; flex-wrap: wrap; padding: 1.4rem; gap: .4rem 1.2rem; }
  .pr-score__value { font-size: 3.6rem; }
  .pr-form { padding: 1.6rem 1.2rem; }
  .pr-form__actions .btn { flex: 1 1 0; justify-content: center; }
  .pr-item { gap: 1rem; }
  .pr-avatar { flex-basis: 3.6rem; width: 3.6rem; height: 3.6rem; font-size: 1.5rem; }
}
