/* Блок «Das sagen unsere Kunden» (reviews-functions.php) — в .wd-prefooter после карусели брендов. */

.wd-prefooter .container > .ec-reviews,
.ec-reviews {
	/* Специфичность (0,3,0) — выше, чем у Woodmart :is(.wd-entry-content, …) > * (0,2,0),
	   который обнуляет отступы; при склейке Autoptimize его правило идёт позже. 
	   Фон на всю ширину окна (блок лежит внутри .container prefooter'а). */
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	/* Ряд брендов имеет margin-bottom: -40px (прижат к футеру) — компенсируем,
	   а снизу сами прижимаемся к футеру через padding-bottom prefooter'а (40px). */
	margin-top: 40px;
	margin-bottom: -40px;
	padding-block: 70px;
	background-color: #f4f3f9;
}

/* В контенте страницы (шорткод [ec_reviews], главная): без компенсаций prefooter'а */
.wpb_wrapper > .ec-reviews.ec-reviews--inline,
.ec-reviews.ec-reviews--inline {
	margin-top: 0;
	margin-bottom: 0;
}

.ec-reviews__inner {
	max-width: var(--wd-container-w, 1222px);
	margin-inline: auto;
	padding-inline: 15px;
}

.ec-reviews .ec-reviews__title {
	margin: 0 0 30px;
	color: #242424;
	font-family: var(--wd-title-font, 'Assistant', Arial, Helvetica, sans-serif);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

/* --- Лента карточек: горизонтальная прокрутка со «щелчком» по карточкам --- */
.ec-reviews__track {
	--ec-per-view: 4;
	--ec-gap: 24px;
	display: flex;
	gap: var(--ec-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	outline: none;
}

.ec-reviews__track::-webkit-scrollbar {
	display: none;
}

/* --- Карточка отзыва --- */
.ec-reviews-card {
	flex: 0 0 calc((100% - (var(--ec-per-view) - 1) * var(--ec-gap)) / var(--ec-per-view));
	min-width: 0; /* иначе длинное имя (nowrap) раздувает карточку */
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 290px;
	padding: 22px;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(43, 32, 100, 0.06);
	scroll-snap-align: start;
	box-sizing: border-box;
}

.ec-reviews-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.ec-reviews-card__author {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.ec-reviews-card__avatar {
	flex-shrink: 0;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
}

.ec-reviews-card__avatar--initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
}

.ec-reviews-card__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.ec-reviews .ec-reviews-card__name {
	margin: 0;
	color: #344fba;
	font-size: 17px;
	font-weight: 700;
	line-height: 24px;
	/* Длинные имена — в одну строку с многоточием. */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ec-reviews .ec-reviews-card__date {
	margin: 0;
	color: #797979;
	font-size: 14px;
	line-height: 20px;
}

.ec-reviews-card__google {
	flex-shrink: 0;
	display: block;
	width: 28px;
	height: 28px;
	line-height: 0;
}

.ec-reviews-card__google img {
	width: 28px;
	height: 28px;
	border-radius: 5px;
}

/* --- Звёзды --- */
.ec-reviews-card__stars {
	display: flex;
	gap: 2px;
}

.ec-reviews-card__star {
	/* Звезда — маска (один SVG в CSS вместо копии в каждой карточке), цвет — фоном. */
	display: block;
	width: 22px;
	height: 21px;
	background-color: #e0e0e0;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 28'%3E%3Cpath d='M15.916 3.88739C15.4475 2.59628 13.5564 2.59628 13.0879 3.88739L10.691 10.497H5.00624C3.71694 10.497 3.13328 12.0533 4.12375 12.8501L8.45399 16.3338L6.47379 22.8336C6.11994 23.995 7.46257 24.9489 8.50598 24.2773L14.5 20.4196L20.494 24.2773C21.5374 24.9489 22.8801 23.995 22.5262 22.8336L20.546 16.3338L24.8763 12.8501C25.8667 12.0533 25.2831 10.497 23.9938 10.497H18.309L15.916 3.88739Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 29 28'%3E%3Cpath d='M15.916 3.88739C15.4475 2.59628 13.5564 2.59628 13.0879 3.88739L10.691 10.497H5.00624C3.71694 10.497 3.13328 12.0533 4.12375 12.8501L8.45399 16.3338L6.47379 22.8336C6.11994 23.995 7.46257 24.9489 8.50598 24.2773L14.5 20.4196L20.494 24.2773C21.5374 24.9489 22.8801 23.995 22.5262 22.8336L20.546 16.3338L24.8763 12.8501C25.8667 12.0533 25.2831 10.497 23.9938 10.497H18.309L15.916 3.88739Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ec-reviews-card__star.is-on {
	background-color: #ec9343;
}

/* --- Текст (прокручивается при переполнении) --- */
.ec-reviews-card__text {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding-right: 4px;
	color: #333;
	font-size: 15px;
	line-height: 23px;
	scrollbar-width: thin;
	scrollbar-color: #d7d7d7 #efefef;
}

.ec-reviews .ec-reviews-card__text p {
	margin: 0;
}

.ec-reviews-card__text::-webkit-scrollbar {
	width: 6px;
}

.ec-reviews-card__text::-webkit-scrollbar-track {
	background-color: #efefef;
	border-radius: 16px;
}

.ec-reviews-card__text::-webkit-scrollbar-thumb {
	background-color: #d7d7d7;
	border-radius: 16px;
}

/* --- Пагинация-пилюли (строит reviews.js) --- */
.ec-reviews__pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 28px;
}

.ec-reviews__pagination:empty {
	display: none;
}

/* Пилюли пагинации: неактивные — серые кружки 12×12, активная — вытянутая в цвет бренда */
.ec-reviews .ec-reviews__dot {
	flex: none;
	width: 12px;
	height: 12px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background-color: #d4d4d8;
	box-shadow: none;
	cursor: pointer;
	transition: width 0.25s ease, background-color 0.25s ease;
}

.ec-reviews .ec-reviews__dot:hover {
	background-color: #a1a1aa;
}

.ec-reviews .ec-reviews__dot:focus-visible {
	outline: 2px solid var(--wd-primary-color, #2b2064);
	outline-offset: 2px;
}

.ec-reviews .ec-reviews__dot.is-active {
	width: 32px;
	background-color: var(--wd-primary-color, #2b2064);
}

/* --- Адаптив: 4 / 3 / 2 / 1 карточки в ряд --- */
@media (max-width: 1199px) {
	.ec-reviews__track {
		--ec-per-view: 3;
	}
}

@media (max-width: 1024px) {
	.ec-reviews__track {
		--ec-per-view: 2;
	}
}

@media (max-width: 599px) {
	.wd-prefooter .container > .ec-reviews,
	.ec-reviews {
		padding-block: 45px;
	}

	.ec-reviews .ec-reviews__title {
		margin-bottom: 20px;
		font-size: 22px;
	}

	.ec-reviews__track {
		--ec-per-view: 1;
		--ec-gap: 16px;
	}

	.ec-reviews-card {
		height: 300px;
	}
}
