/* Відгуки на товари: сторінка «Оцініть свої покупки» (product_reviews/form), відкрита форма в попапі
   картки й доповнення до списку відгуків (бейдж, заголовок, фото, відповідь магазину).
   Окремий файл без .min — мініфікатор у проєкті не запускають. */

/* --- сторінка за токеном --- */
.rv-page {
  padding: 32px 0 64px;
}
.rv-page .container {
  max-width: 760px;
}
.rv-page__title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 500;
  color: #000;
}
.rv-intro {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.7);
}
.rv-bonus {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f8f8f6;
  font-size: 14px;
  line-height: 1.45;
}
.rv-note {
  margin-top: 24px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.5);
}

.rv-card {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #ececea;
  background: #fff;
  scroll-margin-top: 100px;
}
.rv-list--open .rv-card,
.rv-list--open .rv-card.is-done {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.rv-card.is-done {
  background: #f8f8f6;
}
.rv-card__product {
  display: flex;
  align-items: center;
  gap: 16px;
}
.rv-card__product a:first-child {
  flex: none;
}
.rv-card__product img {
  display: block;
  width: 72px;
  height: 100px;
  object-fit: cover;
}
.rv-card__name {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: #000;
}
.rv-card__name:hover {
  color: #876b46;
}
.rv-card__done,
.rv-thanks {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
}
.rv-thanks__title {
  font-weight: 500;
  font-size: 16px;
}
.rv-thanks[hidden],
.rv-form[hidden] {
  display: none;
}

/* --- поля --- */
.rv-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.rv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.rv-stars {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.rv-list--open .rv-stars {
  margin-top: 0;
}
.rv-stars legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #000;
}
.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: 2px;
  cursor: pointer;
  fill: #dcdcd8;
  transition: fill 0.2s;
}
.rv-stars label svg {
  display: block;
  width: 36px;
  height: 36px;
}
/* row-reverse: «наступні» в DOM зірки стоять ліворуч, тож ~ підсвічує всі до вибраної */
.rv-stars input:checked ~ label,
.rv-stars label:hover,
.rv-stars label:hover ~ label {
  fill: #876b46;
}
.rv-stars input:focus-visible + label {
  outline: 1px solid #876b46;
  outline-offset: -2px;
}
.rv-stars__caption {
  min-height: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
}

/* решта полів з'являється після вибору зірки: перший крок — один тап */
.rv-more {
  display: none;
}
.rv-form.is-rated .rv-more {
  display: block;
}
.rv-label {
  display: block;
  margin: 18px 0 6px;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(0, 0, 0, 0.7);
}
.rv-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid #c4c4c4;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  color: #000;
  transition: border-color 0.2s;
}
.rv-input:focus {
  outline: 0;
  border-bottom-color: #876b46;
}
.rv-textarea {
  height: 110px;
  padding: 10px 8px;
  resize: vertical;
  line-height: 1.45;
}
.rv-email-field[hidden] {
  display: none;
}

/* посадка: 5 кнопок; на мобайлі — 5 точок на лінії */
.rv-fit,
.rv-chips {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}
.rv-fit legend,
.rv-chips legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #000;
}
.rv-optional {
  font-weight: 400;
  color: rgba(0, 0, 0, 0.45);
}
.rv-fit input,
.rv-chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rv-fit__row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.rv-fit__row label,
.rv-chips__row label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 4px;
  border: 1px solid #dccebb;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  color: #433623;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.rv-fit input:checked + label,
.rv-chips input:checked + label {
  border-color: #000;
  background: #000;
  color: #fff;
}
.rv-fit input:focus-visible + label,
.rv-chips input:focus-visible + label {
  outline: 1px solid #876b46;
  outline-offset: 1px;
}
.rv-fit__ends,
.rv-fit__value {
  display: none;
}
.rv-fit__hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.55);
}
.rv-fit.is-set .rv-fit__hint {
  color: #876b46;
}
.rv-chips__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rv-chips__row label {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}
.rv-input--short {
  max-width: 140px;
}
.rv-author-line {
  margin: 18px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.7);
}
.rv-author-line b {
  font-weight: 500;
  color: #000;
}
.rv-author-edit {
  color: #876b46;
  text-decoration: underline;
}
.rv-author-line[hidden],
.rv-author-field[hidden] {
  display: none;
}
.rv-card__size {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}

.rv-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rv-photos__item,
.rv-photos__add {
  position: relative;
  width: 80px;
  height: 80px;
}
.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;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}
.rv-photos__add {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px dashed #c4c4c4;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: #433623;
  cursor: pointer;
}
.rv-photos__add:hover {
  border-color: #876b46;
}
.rv-photos__add[hidden] {
  display: none;
}
.rv-photos__add input {
  display: none;
}

.rv-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #eb5757;
}
.rv-submit {
  width: 100%;
  margin-top: 4px;
}

.rv-google,
.rv-all-done,
.rv-empty {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #ececea;
  background: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.rv-google[hidden],
.rv-all-done[hidden] {
  display: none;
}
.rv-google__title {
  font-size: 17px;
  font-weight: 500;
}
.rv-google p,
.rv-all-done p,
.rv-empty p {
  margin: 0 0 16px;
}
.rv-empty {
  margin-top: 40px;
}
.rv-empty .rv-page__title {
  font-size: 22px;
}

/* --- попап картки --- */
.popup-container .rv-list--open {
  margin-top: 8px;
  text-align: left;
}

/* --- список відгуків на картці --- */
.review-line .rv-verified {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 400;
  color: #876b46;
}
.review-line .rv-verified:before {
  content: "✓ ";
}
.rv-fit-line {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(0, 0, 0, 0.55);
}
.rv-fitbar {
  margin-bottom: 20px;
}
.rv-fitbar__title {
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
}
.rv-fitbar__track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}
.rv-fitbar__track span {
  height: 4px;
  background: #f0eee9;
}
.rv-fitbar__track .is-some {
  background: #c4b8a2;
}
.rv-fitbar__track .is-top {
  background: #000;
}
.rv-fitbar__labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.55);
}
.card-fit-advice {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.5);
}
.card-fit-advice.is-own:before {
  content: "✓ ";
}
.rv-item-title {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: #000;
}
.review-line .text {
  word-break: normal;
  overflow-wrap: anywhere;
}
.rv-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.rv-strip a,
.rv-strip img {
  display: block;
  width: 64px;
  height: 64px;
}
.rv-strip img {
  object-fit: cover;
}
.rv-reply {
  margin-top: 14px;
  padding: 12px 14px;
  background: #f8f8f6;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.8);
}
.rv-reply__head {
  margin-bottom: 4px;
  color: #000;
}
.rv-list-note {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.5);
}
.detail-card-rate {
  cursor: pointer;
}

@media (max-width: 767px) {
  .rv-page {
    padding: 20px 0 48px;
  }
  .rv-page__title {
    font-size: 22px;
  }
  .rv-card {
    padding: 16px;
  }
  .rv-stars label svg {
    width: 40px;
    height: 40px;
  }
  /* п'ять підписів на 350 px не вміщаються: точки на лінії, краї шкали і обране значення під нею */
  .rv-fit__row {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
  }
  .rv-fit__row:before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    top: 50%;
    height: 1px;
    background: #c4c4c4;
  }
  .rv-fit__row label {
    position: relative;
    width: 28px;
    min-height: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .rv-fit__row label span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .rv-fit__row label:before {
    content: "";
    width: 16px;
    height: 16px;
    border: 1px solid #876b46;
    border-radius: 50%;
    background: #fff;
  }
  .rv-fit input:checked + label {
    background: transparent;
  }
  .rv-fit input:checked + label:before {
    width: 22px;
    height: 22px;
    border-color: #000;
    background: #000;
  }
  .rv-fit__ends {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
  }
  .rv-fit__value {
    display: block;
    min-height: 20px;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: #000;
  }
}
