/* Отзывы на карточке товара — как у Wildberries: оценка, лента фото/видео, карусель карточек со стрелками */

.rv {
    --rv-gap: 1.6rem; --rv-radius: 1.6rem; --rv-muted: #808093; --rv-star: #ff9900;
    --rv-shadow: 0 .2rem 1.6rem rgba(0, 0, 0, .08);
    --rv-accent: var(--theme-primary-color, #a73afd);
    --rv-accent-light: color-mix(in srgb, var(--rv-accent) 12%, #fff);
}

.rv__head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; margin-bottom: 2rem; }
.rv__score { display: flex; align-items: center; gap: 1.2rem; }
.rv__score-num { font-size: 3.4rem; line-height: 3.8rem; }
.rv__score-meta { display: flex; flex-direction: column; gap: .2rem; }
.rv__count { color: var(--rv-muted); font-size: 1.4rem; }
.rv__write { margin-left: auto; }

/* Звёзды с дробной заливкой: --rv-fill = рейтинг / 5 * 100% */
.rv__stars {
    --rv-fill: 0%;
    display: inline-block; font-size: 2rem; line-height: 1; letter-spacing: .2rem; white-space: nowrap;
    background: linear-gradient(90deg, var(--rv-star) var(--rv-fill), #e3e4ec var(--rv-fill));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rv__stars::before { content: "★★★★★"; }
.rv__stars--sm { font-size: 1.8rem; letter-spacing: .1rem; }

/* Карусель: дорожка со скрытым скроллом + круглые стрелки, у краёв стрелка прячется */
.rv__slider { position: relative; }
.rv__strip, .rv__cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.rv__strip::-webkit-scrollbar, .rv__cards::-webkit-scrollbar { display: none; }
.rv__arrow {
    position: absolute; top: 50%; z-index: 2; width: 4.8rem; height: 4.8rem; margin-top: -2.4rem; padding: 0;
    border: 0; border-radius: 50%; background: #fff; box-shadow: var(--rv-shadow); cursor: pointer;
    transition: opacity .2s;
}
.rv__arrow::before {
    content: ""; position: absolute; top: 50%; left: 50%; width: 1rem; height: 1rem; margin: -.5rem 0 0 -.7rem;
    border: solid #242429; border-width: .2rem .2rem 0 0; transform: rotate(45deg);
}
.rv__arrow--prev { left: -1.2rem; }
.rv__arrow--prev::before { margin-left: -.3rem; transform: rotate(-135deg); }
.rv__arrow--next { right: -1.2rem; }
.rv__slider.is-start .rv__arrow--prev, .rv__slider.is-end .rv__arrow--next { opacity: 0; pointer-events: none; }

/* Лента медиа */
.rv__media { display: flex; flex-direction: column; margin-bottom: 1.6rem; }
.rv__media-all { align-self: flex-end; margin-bottom: 1.2rem; color: var(--rv-muted); font-size: 1.6rem; text-decoration: none; }
.rv__media-all:hover { color: var(--rv-accent); }
.rv__strip { gap: .8rem; }
.rv__thumb { position: relative; flex: none; display: block; width: 8.4rem; height: 11.2rem; border-radius: 1.2rem; overflow: hidden; background: #f5f6fa; scroll-snap-align: start; }
.rv__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv__thumb--sm { width: 5.4rem; height: 7.2rem; border-radius: .8rem; }
.rv__thumb--video::before {
    content: ""; position: absolute; top: 50%; left: 50%; width: 3.6rem; height: 3.6rem; margin: -1.8rem 0 0 -1.8rem;
    border-radius: 50%; background: rgba(0, 0, 0, .45);
}
.rv__thumb--video::after {
    content: ""; position: absolute; top: 50%; left: 50%; margin: -.7rem 0 0 -.4rem;
    border-style: solid; border-width: .7rem 0 .7rem 1.1rem; border-color: transparent transparent transparent #fff;
}
.rv__thumb--sm.rv__thumb--video::before { width: 2.6rem; height: 2.6rem; margin: -1.3rem 0 0 -1.3rem; }
.rv__thumb--sm.rv__thumb--video::after { margin: -.5rem 0 0 -.3rem; border-width: .5rem 0 .5rem .8rem; }

/* Секция отзывов — отдельный блок сразу после SKU, оформлен как аккордеоны .details */
.rv-section { background: #fff; border-radius: 10px; padding: 4rem; margin-bottom: 3rem; }
@media (max-width: 767px) { .rv-section { padding: 2rem 1.6rem; } }

/* Карточки: тонкая рамка */
.rv__cards { list-style: none; gap: var(--rv-gap); margin: 0; padding: 0; }
.rv-card {
    flex: 0 0 46.4rem; max-width: calc(100% - 4rem); display: flex; flex-direction: column; gap: 1.2rem; scroll-snap-align: start;
    background: #fff; border-radius: var(--rv-radius); padding: 2.8rem; border: 1px solid #e3e4ec;
}
.rv-card__head { display: flex; align-items: center; gap: .8rem; font-size: 1.4rem; line-height: 2rem; }
.rv-card__author { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-card__date { color: var(--rv-muted); font-size: 1.4rem; white-space: nowrap; }
.rv-card__head .rv__stars { margin-left: auto; }
.rv-card__body { flex: 1; display: flex; flex-direction: column; gap: 1rem; font-size: 1.4rem; line-height: 2rem; }
.rv-card__text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rv-card__tags-title { display: block; color: #8f8fa3; margin-bottom: .4rem; }

/* Теги отзыва — серые плашки, как у WB */
.rv-tags { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0; padding: 0; }
.rv-tag {
    display: inline-block; background: #f1f1f5; color: #868695; border-radius: .4rem;
    padding: .2rem .6rem; font-size: 1.2rem; line-height: 1.6rem; text-transform: uppercase;
}

/* Теги в форме — чипы-переключатели */
.rv-tags--form { gap: .8rem; margin: .4rem 0 1.6rem; }
.rv-tag-check { margin: 0; cursor: pointer; }
.rv-tag-check input { position: absolute; opacity: 0; pointer-events: none; }
.rv-tag-check .rv-tag {
    padding: .8rem 1.4rem; border-radius: 2rem; font-size: 1.4rem; line-height: 1.8rem; text-transform: none;
    color: #242429; border: 1px solid transparent; transition: background .15s, color .15s;
}
.rv-tag-check:hover .rv-tag { border-color: #c9cbd8; }
.rv-tag-check input:checked + .rv-tag { background: var(--theme-primary-color, #000); color: #fff; }
.rv-tag-check input:focus-visible + .rv-tag { outline: 2px solid var(--theme-primary-color, #000); outline-offset: 2px; }
.rv-card__answer { background: #f5f6fa; border-radius: 1.2rem; padding: 1.2rem 1.6rem; font-size: 1.4rem; }
.rv-card__answer p { margin: .4rem 0 0; }
.rv-card__foot { display: none; gap: .8rem; }

.rv__all {
    margin-top: .8rem; height: 5.2rem; padding: 0 2.4rem; border: 0; border-radius: 1.2rem;
    background: var(--rv-accent-light); color: var(--rv-accent); font-size: 1.6rem;
}
.rv__all:hover { background: color-mix(in srgb, var(--rv-accent) 20%, #fff); color: var(--rv-accent); }
.rv__pagination { display: none; }

/* «Вижте всички отзиви» — карусель раскрывается в сетку: тексты и медиа целиком, лайки, пагинация */
.rv.is-expanded .rv__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(34rem, 1fr)); overflow: visible; }
.rv.is-expanded .rv-card { max-width: none; }
.rv.is-expanded .rv__cards ~ .rv__arrow { display: none; }
.rv.is-expanded .rv-card__text { -webkit-line-clamp: unset; display: block; }
.rv.is-expanded .rv-card__foot { display: flex; }
.rv.is-expanded .rv__pagination { display: block; }

@media (max-width: 767px) {
    .rv__arrow { display: none; }
    .rv-card { flex-basis: 30rem; padding: 2rem; }
    .rv__media-all { align-self: flex-start; font-size: 1.4rem; }
}

.rv__login { margin-top: 1.6rem; color: var(--rv-muted); }

/* Форма в попапе */
.rv-form { width: 100%; max-width: 56rem; }
/* Отправка: лоадер поверх формы блокирует повторные клики; после успеха — «спасибо» вместо формы */
#rv-form { position: relative; }
.rv-form__loader {
    display: none; position: absolute; inset: 0; z-index: 5; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .75); border-radius: inherit; cursor: wait;
}
.rv-form__spinner {
    width: 4.4rem; height: 4.4rem; border-radius: 50%;
    border: .4rem solid #e3e4ec; border-top-color: var(--theme-primary-color, #000);
    animation: rv-spin .8s linear infinite;
}
@keyframes rv-spin { to { transform: rotate(360deg); } }
#rv-form.is-sending .rv-form__loader { display: flex; }
.rv-form__thanks { display: none; flex-direction: column; align-items: center; text-align: center; gap: 1.2rem; padding: 3.2rem 1.6rem; font-size: 1.8rem; }
.rv-form__thanks-icon {
    display: flex; align-items: center; justify-content: center; width: 5.6rem; height: 5.6rem; border-radius: 50%;
    background: var(--theme-primary-color, #000); color: #fff; font-size: 2.8rem;
}
#rv-form.is-sent .rv-form__thanks { display: flex; }
#rv-form.is-sent form, #rv-form.is-sent .popup__title { display: none; }
.rv-upload {
    display: flex; align-items: center; gap: 1.2rem; cursor: pointer; margin: .4rem 0 1rem;
    border: 1px dashed #c9cbd8; border-radius: 1.2rem; padding: 1.2rem 1.6rem; transition: border-color .2s;
}
.rv-upload:hover { border-color: var(--theme-primary-color, #000); }
.rv-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.rv-upload__plus {
    flex: none; width: 4.4rem; height: 4.4rem; border-radius: 1rem; background: #f5f6fa;
    display: flex; align-items: center; justify-content: center; font-size: 2.4rem; line-height: 1;
}
.rv-upload__text small { display: block; color: var(--rv-muted, #8b8fa3); font-size: 1.2rem; }
.rv-upload__preview { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.rv-upload__preview:empty { display: none; }
.rv-upload__item { position: relative; width: 6.4rem; height: 6.4rem; border-radius: .8rem; overflow: hidden; background: #f5f6fa; }
.rv-upload__item img, .rv-upload__item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-upload__remove {
    position: absolute; top: .2rem; right: .2rem; width: 2rem; height: 2rem; border: 0; border-radius: 50%;
    background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.4rem; line-height: 2rem; padding: 0; cursor: pointer;
}

@media (max-width: 767px) {
    .rv-card { flex-basis: 85%; }
    .rv__write { margin-left: 0; width: 100%; }
}
