/* Відгуки на товари: зірки, блок на картці товару (reytel/review_block) і форма за токеном (reytel/review). */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Зірки: одна смуга, заповнення через --rv-fill ---------- */
.rv-rating {
  --rv-size: 18px;
  display: inline-block;
  width: calc(var(--rv-size) * 5);
  height: var(--rv-size);
  background: linear-gradient(90deg, var(--text-color-black) var(--rv-fill, 0%), #d0d0d0 var(--rv-fill, 0%));
  -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.8l2.8 5.9 6.4.8-4.7 4.4 1.2 6.4L12 17.2l-5.7 3.1 1.2-6.4-4.7-4.4 6.4-.8z'/%3E%3C/svg%3E") 0 0 / var(--rv-size) var(--rv-size) repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.8l2.8 5.9 6.4.8-4.7 4.4 1.2 6.4L12 17.2l-5.7 3.1 1.2-6.4-4.7-4.4 6.4-.8z'/%3E%3C/svg%3E") 0 0 / var(--rv-size) var(--rv-size) repeat-x;
  vertical-align: middle;
}
.rv-rating--sm {
  --rv-size: 14px;
}

.rv-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--label-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rv-label {
  display: block;
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.rv-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--label-color);
}

.rv-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rv-strip img {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: cover;
}
.rv-item .rv-strip img {
  width: 72px;
  height: 72px;
}

/* ---------- Блок на картці товару (як Judge.me на reytel.com) ---------- */
.product-detail .rv-block,
.rv-block {
  display: block;
  max-width: 1400px;
  padding-top: var(--sp-xl);
  scroll-margin-top: 80px;
}
.rv-panel {
  background: #fff;
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
}
.rv-panel--head {
  padding: 40px 24px;
  text-align: center;
}
.rv-block__title {
  margin: 0 0 28px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.rv-panel__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.rv-panel__sep {
  align-self: stretch;
  width: 1px;
  background: var(--border-color);
}
.rv-summary {
  text-align: left;
}
.rv-summary__line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}
.rv-summary__based {
  margin-top: 4px;
  font-size: 16px;
  color: var(--label-color);
}
.rv-write-btn {
  min-width: 260px;
}
.rv-list--open {
  max-width: 720px;
  margin: 24px auto 0;
}
.rv-list--open .rv-card {
  margin-top: 0;
  text-align: left;
}
.rv-email-field[hidden] {
  display: none;
}
.rv-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.rv-panel--sort {
  margin-top: 24px;
  padding: 14px 18px;
}
.rv-sort {
  padding: 4px 28px 4px 0;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2315161a' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right center;
  font-size: 16px;
  color: var(--text-color-black);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* Картки сіткою по рядках (новіші — зліва направо), як на reytel.com */
.rv-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
  margin: 24px 0;
  transition: opacity var(--transition-1);
}
.rv-block.is-loading .rv-items {
  opacity: 0.4;
}
.rv-item {
  padding: 20px;
  background: #fff;
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
}
.rv-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rv-item__date {
  font-size: 14px;
  color: var(--label-color);
}
.rv-item__author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 17px;
}
.rv-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  background: var(--background-color);
}
.rv-avatar.is-verified::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 12px;
  height: 12px;
  background: var(--text-color-black) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.5'/%3E%3C/svg%3E") no-repeat center / 9px;
}
.rv-badge {
  padding: 2px 6px;
  background: var(--text-color-black);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
}
.rv-item__title {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 600;
}
.rv-item__text {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.6;
}
.rv-item .rv-strip {
  margin-top: 14px;
  flex-wrap: wrap;
}
.rv-item__reply {
  margin-top: 18px;
  padding: 16px 18px;
  background: #e8e8e8;
  font-size: 15px;
  line-height: 1.6;
}
.rv-item__reply p {
  margin: 0;
}
.rv-item__reply .rv-item__reply-head {
  margin-bottom: 6px;
}
.rv-more-wrap {
  text-align: center;
}
.rv-more-btn[hidden] {
  display: none;
}

/* ---------- Форма за токеном ---------- */
.rv-page {
  padding: 32px 0 var(--sp-xl);
}
.rv-page .container {
  max-width: 720px;
}
.rv-head .h2 {
  margin-bottom: 12px;
}
.rv-intro {
  color: var(--label-color);
}
.rv-bonus {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--background-color);
  font-size: 14px;
}
.rv-card {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border-color);
  scroll-margin-top: 90px;
}
.rv-card__product {
  display: flex;
  align-items: center;
  gap: 16px;
}
.rv-card__product img {
  width: 80px;
  height: 96px;
  object-fit: cover;
}
/* pl-transition.css іде після цього файлу й гасить підкреслення посилань — звідси подвійний клас */
.rv-card__product .rv-card__name {
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rv-card__product a:first-child {
  flex: none;
}
.rv-card__done,
.rv-thanks {
  margin-top: 16px;
}
.rv-thanks__title {
  font-weight: 600;
}
.rv-card.is-done {
  background: var(--background-color);
}

.rv-stars {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.rv-stars legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.rv-stars__row {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}
.rv-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rv-stars label {
  display: block;
  padding: 4px;
  cursor: pointer;
  fill: #d0d0d0;
  transition: fill var(--transition-1);
}
.rv-stars label svg {
  display: block;
  width: 40px;
  height: 40px;
}
/* row-reverse: «наступні» в DOM зірки стоять ліворуч, тож ~ підсвічує всі до вибраної */
.rv-stars input:checked ~ label,
.rv-stars label:hover,
.rv-stars label:hover ~ label {
  fill: var(--text-color-black);
}
.rv-stars input:focus-visible + label {
  outline: 1px solid #c8c8c8;
  outline-offset: -2px;
}
.rv-stars__caption {
  min-height: 20px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--label-color);
}

/* Решта полів з'являється після вибору зірки: перший крок — один тап */
.rv-more {
  display: none;
}
.rv-form.is-rated .rv-more {
  display: block;
}

.rv-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rv-photos__item,
.rv-photos__add {
  position: relative;
  width: 88px;
  height: 88px;
}
.rv-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rv-photos__item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 24px;
  height: 24px;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  line-height: 24px;
  cursor: pointer;
}
.rv-photos__add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px dashed #bdbdbd;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}
.rv-photos__add[hidden] {
  display: none;
}
.rv-photos__add input {
  display: none;
}

.rv-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 14px;
  color: #c62828;
}
.rv-submit {
  width: 100%;
  margin-top: 8px;
}

.rv-google,
.rv-all-done,
.rv-empty {
  margin-top: 32px;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border-color);
}
.rv-google[hidden],
.rv-all-done[hidden] {
  display: none;
}
.rv-google__title {
  font-weight: 600;
  font-size: 18px;
}
.rv-google p,
.rv-empty p,
.rv-all-done p {
  margin: 0 0 16px;
}
.rv-google__btn,
.rv-all-done .button-contained,
.rv-empty .button-contained {
  display: inline-flex;
}

@media (max-width: 1023px) {
  .rv-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  .rv-card {
    padding: 16px;
  }
  .rv-panel--head {
    padding: 28px 16px;
  }
  .rv-block__title {
    font-size: 22px;
    margin-bottom: 20px;
  }
  .rv-panel__row {
    flex-direction: column;
    gap: 20px;
  }
  .rv-panel__sep {
    display: none;
  }
  .rv-summary {
    text-align: center;
  }
  .rv-summary__line {
    justify-content: center;
  }
  .rv-write-btn {
    width: 100%;
    min-width: 0;
  }
  .rv-items {
    grid-template-columns: minmax(0, 1fr);
  }
}
