.pd-reviews {
	--base-scale: calc(min(1, (100vw / 390)));
	--muted: rgba(15, 20, 25, 0.15);
	--surface: #ffffff;
	--text: #0f1419;
	--accent: #111827;
	--subtle: #6b7280;
	color: var(--text);
	margin: 16px 0;
}

.pd-reviews__inner {
	/* Fixed spacing keeps layout identical where clamp() failed */
	background: #fff;
	border-radius: 32px;
}

.pd-reviews__header {
	/* Align heading block and action controls exactly as shown in mock */
	display: flex;
	flex-direction: column;
	gap: 32px;
	margin-bottom: 32px;
}

.pd-reviews__title {
	/* Keep the heading copy pinned to the left while controls stay on the right */
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pd-reviews__title h2 {
	font-size: 28px;
	line-height: 1.15;
	margin: 0;
	font-weight: 700;
	color: var(--accent);
	position: relative;
	padding-bottom: 12px;
	letter-spacing: -0.01em;
}

.pd-reviews__title h2::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 96px;
	height: 2px;
	background: #000;
}

.pd-reviews__subtitle-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	font-size: 20px;
	font-weight: 700;
	color: #0f1419;
}

.pd-reviews__subtitle-text {
	font-weight: 700;
}

.pd-reviews__subtitle-count {
	font-weight: 600;
	color: rgba(17, 24, 39, 0.45);
	font-size: 0.85em;
}

.pd-reviews__toolbar {
	/* Toolbar mirrors screenshot: label, filter icon, CTA in a straight row */
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: nowrap;
	width: 100%;
}


.pd-reviews__subtitle {
	display: none; /* Hide subtitle as requested */
	align-items: baseline;
	gap: 4px;
	font-size: 20px;
	font-weight: 700;
	color: #111827;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.pd-reviews__filters {
	/* Icon-only pill matches provided artwork */
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: #f4f5f7;
	border: none;
	box-shadow: none;
	padding: 0;
}

.filter-btn {
	/* Button stays a perfect circle so only the icon is visible */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	border-radius: 999px;
	border: none;
	background: transparent;
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
}

.filter-btn:focus-visible,
.filter-btn:hover {
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.12);
	transform: translateY(-1px);
}

.filter-btn__icon img {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.filter-state {
	/* Hide textual state visually while keeping it accessible */
	position: absolute;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	overflow: hidden;
	padding: 0;
	white-space: nowrap;
}

.filter-btn__icon {
	width: calc(var(--base-scale) * 40px);
	height: calc(var(--base-scale) * 40px);
	border-radius: 50%;
	background: #000;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.filter-btn__icon img {
	width: calc(var(--base-scale) * 18px);
	height: calc(var(--base-scale) * 18px);
}

.filter-state {
	font-size: calc(var(--base-scale) * 15px);
	font-weight: 700;
	color: #000;
}

.filter-options {
	position: absolute;
	top: calc(100% + calc(var(--base-scale) * 8px));
	left: 0;
	list-style: none;
	margin: 0;
	padding: calc(var(--base-scale) * 8px);
	background: var(--surface);
	border: 1px solid var(--muted);
	border-radius: 16px;
	min-width: calc(var(--base-scale) * 140px);
	box-shadow: 0 18px 60px rgba(15, 20, 25, 0.18);
	z-index: 20;
}

.filter-option {
	padding: calc(var(--base-scale) * 10px) calc(var(--base-scale) * 12px);
	border-radius: 12px;
	font-size: calc(var(--base-scale) * 15px);
	cursor: pointer;
	color: var(--accent);
}

.filter-option.is-active,
.filter-option:focus,
.filter-option:hover {
	background: rgba(17, 24, 39, 0.08);
	outline: none;
}

.btn-write-review {
	width: auto;
	border-radius: 62px;
	padding: calc(var(--base-scale) * 12px) calc(var(--base-scale) * 28px);
	gap: calc(var(--base-scale) * 12px);
	border: none;
	background: #000;
	color: #fff;
	font-size: calc(var(--base-scale) * 14px);
	font-weight: 600;
	cursor: pointer;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-write-review:focus-visible,
.btn-write-review:hover {
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.35);
	transform: translateY(-1px);
}

.pd-review-form-slot {
	margin-bottom: calc(var(--base-scale) * 24px);
}

.pd-review-form {
	border: 1px solid var(--muted);
	border-radius: 20px;
	padding: calc(var(--base-scale) * 20px);
	display: grid;
	gap: calc(var(--base-scale) * 16px);
	background: rgba(249, 250, 251, 0.8);
}

.pd-review-form label {
	display: flex;
	flex-direction: column;
	font-size: calc(var(--base-scale) * 14px);
	font-weight: 600;
	color: var(--accent);
	gap: calc(var(--base-scale) * 6px);
}

.pd-review-form input,
.pd-review-form select,
.pd-review-form textarea {
	border: 1px solid var(--muted);
	border-radius: 12px;
	padding: calc(var(--base-scale) * 12px);
	font-family: inherit;
	font-size: calc(var(--base-scale) * 14px);
	color: var(--accent);
	background: #fff;
}

.pd-review-form textarea {
	min-height: calc(var(--base-scale) * 120px);
	resize: vertical;
}

.pd-review-form__actions {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--base-scale) * 12px);
}

.pd-review-form__status {
	font-size: calc(var(--base-scale) * 14px);
	min-height: calc(var(--base-scale) * 18px);
	color: var(--subtle);
}

.pd-review-form__status.is-error {
	color: #b91c1c;
}

.pd-review-form__status.is-success {
	color: #047857;
}

.pd-review-form__actions button {
	border-radius: 62px;
	padding: calc(var(--base-scale) * 12px) calc(var(--base-scale) * 20px);
	font-weight: 600;
	font-size: calc(var(--base-scale) * 14px);
	cursor: pointer;
	border: 1px solid var(--muted);
	background: var(--surface);
}

.pd-review-form__actions button[type="submit"] {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

.reviews-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 16px;
}

.reviews-list:empty {
	display: none;
}

.pd-reviews .review-card {
	border-radius: 20px;
	border: 1px solid rgba(15, 23, 42, 0.08);
	padding: 24px;
	box-sizing: border-box;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: calc(var(--base-scale) * 14px);
	box-shadow: 0 calc(var(--base-scale) * 20px) calc(var(--base-scale) * 45px) rgba(15, 23, 42, 0.08);
}

/* Stars already appear first due to flex-direction: column in .review-card */
/* No need for explicit order rules - natural DOM order is sufficient */

/* Star rating container - ensures stars appear above reviewer name */
.review-card__stars {
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: calc(var(--base-scale) * 4px);
	flex-wrap: wrap;
}

/* Individual star image styling */
.review-card__stars .review-star {
	width: calc(var(--base-scale) * 18px);
	height: calc(var(--base-scale) * 18px);
	display: inline-block;
	flex-shrink: 0;
	object-fit: contain;
}

/* Filled star (full rating) */
.review-card__stars .review-star--filled {
	opacity: 1;
	filter: brightness(1);
}

/* Half star */
.review-card__stars .review-star--half {
	opacity: 0.6;
	filter: brightness(0.8);
}

/* Empty star */
.review-card__stars .review-star--empty {
	opacity: 0.3;
	filter: brightness(0.5) grayscale(0.3);
}

.review-card__meta {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: calc(var(--base-scale) * 12px);
	flex-wrap: wrap;
}

.review-author {
	font-size: calc(var(--base-scale) * 16px);
	font-weight: 700;
	margin: 0;
	max-width: calc(var(--base-scale) * 200px);
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.review-verified {
	width: calc(var(--base-scale) * 16px);
	height: calc(var(--base-scale) * 16px);
	display: inline-flex;
	vertical-align: middle;
	margin-left: calc(var(--base-scale) * 6px);
	background: radial-gradient(circle at center, #16a34a 60%, #0f172a 61%);
	border-radius: 50%;
	position: relative;
}

.review-verified::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--base-scale) * 6px);
	height: calc(var(--base-scale) * 10px);
	border: 2px solid #fff;
	border-top: 0;
	border-left: 0;
	transform: translate(-50%, -50%) rotate(45deg);
}

.review-body {
	font-size: calc(var(--base-scale) * 14px);
	line-height: 20px;
	color: #00000099;
	margin: 8px 0 16px;
}

.review-body p {
	margin: 0 0 calc(var(--base-scale) * 6px);
}

.review-posted {
	margin: 0;
	font-size: calc(var(--base-scale) * 13px);
	color: var(--subtle);
}

.btn-load-more {
	/* Mirror the pill button shown in the mock */
	margin: 32px auto 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 48px;
	border-radius: 999px;
	border: 1px solid rgba(15, 20, 25, 0.12);
	background: #fff;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: #111827;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-load-more.hide {
	/* Utility class hides button once no additional cards remain */
	display: none;
}

.btn-load-more:focus-visible,
.btn-load-more:hover {
	border-color: rgba(15, 20, 25, 0.4);
	color: #000;
	transform: translateY(-1px);
}

.pd-reviews__fallback-link {
	display: none;
}

.pd-reviews__empty,
.pd-reviews__noscript {
	font-size: calc(var(--base-scale) * 15px);
	color: var(--subtle);
	margin: 0;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}


/* Base styles (mobile-first) - Stack header blocks on small screens */
.pd-reviews__header {
	align-items: flex-start;
	flex-direction: column;
}

.pd-reviews__toolbar {
	width: 100%;
	justify-content: space-between;
}

@media (min-width: 768px) {
	/* Desktop layout - horizontal header */
	.pd-reviews__header {
		align-items: center;
		flex-direction: row;
	}

	.pd-reviews__toolbar {
		width: auto;
		justify-content: flex-end;
	}

	.review-author {
		max-width: initial;
	}
}

@media (min-width: 1024px) {
	/* Desktop layout mirrors provided design */
	.pd-reviews {
		max-width: 1200px;
		margin-left: auto;
		margin-right: auto;
	}

	.pd-reviews__inner {
		/* Wider breathing room on desktop */
		padding: 48px;
	}

	.pd-reviews__header {
		/* Center headline while keeping controls full width */
		align-items: center;
		text-align: center;
		gap: 24px;
		flex-direction: row; /* Single line layout on desktop */
		justify-content: center; /* Center align heading */
	}

	.pd-reviews__title {
		/* Center align title on desktop */
		text-align: center;
		width: auto;
	}

	.pd-reviews__title h2 {
		/* Single line heading, center aligned */
		white-space: nowrap;
		text-align: center;
	}

	.pd-reviews__title h2::after {
		/* Underline centered beneath title */
		left: 50%;
		transform: translateX(-50%);
	}

	.pd-reviews__toolbar {
		/* Hide toolbar on desktop since subtitle is hidden */
		display: none;
	}

	.reviews-list {
		/* Two-column card grid as in mock */
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}
}

