/* =========================================================================
   Puro Reviews  [puro_reviews]
   ========================================================================= */

.puro-reviews {}

.puro-reviews__heading {
	margin-bottom: 1.25rem;
}

/* Grid */
.puro-reviews__grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat( 1, 1fr );
}

.puro-reviews--cols-2 .puro-reviews__grid { grid-template-columns: repeat( 2, 1fr ); }
.puro-reviews--cols-3 .puro-reviews__grid { grid-template-columns: repeat( 3, 1fr ); }
.puro-reviews--cols-4 .puro-reviews__grid { grid-template-columns: repeat( 4, 1fr ); }

/* Review card */
.puro-reviews__item {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem;
	border: 1px solid var(--color-goud-200, #CEAA5D);
	border-radius: 8px;
	background: #fff;
}

/* Header: avatar + meta side by side */
.puro-reviews__header {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.puro-reviews__avatar img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.puro-reviews__meta {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.puro-reviews__author {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--color-groen-800, #003127);
}

/* Stars (grid-layout review cards) */
.puro-reviews__stars {
	display: flex;
	gap: 1px;
	line-height: 1;
}

.puro-reviews__star {
	color: #D1D5DB;
	font-size: 1rem;
}

.puro-reviews__star--filled {
	color: var(--color-goud-200, #CEAA5D);
}

/* Stars (w-review-rating element inside Grid Layout cards) */
.w-review-rating {
	display: inline-flex;
	gap: 2px;
	line-height: 1;
	align-items: center;
}

.w-review-rating.align_left   { justify-content: flex-start; }
.w-review-rating.align_center { justify-content: center; }
.w-review-rating.align_right  { justify-content: flex-end; }

.w-review-star {
	color: #D1D5DB;
}

.w-review-star--filled {
	color: var( --puro-star-color, #f5a623 );
}

.puro-reviews__date {
	font-size: 0.8rem;
	color: #6B7280;
}

/* =========================================================================
   Write-a-Review button
   ========================================================================= */

.puro-write-review-wrap {
	margin-top: 1.5rem;
	text-align: center;
}

.puro-write-review-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.5rem;
	background: var(--color-groen-800, #003127);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.puro-write-review-btn:hover,
.puro-write-review-btn:focus-visible {
	background: #004a3a;
	outline: 2px solid transparent;
}

/* =========================================================================
   Review Modal
   ========================================================================= */

.puro-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.55);
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.puro-modal-overlay.is-open {
	display: flex;
}

.puro-modal {
	background: #fff;
	border-radius: 10px;
	padding: 2rem;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
}

.puro-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 0.9rem;
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: #6B7280;
	padding: 0.1rem 0.35rem;
}

.puro-modal__close:hover {
	color: #111;
}

.puro-modal__title {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--color-groen-800, #003127);
	margin: 0 0 1.4rem;
}

/* ── Star picker ─────────────────────────────────────────────────────────── */

.puro-star-picker {
	display: flex;
	gap: 4px;
	margin-bottom: 0.25rem;
}

.puro-star {
	background: none;
	border: none;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	color: #D1D5DB;
	padding: 0;
	transition: color 0.1s, transform 0.12s;
}

.puro-star:hover,
.puro-star.is-active {
	color: var(--color-goud-200, #CEAA5D);
}

.puro-star:hover {
	transform: scale(1.2);
}

/* ── Form fields ─────────────────────────────────────────────────────────── */

.puro-review-form .puro-form-group {
	margin-bottom: 1.1rem;
}

.puro-review-form label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 0.4rem;
	color: var(--color-groen-800, #003127);
}

.puro-review-form textarea {
	width: 100%;
	min-height: 110px;
	padding: 0.6rem 0.8rem;
	border: 1px solid #D1D5DB;
	border-radius: 6px;
	font-size: 0.95rem;
	font-family: inherit;
	resize: vertical;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.puro-review-form textarea:focus {
	outline: none;
	border-color: var(--color-groen-800, #003127);
}

.puro-review-form__submit {
	width: 100%;
	padding: 0.75rem 1rem;
	background: var(--color-groen-800, #003127);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.puro-review-form__submit:hover {
	background: #004a3a;
}

.puro-review-form__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.puro-review-form__message {
	margin-top: 0.85rem;
	font-size: 0.9rem;
	padding: 0.55rem 0.8rem;
	border-radius: 5px;
	display: none;
}

.puro-review-form__message.is-success {
	background: #d1fae5;
	color: #065f46;
	display: block;
}

.puro-review-form__message.is-error {
	background: #fee2e2;
	color: #991b1b;
	display: block;
}

/* Body */
.puro-reviews__body {
	font-size: 0.9rem;
	line-height: 1.6;
	color: #374151;
	flex: 1 1 auto;
}

.puro-reviews__body p {
	margin: 0;
}

/* Footer: product link */
.puro-reviews__footer {
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: 1px solid #F3F4F6;
}

.puro-reviews__product-link {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--color-groen-800, #003127);
	text-decoration: none;
}

.puro-reviews__product-link:hover {
	text-decoration: underline;
}

/* =========================================================================
   Puro Review Summary  [puro_review_summary]
   ========================================================================= */

:root {
	--puro-star-color: #f5a623;
}

.w-review-summary {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4em;
	font-size: 1em;
	line-height: 1;
}

/* Alignment helpers */
.w-review-summary.align_left   { justify-content: flex-start; }
.w-review-summary.align_center { justify-content: center; }
.w-review-summary.align_right  { justify-content: flex-end; }

/* Star bar — two overlapping FA-star rows, filled one clips to percentage */
.w-review-summary-stars {
	position: relative;
	display: inline-block;
	font-size: inherit;
	line-height: 1;
	/* empty stars */
	color: #D1D5DB;
	white-space: nowrap;
}

.w-review-summary-stars::before {
	content: '\f005\f005\f005\f005\f005';
	font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", FontAwesome;
	font-weight: 900;
	font-style: normal;
	font-size: 0.8em;
	display: block;
}

.w-review-summary-stars-filled {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: var( --puro-star-color );
}

.w-review-summary-stars-filled::before {
	content: '\f005\f005\f005\f005\f005';
	font-family: "Font Awesome 5 Free", "Font Awesome 6 Free", FontAwesome;
	font-weight: 900;
	font-style: normal;
	font-size: 0.8em;
	display: block;
}

/* Average score */
.w-review-summary-average {
	font-size: 0.9em;
	font-weight: 600;
}

/* Review count */
.w-review-summary-count {
	font-size: 0.85em;
	color: #6B7280;
}

/* Responsive */
@media ( max-width: 900px ) {
	.puro-reviews--cols-4 .puro-reviews__grid,
	.puro-reviews--cols-3 .puro-reviews__grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 600px ) {
	.puro-reviews--cols-4 .puro-reviews__grid,
	.puro-reviews--cols-3 .puro-reviews__grid,
	.puro-reviews--cols-2 .puro-reviews__grid {
		grid-template-columns: 1fr;
	}
}

/* =========================================================================
   Review Text — Read More / Read Less  (.w-review-text--collapsible)
   ========================================================================= */

.w-review-text--collapsible .w-review-text__inner {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var( --review-text-rows, 3 );
}

.w-review-text--collapsible.is-expanded .w-review-text__inner {
	-webkit-line-clamp: unset;
	display: block;
}

.w-review-text__toggle {
	display: inline-block;
	background: none;
	border: none;
	padding: 0;
	margin-top: 0.35rem;
	font-size: 0.85em;
	font-weight: 600;
	color: var( --color-groen-800, #003127 );
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.w-review-text__toggle:hover {
	color: var( --color-goud-200, #CEAA5D );
}

/* Hide button when the text is short enough that no clamping occurred */
.w-review-text--no-overflow .w-review-text__toggle {
	display: none;
}
