/* SW All Reviews — страница всех отзывов */
.swr {
	--swr-gap: 20px;
	--swr-radius: 12px;
	--swr-border: rgba(0, 0, 0, .08);
	--swr-muted: rgba(0, 0, 0, .5);
	--swr-text: inherit;
	--swr-star: #f5a623;
	--swr-star-bg: rgba(0, 0, 0, .12);
	--swr-accent: var(--wd-primary-color, #1a1a1a);
	--swr-card-bg: #fff;
	--swr-reply-bg: rgba(0, 0, 0, .035);
	--swr-clamp: 7;
	color: var(--swr-text);
	line-height: 1.5;
}
.swr__title {
	margin: 0 0 24px;
}

/* Сводка */
.swr__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 24px 48px;
	margin: 0 0 32px;
	padding: 24px 28px;
	border: 1px solid var(--swr-border);
	border-radius: var(--swr-radius);
	background: var(--swr-card-bg);
}
.swr__summary-main {
	display: flex;
	align-items: center;
	gap: 16px;
}
.swr__avg {
	font-size: 56px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -.02em;
}
.swr__avg-meta .swr__stars {
	font-size: 22px;
}
.swr__avg-count {
	margin-top: 6px;
	font-size: 14px;
	color: var(--swr-muted);
}
.swr__bars {
	flex: 1 1 260px;
	max-width: 420px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.swr__bar {
	display: grid;
	grid-template-columns: 34px 1fr 40px;
	align-items: center;
	gap: 10px;
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--swr-muted);
}
.swr__bar-label {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: var(--swr-star);
	font-weight: 600;
}
.swr__bar-track {
	display: block;
	height: 8px;
	border-radius: 4px;
	background: var(--swr-star-bg);
	overflow: hidden;
}
.swr__bar-fill {
	display: block;
	height: 100%;
	border-radius: 4px;
	background: var(--swr-star);
}
.swr__bar-count {
	text-align: right;
}

/* Звёзды */
.swr__stars {
	position: relative;
	display: inline-block;
	font-size: 16px;
	line-height: 1;
	white-space: nowrap;
	vertical-align: middle;
}
.swr__stars svg {
	width: 1em;
	height: 1em;
	margin-right: 2px;
	vertical-align: top;
}
.swr__stars-bg {
	color: var(--swr-star-bg);
}
.swr__stars-fg {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: var(--swr-star);
}

/* Сетка карточек */
.swr__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--swr-gap);
	margin: 0;
}
.swr--cols-1 .swr__grid { grid-template-columns: minmax(0, 1fr); }
.swr--cols-2 .swr__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.swr--cols-4 .swr__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.swr__card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px 24px;
	border: 1px solid var(--swr-border);
	border-radius: var(--swr-radius);
	background: var(--swr-card-bg);
	transition: box-shadow .2s ease, transform .2s ease;
}
.swr__card:hover {
	box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
}
.swr__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.swr__avatar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: hsl(var(--swr-hue, 200), 45%, 92%);
	color: hsl(var(--swr-hue, 200), 45%, 35%);
	font-weight: 600;
	font-size: 17px;
}
.swr__who {
	flex: 1 1 auto;
	min-width: 0;
}
.swr__author {
	display: flex;
	align-items: center;
	gap: 4px;
	font-weight: 600;
}
.swr__verified {
	display: inline-flex;
	color: #2e9e5b;
}
.swr__date {
	display: block;
	font-size: 13px;
	color: var(--swr-muted);
}
.swr__head .swr__stars {
	flex: 0 0 auto;
}

/* Текст с ограничением высоты и «Читати далі» */
.swr__text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--swr-clamp);
	overflow: hidden;
	overflow-wrap: anywhere;
}
.swr__text p {
	margin: 0 0 .6em;
}
.swr__text p:last-child {
	margin-bottom: 0;
}
.swr__card.is-expanded .swr__text {
	display: block;
	-webkit-line-clamp: unset;
}
.swr__more {
	align-self: flex-start;
	margin: -4px 0 0;
	padding: 0 !important;
	border: 0;
	background: none !important;
	box-shadow: none;
	color: var(--swr-accent);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-transform: none;
	cursor: pointer;
	min-height: 0;
}
.swr__more:hover {
	text-decoration: underline;
}
.swr__more[hidden] {
	display: none;
}

.swr__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.swr__tags li {
	margin: 0;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--swr-reply-bg);
	font-size: 12px;
	color: var(--swr-muted);
}

.swr__reply {
	padding: 12px 14px;
	border-radius: 8px;
	background: var(--swr-reply-bg);
	font-size: 14px;
}
.swr__reply-head {
	margin-bottom: 4px;
}
.swr__reply-author {
	font-weight: 600;
}
.swr__reply-label {
	color: var(--swr-muted);
	font-size: 12px;
}
.swr__reply-text p {
	margin: 0 0 .5em;
}
.swr__reply-text p:last-child {
	margin: 0;
}

.swr__product {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--swr-border);
	color: inherit;
	text-decoration: none;
	font-size: 14px;
}
.swr__product:hover .swr__product-name {
	color: var(--swr-accent);
}
.swr__product-img,
.swr__product img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 8px;
	border: 1px solid var(--swr-border);
	background: #fff;
}
.swr__product-name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	transition: color .15s ease;
}

.swr__empty {
	text-align: center;
	color: var(--swr-muted);
}

/* Подгрузка */
.swr__more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 32px 0 0;
	min-height: 48px;
}
.swr .swr__load {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 28px;
	border: 1px solid var(--swr-accent);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--swr-accent);
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.swr .swr__load:hover {
	background: var(--swr-accent);
	color: #fff;
}
.swr .swr__load:disabled,
.swr .swr__load.is-loading {
	opacity: .5;
	cursor: default;
}
.swr .swr__load[hidden],
.swr__loader[hidden],
.swr__end[hidden] {
	display: none;
}
.swr__loader {
	width: 22px;
	height: 22px;
	border: 2px solid var(--swr-star-bg);
	border-top-color: var(--swr-accent);
	border-radius: 50%;
	animation: swr-spin .8s linear infinite;
}
@keyframes swr-spin {
	to { transform: rotate(360deg); }
}
.swr__end {
	margin: 0;
	font-size: 14px;
	color: var(--swr-muted);
}

/* Пагинация (load="pages" и noscript) */
.swr__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 32px 0 0;
}
.swr__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--swr-border);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	font-size: 14px;
	transition: border-color .15s ease, color .15s ease;
}
.swr__pagination a.page-numbers:hover {
	border-color: var(--swr-accent);
	color: var(--swr-accent);
}
.swr__pagination .page-numbers.current {
	border-color: var(--swr-accent);
	background: var(--swr-accent);
	color: #fff;
}
.swr__pagination .page-numbers.dots {
	border: 0;
}

/* Планшет: не больше двух колонок */
@media (max-width: 1024px) {
	.swr--cols-3 .swr__grid,
	.swr--cols-4 .swr__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Телефон: одна колонка, компактная сводка */
@media (max-width: 640px) {
	.swr .swr__grid { grid-template-columns: minmax(0, 1fr); }
	.swr { --swr-gap: 14px; }
	.swr__summary {
		flex-direction: column;
		align-items: stretch;
		gap: 18px;
		padding: 18px;
	}
	.swr__summary-main { justify-content: center; }
	.swr__avg { font-size: 44px; }
	.swr__bars { flex: 0 0 auto; max-width: none; }
	.swr__card { padding: 16px; gap: 10px; }
	.swr__avatar { width: 38px; height: 38px; font-size: 15px; }
	.swr__head .swr__stars { flex-basis: 100%; }
	.swr__pagination .page-numbers { min-width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
	.swr__card, .swr__more, .swr__product-name { transition: none; }
}

/* ================= Карусель [sw_reviews_slider] ================= */
.swrs {
	--swrs-pv: 3;
	--swr-clamp: 6;
	position: relative;
}
.swrs--pv-1 { --swrs-pv: 1; }
.swrs--pv-2 { --swrs-pv: 2; }
.swrs--pv-4 { --swrs-pv: 4; }
.swrs__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin: 0 0 20px;
}
.swrs__title {
	margin: 0;
}
.swrs__all {
	color: var(--swr-accent);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}
.swrs__all:hover {
	text-decoration: underline;
}
.swrs__viewport {
	position: relative;
}
.swrs__track {
	display: flex;
	gap: var(--swr-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 4px 2px 6px;   /* место под тень карточек */
	margin: -4px -2px -6px;
	outline: none;
}
.swrs__track::-webkit-scrollbar {
	display: none;
}
.swrs__track:focus-visible {
	box-shadow: 0 0 0 2px var(--swr-accent);
	border-radius: var(--swr-radius);
}
.swrs__slide {
	flex: 0 0 calc((100% - var(--swr-gap) * (var(--swrs-pv) - 1)) / var(--swrs-pv));
	min-width: 0;
	display: flex;
	scroll-snap-align: start;
}
.swrs__slide .swr__card {
	width: 100%;
}
.swrs .swr__more {
	display: none;
}

/* Стрелки */
.swrs .swrs__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid var(--swr-border);
	border-radius: 50%;
	background: var(--swr-card-bg);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	color: inherit;
	cursor: pointer;
	transform: translateY(-50%);
	transition: color .15s ease, border-color .15s ease, opacity .15s ease;
}
.swrs .swrs__arrow:hover {
	color: var(--swr-accent);
	border-color: var(--swr-accent);
}
.swrs .swrs__arrow:disabled {
	opacity: .35;
	cursor: default;
}
.swrs__arrow--prev { left: -22px; }
.swrs__arrow--next { right: -22px; }

/* Точки */
.swrs__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 18px 0 0;
}
.swrs__dots:empty {
	display: none;
}
.swrs .swrs__dot {
	width: 8px;
	height: 8px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--swr-star-bg);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease;
}
.swrs .swrs__dot.is-active {
	background: var(--swr-accent);
	transform: scale(1.25);
}

@media (max-width: 1024px) {
	.swrs--pv-3, .swrs--pv-4 { --swrs-pv: 2; }
}
@media (max-width: 640px) {
	.swrs { --swrs-pv: 1 !important; }
	.swrs__slide { flex-basis: 88%; }
	.swrs .swrs__arrow { display: none; }
}
@media (max-width: 1280px) {
	.swrs__arrow--prev { left: -8px; }
	.swrs__arrow--next { right: -8px; }
}
@media (prefers-reduced-motion: reduce) {
	.swrs__track { scroll-behavior: auto; }
}
