/* BB Reviews - секция с отзиви (дизайн: reviews-section.html) */
.sbv-reviews {
  --sbv-blue: #197fa2;
  --sbv-blue-dark: #12627e;
  --sbv-blue-soft: #edf7fa;
  --sbv-ink: #233942;
  --sbv-muted: #65777f;
  --sbv-line: #e2e9ec;
  --sbv-soft: #f6f8f9;
  --sbv-white: #fff;
  --sbv-star: #ffb400;
  width: 100%;
  max-width: 1180px;
  min-width: 0;
  margin: 48px auto;
  padding: 0 20px;
  color: var(--sbv-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}

.sbv-reviews *,
.sbv-reviews *::before,
.sbv-reviews *::after { box-sizing: border-box; }

.sbv-reviews h2,
.sbv-reviews h3,
.sbv-reviews h4,
.sbv-reviews p { margin: 0; padding: 0; }

.sbv-reviews a { color: var(--sbv-blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.sbv-reviews a:hover { color: var(--sbv-blue); }
.sbv-reviews :is(a, button):focus-visible { outline: 3px solid var(--sbv-blue); outline-offset: 4px; }

.sbv-reviews .sbv-heading { margin-bottom: 22px; }
.sbv-reviews .sbv-eyebrow { margin-bottom: 5px; color: var(--sbv-blue-dark); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.sbv-reviews .sbv-title { margin-bottom: 8px; font-size: clamp(25px, 4vw, 32px); font-weight: 600; line-height: 1.2; letter-spacing: -.6px; color: var(--sbv-ink); }
.sbv-reviews .sbv-subtitle { max-width: 650px; color: var(--sbv-muted); font-size: 14px; }

/* Summary: score + distribution + invitation to write a review. */
.sbv-reviews .sbv-summary {
  display: grid;
  grid-template-columns: .9fr 1fr 1.15fr;
  align-items: center;
  gap: 30px;
  padding: 30px;
  border: 1px solid var(--sbv-line);
  border-radius: 18px;
  background: linear-gradient(115deg, #f0f8fb 0%, #fff 58%);
  box-shadow: 0 8px 28px rgba(35, 57, 66, .035);
}

.sbv-reviews .sbv-score-block,
.sbv-reviews .sbv-breakdown,
.sbv-reviews .sbv-invite { min-width: 0; }

.sbv-reviews .sbv-label { margin-bottom: 8px; color: var(--sbv-muted); font-size: 12px; }
.sbv-reviews .sbv-score-line { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.sbv-reviews .sbv-score { font-size: 58px; font-weight: 700; letter-spacing: -3px; }
.sbv-reviews .sbv-score-max { color: var(--sbv-muted); font-size: 18px; }
.sbv-reviews .sbv-stars { display: inline-block; flex-shrink: 0; color: var(--sbv-star); font-size: 17px; line-height: 1.2; letter-spacing: 2px; white-space: nowrap; }
.sbv-reviews .sbv-star-empty { color: #c4cfd4; }
.sbv-reviews .sbv-score-block > .sbv-stars { margin: 12px 0 7px; font-size: 20px; letter-spacing: 3px; }
.sbv-reviews .sbv-score-count { font-size: 13px; color: var(--sbv-muted); }
.sbv-reviews .sbv-score-count strong { color: var(--sbv-ink); font-weight: 600; }

.sbv-reviews .sbv-rating-row { display: grid; grid-template-columns: 31px minmax(0, 1fr) 21px; align-items: center; gap: 9px; margin: 8px 0; font-size: 12px; }
.sbv-reviews .sbv-rating-label { color: var(--sbv-muted); white-space: nowrap; }
.sbv-reviews .sbv-rating-label span { color: var(--sbv-star); }
.sbv-reviews .sbv-rating-track { height: 6px; border-radius: 999px; background: #e8eef1; overflow: hidden; }
.sbv-reviews .sbv-rating-fill { display: block; width: var(--sbv-fill, 0%); height: 100%; border-radius: inherit; background: var(--sbv-blue); }
.sbv-reviews .sbv-rating-count { color: var(--sbv-muted); text-align: right; font-variant-numeric: tabular-nums; }

.sbv-reviews .sbv-invite { padding-left: 27px; border-left: 1px solid var(--sbv-line); }
.sbv-reviews .sbv-invite-title { margin-bottom: 6px; font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--sbv-ink); }
.sbv-reviews .sbv-invite-text { max-width: 310px; color: var(--sbv-muted); font-size: 13px; }
.sbv-reviews .sbv-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  max-width: 100%;
  margin: 16px 0 0;
  padding: 11px 21px;
  border: 1px solid var(--sbv-blue);
  border-radius: 9px;
  background: var(--sbv-blue);
  color: var(--sbv-white);
  font: 600 14px/1.4 Arial, Helvetica, sans-serif;
  text-align: center;
  text-transform: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.sbv-reviews .sbv-write:hover { background: var(--sbv-blue-dark); border-color: var(--sbv-blue-dark); }
.sbv-reviews .sbv-write svg { flex-shrink: 0; width: 17px; height: 17px; }

/* One grid: current-product reviews first, followed by other-product reviews. */
.sbv-reviews .sbv-group { margin-top: 32px; }

.sbv-reviews .sbv-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.sbv-reviews .sbv-card { display: flex; flex-direction: column; min-width: 0; padding: 23px; border: 1px solid var(--sbv-line); border-radius: 13px; background: var(--sbv-white); }

.sbv-reviews .sbv-card-top { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sbv-reviews .sbv-card-top .sbv-stars { font-size: 15px; letter-spacing: 1px; }

.sbv-reviews .sbv-card-text { margin-bottom: 12px; color: #4d636e; font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.sbv-reviews .sbv-author-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 15px; margin-top: auto; }

.sbv-reviews .sbv-person { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; }
.sbv-reviews .sbv-avatar { display: inline-flex; flex: 0 0 30px; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #edf3f5; color: #536f7b; font-size: 11px; font-weight: 600; }
.sbv-reviews .sbv-author { flex: 1 1 auto; min-width: 0; color: var(--sbv-ink); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbv-reviews .sbv-date { color: var(--sbv-muted); font-size: 11px; white-space: nowrap; }
.sbv-reviews .sbv-source { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 17px; padding: 12px 13px; border-radius: 7px; background: var(--sbv-soft); }
.sbv-reviews .sbv-source-label { flex: 0 0 auto; color: var(--sbv-muted); font-size: 11px; white-space: nowrap; }
.sbv-reviews .sbv-source a { display: block; flex: 1 1 0%; min-width: 0; padding: 3px 0; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbv-reviews .sbv-endnote { margin-top: 21px; color: var(--sbv-muted); font-size: 12px; text-align: center; }

@media (max-width: 960px) {
  .sbv-reviews .sbv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sbv-reviews .sbv-summary { grid-template-columns: 1fr 1fr; gap: 24px; padding: 25px; }
  .sbv-reviews .sbv-invite { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0 0; border-left: 0; border-top: 1px solid var(--sbv-line); }
  .sbv-reviews .sbv-write { flex-shrink: 0; margin-top: 0; }
  .sbv-reviews .sbv-card { padding: 20px; }
}

@media (max-width: 640px) {
  .sbv-reviews { margin: 32px auto; padding: 0 16px; }
  .sbv-reviews .sbv-heading { margin-bottom: 18px; }
  .sbv-reviews .sbv-summary { gap: 20px 15px; padding: 21px 18px; border-radius: 14px; }
  .sbv-reviews .sbv-score { font-size: 48px; }
  .sbv-reviews .sbv-score-max { font-size: 15px; }
  .sbv-reviews .sbv-score-block > .sbv-stars { font-size: 17px; letter-spacing: 1px; }
  .sbv-reviews .sbv-label { font-size: 11px; }
  .sbv-reviews .sbv-score-count { font-size: 12px; }
  .sbv-reviews .sbv-rating-row { grid-template-columns: 25px minmax(0, 1fr) 13px; gap: 6px; }
  .sbv-reviews .sbv-invite { display: block; padding-top: 19px; }
  .sbv-reviews .sbv-invite-title { font-size: 17px; }
  .sbv-reviews .sbv-invite-text { max-width: none; }
  .sbv-reviews .sbv-write { width: 100%; min-height: 48px; margin-top: 14px; }
  .sbv-reviews .sbv-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .sbv-reviews .sbv-group { margin-top: 27px; }

  .sbv-reviews .sbv-card { padding: 19px; }
  .sbv-reviews .sbv-card-top { margin-bottom: 12px; }

  .sbv-reviews .sbv-source a { padding-top: 13px; padding-bottom: 13px; }
  .sbv-reviews .sbv-endnote { text-align: left; }
}

@media (max-width: 359px) {
  .sbv-reviews .sbv-summary { grid-template-columns: minmax(0, 1fr); }
  .sbv-reviews .sbv-score-block { text-align: center; }
  .sbv-reviews .sbv-score-line { justify-content: center; }
  .sbv-reviews .sbv-breakdown { padding-top: 10px; border-top: 1px solid var(--sbv-line); }
}

@media (prefers-reduced-motion: reduce) {
  .sbv-reviews .sbv-write { transition: none; }
}

/* Integration: microdata, AJAX loading, empty state, pagination. */
.sbv-reviews .sbv-meta { display: none; }
.sbv-reviews .sbv-list { transition: opacity .2s ease; }
.sbv-reviews .sbv-list.sbv-loading { opacity: .45; pointer-events: none; }

.sbv-reviews .sbv-empty { padding: 26px 20px; border: 1px dashed var(--sbv-line); border-radius: 13px; background: var(--sbv-soft); color: var(--sbv-muted); text-align: center; }

.sbv-reviews .sbv-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.sbv-reviews .sbv-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sbv-line);
  border-radius: 9px;
  background: var(--sbv-white);
  color: var(--sbv-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.sbv-reviews a.sbv-page:hover { border-color: var(--sbv-blue); background: var(--sbv-blue-soft); color: var(--sbv-blue-dark); }
.sbv-reviews .sbv-page-active { border-color: var(--sbv-blue); background: var(--sbv-blue); color: var(--sbv-white); }
.sbv-reviews .sbv-page-gap { padding: 0 4px; color: var(--sbv-muted); }

@media (max-width: 640px) {
  .sbv-reviews .sbv-pagination { margin-top: 20px; }
  .sbv-reviews .sbv-page { min-width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .sbv-reviews .sbv-list,
  .sbv-reviews .sbv-page { transition: none; }
}

/* Review form under the summary. #bb-reviews raises specificity above the theme's form styles. */
#bb-reviews .sbv-form { margin-top: 16px; padding: 28px 30px; border: 1px solid var(--sbv-line); border-radius: 18px; background: var(--sbv-white); box-shadow: 0 8px 28px rgba(35, 57, 66, .035); }
#bb-reviews .sbv-form-closed { display: none; }
#bb-reviews .sbv-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
#bb-reviews .sbv-form-title { margin-bottom: 4px; color: var(--sbv-ink); font-size: 18px; font-weight: 600; line-height: 1.35; }
#bb-reviews .sbv-form-intro { max-width: 560px; color: var(--sbv-muted); font-size: 13px; }
#bb-reviews .sbv-form-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--sbv-line);
  border-radius: 50%;
  background: var(--sbv-white);
  color: var(--sbv-muted);
  font: 400 22px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#bb-reviews .sbv-form-close:hover { border-color: var(--sbv-blue); color: var(--sbv-blue-dark); }

#bb-reviews .sbv-form-alert:empty { display: none; }
#bb-reviews .sbv-form-alert { margin-bottom: 18px; padding: 11px 14px; border-radius: 9px; font-size: 13px; }
#bb-reviews .sbv-alert-error { border: 1px solid #f1c7c4; background: #fdf1f0; color: #a3322a; }
#bb-reviews .sbv-alert-success { border: 1px solid #bfe2cf; background: #eef8f2; color: #23694a; }

#bb-reviews .sbv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
#bb-reviews .sbv-field { min-width: 0; margin: 0; padding: 0; border: 0; }
#bb-reviews .sbv-field-full { grid-column: 1 / -1; }
#bb-reviews .sbv-field-label { display: block; float: none; width: auto; margin: 0 0 7px; padding: 0; border: 0; color: var(--sbv-ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
#bb-reviews .sbv-field-note { margin-top: 6px; color: var(--sbv-muted); font-size: 12px; }

#bb-reviews input.sbv-input,
#bb-reviews textarea.sbv-input {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 46px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid #d3dee3;
  border-radius: 9px;
  background: var(--sbv-white);
  box-shadow: none;
  color: var(--sbv-ink);
  font: 400 14px/1.5 Arial, Helvetica, sans-serif;
  transition: border-color .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
#bb-reviews textarea.sbv-input { min-height: 130px; resize: vertical; }
#bb-reviews input.sbv-input:focus,
#bb-reviews textarea.sbv-input:focus { border-color: var(--sbv-blue); box-shadow: 0 0 0 3px rgba(25, 127, 162, .14); outline: 0; }

/* Star rating: inputs are in order 5..1, row-reverse shows them as 1..5. */
#bb-reviews .sbv-rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; min-height: 46px; align-items: center; }
#bb-reviews .sbv-rate input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
#bb-reviews .sbv-rate label { display: inline-block; float: none; width: auto; margin: 0; padding: 0 2px; color: #c4cfd4; font-size: 30px; line-height: 1; cursor: pointer; transition: color .15s ease, transform .15s ease; }
#bb-reviews .sbv-rate label:hover,
#bb-reviews .sbv-rate label:hover ~ label,
#bb-reviews .sbv-rate input:checked ~ label { color: var(--sbv-star); }
#bb-reviews .sbv-rate label:hover { transform: scale(1.1); }
#bb-reviews .sbv-rate input:focus-visible + label { outline: 3px solid var(--sbv-blue); outline-offset: 2px; border-radius: 4px; }
#bb-reviews .sbv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#bb-reviews .sbv-captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
#bb-reviews .sbv-captcha input.sbv-input { flex: 0 1 200px; width: 200px; }
#bb-reviews .sbv-captcha img { display: block; flex: 0 0 auto; width: 150px; height: 35px; border-radius: 6px; background: var(--sbv-soft); }
#bb-reviews .sbv-captcha-refresh { padding: 6px 0; border: 0; background: none; color: var(--sbv-blue-dark); font: 600 12px/1.4 Arial, Helvetica, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

#bb-reviews .sbv-form-actions { margin-top: 22px; }
#bb-reviews .sbv-form-actions .sbv-write { margin-top: 0; }
#bb-reviews .sbv-write[disabled] { opacity: .65; cursor: default; }

@media (max-width: 640px) {
  #bb-reviews .sbv-form { padding: 21px 18px; border-radius: 14px; }
  #bb-reviews .sbv-form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #bb-reviews .sbv-captcha input.sbv-input { flex: 1 1 100%; width: 100%; }
  #bb-reviews .sbv-rate label { padding: 0 4px; font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  #bb-reviews input.sbv-input,
  #bb-reviews textarea.sbv-input,
  #bb-reviews .sbv-rate label { transition: none; }
}

/* Compact rating badge next to the price (replaces div.review in product.tpl). */
.sbv-badge {
  --sbv-blue: #197fa2;
  --sbv-blue-dark: #12627e;
  --sbv-blue-soft: #edf7fa;
  --sbv-ink: #233942;
  --sbv-muted: #65777f;
  --sbv-line: #e2e9ec;
  --sbv-star: #ffb400;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 14px 0;
  padding: 10px 16px;
  border: 1px solid var(--sbv-line);
  border-radius: 12px;
  background: linear-gradient(115deg, #f0f8fb 0%, #fff 70%);
  color: var(--sbv-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.sbv-badge *,
.sbv-badge *::before,
.sbv-badge *::after { box-sizing: border-box; }

.sbv-badge a { display: inline-flex; align-items: center; gap: 8px; color: var(--sbv-ink); text-decoration: none; cursor: pointer; }
.sbv-badge a:focus-visible { outline: 3px solid var(--sbv-blue); outline-offset: 3px; border-radius: 6px; }

.sbv-badge .sbv-badge-value { font-size: 20px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.sbv-badge .sbv-badge-stars { position: relative; display: inline-block; flex-shrink: 0; color: #c4cfd4; font-size: 17px; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.sbv-badge .sbv-badge-stars-fill { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; color: var(--sbv-star); }
.sbv-badge .sbv-badge-count { color: var(--sbv-muted); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .2s ease, text-decoration-color .2s ease; }
.sbv-badge .sbv-badge-score:hover .sbv-badge-count { color: var(--sbv-blue-dark); text-decoration-color: currentColor; }

.sbv-badge .sbv-badge-sep { width: 1px; height: 20px; background: var(--sbv-line); }

.sbv-badge .sbv-badge-write { gap: 6px; color: var(--sbv-blue-dark); font-weight: 600; transition: color .2s ease; }
.sbv-badge .sbv-badge-write:hover { color: var(--sbv-blue); }
.sbv-badge .sbv-badge-write svg { flex-shrink: 0; width: 15px; height: 15px; }

@media (max-width: 400px) {
  .sbv-badge .sbv-badge-sep { display: none; }
  .sbv-badge .sbv-badge-write { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sbv-badge .sbv-badge-count,
  .sbv-badge .sbv-badge-write { transition: none; }
}

/* Badge: "N+ happy customers" line and "/5" suffix. */
.sbv-badge .sbv-badge-happy { display: flex; flex-basis: 100%; align-items: center; gap: 7px; margin: 0; padding: 0; color: var(--sbv-blue-dark); font-size: 13px; font-weight: 600; line-height: 1.3; }
.sbv-badge .sbv-badge-happy strong { color: var(--sbv-ink); font-size: 15px; font-weight: 700; }
.sbv-badge .sbv-badge-happy svg { flex-shrink: 0; width: 17px; height: 17px; }
.sbv-badge .sbv-badge-max { margin-left: 1px; color: var(--sbv-muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
