/* Оценки и отзывы товара: звёзды, сводка, список, форма, страница «Отзывы». Стили модуля, не относятся к теме сайта.
   Цвета и формы меняются переменными: задайте их в css темы на .rv или :root. */
.rv,
.rv-rating {
	--rv-accent: #1d2130;
	--rv-accent-text: #fff;
	--rv-star: #f5a623;
	--rv-star-off: #d9dce5;
	--rv-border: #e3e5ec;
	--rv-soft: #f5f6f9;
	--rv-muted: #6b7183;
	--rv-danger: #c0392b;
	--rv-ok: #1e7e45;
	--rv-radius: 12px;
}
.rv { margin: 32px 0; color: inherit; }
.rv *,
.rv *::before,
.rv *::after { box-sizing: border-box; }

/* Звёзды: заливка задаётся процентом --rv-fill, форма -- маска из SVG */
.rv-stars {
	--rv-size: 16px;
	display: inline-block;
	flex: none;
	width: calc(var(--rv-size) * 5);
	height: var(--rv-size);
	vertical-align: middle;
	background: linear-gradient(90deg, var(--rv-star) var(--rv-fill, 0%), var(--rv-star-off) 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.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5l-5.9 3.2 1.2-6.6L2.5 9.5l6.6-.9z'/%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.5l2.9 6.1 6.6.9-4.8 4.6 1.2 6.6L12 17.5l-5.9 3.2 1.2-6.6L2.5 9.5l6.6-.9z'/%3E%3C/svg%3E") 0 0 / var(--rv-size) var(--rv-size) repeat-x;
}
.rv-stars--lg { --rv-size: 22px; }
.rv-star-ic { fill: var(--rv-star); flex: none; }

/* Короткая оценка рядом с названием или ценой */
.rv-rating {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	font-size: 14px;
	line-height: 1.3;
	color: inherit;
	text-decoration: none;
}
.rv-rating:hover .rv-rating-count { text-decoration: underline; }
.rv-rating-value { font-weight: 700; }
.rv-rating-count { color: var(--rv-muted); }
.rv-rating-dot { color: var(--rv-muted); }
.rv-rating--small { font-size: 13px; gap: 4px 6px; }
.rv-rating--small .rv-stars { --rv-size: 13px; }
.rv-rating--empty .rv-rating-count { text-decoration: underline; text-decoration-color: var(--rv-border); }

/* Заголовок блока */
.rv-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}
.rv-title { margin: 0; font-size: 24px; line-height: 1.25; }
.rv-h1 { margin: 12px 0 16px; font-size: 28px; line-height: 1.25; }

/* Кнопки */
.rv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	border: 1px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.rv-btn--primary { background: var(--rv-accent); color: var(--rv-accent-text); }
.rv-btn--primary:hover { opacity: .9; color: var(--rv-accent-text); }
.rv-btn--outline { background: #fff; border-color: var(--rv-border); color: var(--rv-accent); }
.rv-btn--outline:hover { border-color: var(--rv-accent); }
.rv-btn:focus-visible,
.rv-chip:focus-visible,
.rv-bar-row:focus-visible,
.rv-pager-item:focus-visible { outline: 2px solid var(--rv-accent); outline-offset: 2px; }
.rv-all { margin-top: 18px; }

/* Сводка: общая оценка и гистограмма */
.rv-summary {
	display: grid;
	grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
	gap: 20px 40px;
	align-items: center;
	padding: 20px 24px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
	background: var(--rv-soft);
}
.rv-score { text-align: center; }
.rv-score-num { font-size: 52px; font-weight: 800; line-height: 1; }
.rv-score .rv-stars { margin: 8px 0 6px; }
.rv-score-count { font-size: 14px; color: var(--rv-muted); }
.rv-score-empty { font-size: 16px; color: var(--rv-muted); }
.rv-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-bar-row {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) 36px;
	align-items: center;
	gap: 10px;
	padding: 2px 6px;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	font-size: 14px;
}
.rv-bar-row:hover,
.rv-bar-row.is-active { background: #fff; }
.rv-bar-label { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.rv-bar { height: 8px; border-radius: 999px; background: var(--rv-star-off); overflow: hidden; }
.rv-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--rv-star); }
.rv-bar-count { text-align: right; color: var(--rv-muted); }

/* Сортировка */
.rv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 6px; }
.rv-sorts { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-chip {
	display: inline-flex;
	align-items: center;
	padding: 7px 14px;
	border: 1px solid var(--rv-border);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font-size: 14px;
	text-decoration: none;
}
.rv-chip:hover { border-color: var(--rv-accent); }
.rv-chip.is-active { background: var(--rv-accent); border-color: var(--rv-accent); color: var(--rv-accent-text); }
.rv-chip--reset { border-style: dashed; }

/* Список */
.rv-list { margin-top: 10px; }
.rv-item { padding: 20px 0; border-bottom: 1px solid var(--rv-border); }
.rv-item:last-child { border-bottom: 0; }
.rv-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 6px; }
.rv-author { font-weight: 700; }
.rv-badge {
	padding: 2px 10px;
	border-radius: 999px;
	background: #e7f5ec;
	color: var(--rv-ok);
	font-size: 12px;
	font-weight: 600;
}
.rv-date { margin-left: auto; font-size: 13px; color: var(--rv-muted); }
.rv-item-rating { margin-bottom: 8px; }
.rv-text { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.rv-answer {
	margin-top: 12px;
	padding: 12px 16px;
	border-left: 3px solid var(--rv-accent);
	border-radius: 0 10px 10px 0;
	background: var(--rv-soft);
}
.rv-answer-title { margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--rv-muted); }
.rv-answer p { margin: 0; line-height: 1.55; }
.rv-empty { margin: 22px 0 0; color: var(--rv-muted); }

/* Страница отзывов */
.rv-page { margin-top: 10px; }
.rv-product {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 18px;
	margin-bottom: 28px;
	padding: 14px 18px;
	border: 1px solid var(--rv-border);
	border-radius: var(--rv-radius);
}
.rv-product-photo { flex: none; width: 72px; height: 72px; overflow: hidden; border-radius: 10px; background: var(--rv-soft); }
.rv-product-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rv-product-info { flex: 1 1 220px; min-width: 0; }
.rv-product-name { font-weight: 700; color: inherit; text-decoration: none; }
.rv-product-name:hover { text-decoration: underline; }

.rv-pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0 8px; }
.rv-pager-item,
.rv-pager-gap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 10px;
	color: inherit;
	text-decoration: none;
}
.rv-pager-item { border: 1px solid var(--rv-border); background: #fff; }
a.rv-pager-item:hover { border-color: var(--rv-accent); }
.rv-pager-item.is-current { background: var(--rv-accent); border-color: var(--rv-accent); color: var(--rv-accent-text); font-weight: 700; }

/* Форма */
.rv-form-slot,
.rv-form-wrap { margin-top: 22px; }
.rv-form-slot[hidden] { display: none; }
.rv-form-wrap { padding-top: 24px; border-top: 1px solid var(--rv-border); }
.rv-form { display: grid; gap: 16px; max-width: 620px; margin-top: 14px; }
.rv-field { display: grid; gap: 6px; }
.rv-label { font-weight: 600; font-size: 14px; }
.rv-hint { font-weight: 400; color: var(--rv-muted); }
.rv-input {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid #c9ccd8;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	color: inherit;
}
.rv-input:focus { outline: 2px solid var(--rv-accent); outline-offset: 1px; border-color: var(--rv-accent); }
.rv-input.is-invalid { border-color: var(--rv-danger); }
.rv-textarea { min-height: 120px; resize: vertical; }
.rv-input--code { width: 140px; }
.rv-counter { text-align: right; font-size: 12px; color: var(--rv-muted); }
.rv-error { min-height: 0; font-size: 13px; color: var(--rv-danger); }
.rv-error:empty { display: none; }
.rv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rv-captcha-row { display: flex; align-items: center; gap: 12px; }
.rv-captcha-box { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 120px; min-height: 40px; }
.rv-captcha-img { border-radius: 8px; border: 1px solid var(--rv-border); background: #fff; }
.rv-captcha-img[hidden] { display: none; }
.rv-captcha-refresh { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--rv-border); border-radius: 50%; background: #fff; color: var(--rv-muted); cursor: pointer; }
.rv-captcha-refresh:hover { color: var(--rv-accent); border-color: var(--rv-accent); }
.rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.rv-note { font-size: 13px; color: var(--rv-muted); }
.rv-result { font-weight: 600; }
.rv-result.is-ok { color: var(--rv-ok); }
.rv-result.is-fail { color: var(--rv-danger); }
.rv-result:empty { display: none; }
.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Выбор оценки: звёзды слева направо от 1 до 5, нажатые и всё левее закрашиваются */
.rv-rate-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rv-rate-input input { position: absolute; opacity: 0; pointer-events: none; }
.rv-rate-input label { display: inline-flex; padding: 4px; cursor: pointer; }
.rv-rate-input svg { fill: var(--rv-star-off); transition: fill .1s ease, transform .1s ease; }
.rv-rate-input label:hover svg { transform: scale(1.12); }
.rv-rate-input input:checked ~ label svg,
.rv-rate-input label:hover ~ label svg,
.rv-rate-input label:hover svg { fill: var(--rv-star); }
.rv-rate-input input:focus-visible + label { outline: 2px solid var(--rv-accent); outline-offset: 2px; border-radius: 8px; }

@media (max-width: 640px) {
	.rv { margin: 24px 0; }
	.rv-title { font-size: 21px; }
	.rv-h1 { font-size: 23px; }
	.rv-top .rv-btn { width: 100%; }
	.rv-summary { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
	.rv-score-num { font-size: 44px; }
	.rv-date { margin-left: 0; width: 100%; }
	.rv-product .rv-btn { width: 100%; }
	.rv-form { max-width: none; }
	.rv-rate-input label { padding: 6px; }
	.rv-rate-input svg { width: 34px; height: 34px; }
	.rv-actions .rv-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.rv-btn,
	.rv-rate-input svg { transition: none; }
}
