/* Yandex Reviews Widget — frontend */

.yrw-app {
	--yrw-text: #212121;
	--yrw-muted: #757575;
	--yrw-accent: #ffcc00;
	--yrw-empty: #d8d8d8;
	--yrw-border: #e0e0e0;
	--yrw-card-bg: #ffffff;
	--yrw-summary-bg: #fafafa;
	--yrw-tab-bg: #eeeeee;
	--yrw-bubble-bg: #f5f5f5;
	--yrw-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);
	--yrw-shadow-hover: 0 3px 3px 0 rgba(0,0,0,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2);

	font-family: inherit;
	color: var(--yrw-text);
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 0 0 0;
	box-sizing: border-box;
}
.yrw-app *, .yrw-app *::before, .yrw-app *::after { box-sizing: border-box; }

.yrw-app-head {
	text-align: center;
	font-size: 26px;
	font-weight: 700;
	margin-bottom: 30px;
}

/* Summary block */
.yrw-summary {
	background-color: var(--yrw-summary-bg);
	border-radius: 6px;
	padding: 14px 20px 18px;
	margin-bottom: 24px;
}

/* Tabs */
.yrw-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
	overflow-x: auto;
	scrollbar-width: thin;
}
.yrw-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	background: transparent;
	border: 0;
	border-radius: 5px;
	font: inherit;
	font-size: 16px;
	color: var(--yrw-text);
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}
.yrw-tab:hover { background: rgba(0,0,0,0.04); }
.yrw-tab.active { background-color: var(--yrw-tab-bg); }
.yrw-tab-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}
.yrw-tab-icon-all {
	display: inline-block;
	width: 20px;
	height: 20px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23ffcc00' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/></svg>");
	background-size: contain;
	background-repeat: no-repeat;
}
.yrw-tab-name { font-weight: 700; }
.yrw-tab-rating { font-weight: 700; margin-left: 4px; }

.yrw-summary-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}
.yrw-summary-middle {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 180px;
}
.yrw-summary-rating-line {
	display: flex;
	align-items: baseline;
	gap: 4px;
	font-size: 20px;
	font-weight: 500;
}
.yrw-summary-rating-value { font-weight: 700; }
.yrw-summary-rating-of { color: var(--yrw-muted); font-size: 15px; }
.yrw-summary-stars { display: flex; gap: 2px; }
.yrw-summary-stars .yrw-star { width: 18px; height: 18px; }
.yrw-summary-count { font-size: 13px; color: var(--yrw-muted); }
.yrw-summary-right { margin-left: auto; }

/* Buttons */
.yrw-btn {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 4px;
	background: #ffffff;
	color: var(--yrw-text);
	border: 1px solid var(--yrw-border);
	font-size: 15px;
	line-height: 1.5;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--yrw-shadow);
	transition: transform .15s ease, box-shadow .15s ease;
}
.yrw-btn:hover {
	box-shadow: var(--yrw-shadow-hover);
	transform: translateY(-1px);
}
.yrw-btn-more { display: block; margin: 24px auto 0; min-width: 140px; }
.yrw-more-wrap { text-align: center; }

/* Stars */
.yrw-star {
	display: inline-block;
	width: 16px; height: 16px;
	background-color: var(--yrw-empty);
	vertical-align: middle;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M5.987 9.42l-3.26 1.991a.48.48 0 0 1-.715-.526l.945-3.764L.216 4.988A.48.48 0 0 1 .47 4.13l3.586-.295L5.552.348a.48.48 0 0 1 .883.001l1.483 3.486 3.61.296a.48.48 0 0 1 .255.857L9.031 7.121l.943 3.766a.48.48 0 0 1-.715.527L5.987 9.419z'/></svg>") center/contain no-repeat;
	        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M5.987 9.42l-3.26 1.991a.48.48 0 0 1-.715-.526l.945-3.764L.216 4.988A.48.48 0 0 1 .47 4.13l3.586-.295L5.552.348a.48.48 0 0 1 .883.001l1.483 3.486 3.61.296a.48.48 0 0 1 .255.857L9.031 7.121l.943 3.766a.48.48 0 0 1-.715.527L5.987 9.419z'/></svg>") center/contain no-repeat;
}
.yrw-star-full { background-color: var(--yrw-accent); }
.yrw-star-partial {
	background: linear-gradient(90deg, var(--yrw-accent) var(--yrw-star-fill,50%), var(--yrw-empty) var(--yrw-star-fill,50%));
}

/* Reviews grid */
.yrw-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	align-items: stretch;
}

.yrw-review {
	display: flex;
	flex-direction: column;
	background-color: var(--yrw-card-bg);
	border-radius: 10px;
	padding: 18px;
	box-shadow: var(--yrw-shadow);
	transition: transform .2s ease;
}
.yrw-review:hover { transform: translateY(-3px); }

/* Reviews hidden by tab filter or "More" pagination — still in DOM for SEO. */
.yrw-review-hidden { display: none; }

/* Elements hidden by JS state (e.g. "More" button when filter has < limit) —
   uses !important to survive theme overrides of .yrw-more-wrap or .yrw-btn. */
.yrw-app .yrw-hidden { display: none !important; }

.yrw-review-header { display: flex; gap: 12px; margin-bottom: 14px; }
.yrw-review-avatar { flex-shrink: 0; }
.yrw-review-avatar img,
.yrw-review-avatar-fallback {
	width: 48px; height: 48px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: #ff9800; color: #fff;
	font-size: 20px; font-weight: 700;
	text-transform: uppercase;
	overflow: hidden;
	object-fit: cover;
}
.yrw-review-meta { flex: 1; min-width: 0; }
.yrw-review-author {
	font-weight: 700; font-size: 14px; line-height: 1.3;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yrw-review-stars { margin-top: 4px; display: flex; gap: 2px; }
.yrw-review-stars .yrw-star { width: 14px; height: 14px; }
.yrw-review-date { margin-top: 4px; font-size: 12px; color: var(--yrw-muted); }

.yrw-review-body {
	flex: 1;
	background-color: var(--yrw-bubble-bg);
	border-radius: 8px;
	padding: 12px 14px;
	position: relative;
	margin-bottom: 12px;
}
.yrw-review-body::before {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 22px;
	border-width: 0 12px 12px 0;
	border-style: solid;
	border-color: var(--yrw-bubble-bg) transparent;
	transform: skewX(-15deg);
}
.yrw-review-text {
	font-size: 14px; line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-wrap: break-word;
}
.yrw-review-text.yrw-expanded {
	-webkit-line-clamp: unset;
	display: block;
	max-height: 60vh;
	overflow-y: auto;
}
.yrw-review-readmore {
	margin-top: 8px;
	background: none; border: 0; padding: 0;
	font-size: 12px; color: var(--yrw-muted);
	cursor: pointer; text-decoration: underline;
}
.yrw-review-readmore:hover { color: var(--yrw-text); }

.yrw-review-footer { margin-top: auto; }
.yrw-review-source {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--yrw-muted);
	text-decoration: underline;
}
.yrw-review-source:hover { color: var(--yrw-text); }
.yrw-review-source-icon { width: 14px; height: 14px; }

.yrw-error {
	padding: 12px 16px; border-radius: 4px;
	background: #fff3cd; color: #856404;
	border: 1px solid #ffeeba; font-size: 14px;
}

@media (max-width: 900px) {
	.yrw-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.yrw-list { grid-template-columns: 1fr; }
	.yrw-summary-bottom { flex-direction: column; align-items: flex-start; }
	.yrw-summary-right { margin-left: 0; width: 100%; }
	.yrw-summary-right .yrw-btn { width: 100%; text-align: center; }
	.yrw-app-head { font-size: 22px; margin-bottom: 20px; }
	.yrw-tab-name { display: none; }
}
