/**
 * Product-page review block.
 *
 * Intentionally low-specificity and variable-driven so the theme's own type and
 * colour win where they exist. Only layout is opinionated here.
 */

.ms-reviews {
	--ms-rule: #e3e3e3;
	--ms-muted: #666;
	--ms-verified: #1e6f34;
	margin: 3rem 0;
}

.ms-reviews-heading {
	font-size: 1.15rem;
	margin: 0 0 1rem;
}

/* The pool block is a separate labelled group, visually distinct from the
   product's own reviews — presenting store reviews as product reviews would
   misrepresent them. */
.ms-reviews-pool {
	margin-top: 2.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--ms-rule);
}

.ms-reviews-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.5rem;
}

.ms-review {
	margin: 0;
	padding: 0 0 1.5rem;
	border-bottom: 1px solid var(--ms-rule);
}
.ms-review:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.ms-review-text {
	margin: 0 0 .5rem;
	padding: 0;
	border: 0;
	font-style: normal;
	white-space: pre-line; /* customer line breaks are meaningful */
}

.ms-review-meta {
	margin: 0;
	font-size: .85rem;
	color: var(--ms-muted);
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	align-items: baseline;
}

.ms-review-name { font-weight: 600; color: inherit; }

.ms-review-verified {
	color: var(--ms-verified);
	font-weight: 600;
}
.ms-review-verified::before {
	content: "✓";
	margin-right: .25em;
}

.ms-review-hidden { display: none; }

.ms-reviews-more { margin-top: 1.5rem; }

.ms-reviews-count-link {
	display: inline-block;
	margin: .25rem 0 .75rem;
	font-size: .9rem;
}

/* Reserve height before the client-side injection lands, so the pool block
   cannot shift the page. Three reviews at roughly 150px each. CWV is already a
   live concern on this site, and a late-loading block below the fold is exactly
   what drives CLS. */
.ms-reviews-pool[hidden] {
	display: block !important;
	visibility: hidden;
	min-height: 450px;
}

@media (max-width: 600px) {
	.ms-reviews-pool[hidden] { min-height: 560px; }
}

@media (prefers-color-scheme: dark) {
	.ms-reviews {
		--ms-rule: #3a3a3a;
		--ms-muted: #a5a5a5;
		--ms-verified: #6fcf8b;
	}
}

/* Preview mode (?ms_preview=1, admins only) — must be unmistakable, so a
   pending review is never mistaken for something that is already live. */
.ms-reviews-preview {
	outline: 2px dashed #c9a227;
	outline-offset: 8px;
}
.ms-preview-banner {
	background: #fdf6e3;
	color: #6b5600;
	border: 1px solid #e8d9a0;
	border-radius: 4px;
	padding: .6rem .85rem;
	margin: 0 0 1.5rem;
	font-size: .85rem;
}
.ms-reviews-preview .ms-review[data-status="pending"] .ms-review-meta::after {
	content: "pending";
	background: #fdf6e3;
	color: #6b5600;
	border-radius: 3px;
	padding: 0 .4em;
	font-size: .75rem;
}
