/* ── Product Reviews ─────────────────────────────────────────────── */

.product-reviews {
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px solid var(--wp--preset--color--border);
}

/* Header */

.product-reviews__header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.product-reviews__header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.product-reviews__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--wp--preset--color--text);
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.product-reviews__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--wp--preset--color--border);
	font-size: 12px;
	font-weight: 600;
	color: var(--wp--preset--color--text-light);
}

/* Rating split */

.product-reviews__split {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.product-reviews__split-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.product-reviews__split-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--wp--preset--color--text-light);
	white-space: nowrap;
	width: 20px;
	text-align: right;
	flex-shrink: 0;
}

.product-reviews__split-bar {
	flex: 1;
	height: 6px;
	border-radius: 3px;
	background: var(--wp--preset--color--border);
	overflow: hidden;
}

.product-reviews__split-fill {
	height: 100%;
	border-radius: 3px;
	background: var(--wp--preset--color--warning);
	transition: width .3s ease;
}

.product-reviews__split-count {
	font-size: 12px;
	color: var(--wp--preset--color--text-light);
	width: 18px;
	flex-shrink: 0;
}

/* Review list */

.product-reviews__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.product-reviews__list--grid {
	display: grid;
	gap: 16px;
}
.product-reviews__list--cols-2 { grid-template-columns: repeat(2, 1fr); }
.product-reviews__list--cols-3 { grid-template-columns: repeat(3, 1fr); }
.product-reviews__list--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
	.product-reviews__list--grid { grid-template-columns: 1fr; }
}

.product-reviews__empty {
	font-size: 14px;
	color: var(--wp--preset--color--text-light);
	margin: 0;
}

/* Load more */

.product-reviews__footer {
	margin-top: 20px;
	display: flex;
	justify-content: center;
}

/* ── Review card ─────────────────────────────────────────────────── */

.product-reviews-review {
	padding: 16px;
	border-radius: 10px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
}

.product-reviews-review__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.product-reviews-review__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.product-reviews-review__meta {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.product-reviews-review__author {
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--text);
	line-height: 1.3;
}

.product-reviews-review__date {
	font-size: 12px;
	color: var(--wp--preset--color--text-light);
}

.product-reviews-review__rating {
	display: flex;
	gap: 2px;
	font-size: 16px;
	line-height: 1;
}

.product-reviews-review__star {
	color: var(--wp--preset--color--border);
}

.product-reviews-review__star--filled {
	color: var(--wp--preset--color--warning);
}

.product-reviews-review__body {
	font-size: 14px;
	color: var(--wp--preset--color--text);
	line-height: 1.6;
	margin: 0 0 10px;
	white-space: pre-line;
}

.product-reviews-review__images {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.product-reviews-review__image-link {
	display: block;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
	cursor: pointer;
}

.product-reviews-review__image-link:hover {
	border-color: var(--wp--preset--color--primary);
}

.product-reviews-review__image {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
}

/* ── Review form ─────────────────────────────────────────────────── */

.product-reviews-form {
	padding: 0;
}

.product-reviews-form__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.product-reviews-form__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.product-reviews-form__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

.product-reviews-form__required {
	color: var(--wp--preset--color--error);
}

.product-reviews-form__hint {
	font-weight: 400;
	color: var(--wp--preset--color--text-light);
	font-size: 12px;
}

.product-reviews-form__textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.55;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	resize: vertical;
	font-family: inherit;
	transition: border-color .15s;
	box-sizing: border-box;
}

.product-reviews-form__textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 12%, transparent);
}

.product-reviews-form__stars {
	display: flex;
	gap: 4px;
}

.product-reviews-form__star {
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--wp--preset--color--border);
	transition: color .1s, transform .1s;
	user-select: none;
}

.product-reviews-form__star:hover,
.product-reviews-form__star--active {
	color: var(--wp--preset--color--warning);
	transform: scale(1.15);
}

.product-reviews-form__upload-label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--wp--preset--color--text);
	border: 1px dashed var(--wp--preset--color--border);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	cursor: pointer;
	transition: border-color .15s, background .15s;
	width: fit-content;
}

.product-reviews-form__upload-label:hover {
	border-color: var(--wp--preset--color--primary);
	background: var(--wp--preset--color--surface-alt);
}

.product-reviews-form__file { display: none; }

.product-reviews-form__preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.product-reviews-form__thumb {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid var(--wp--preset--color--border);
}

.product-reviews-form__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.product-reviews-form__thumb-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--surface);
	font-size: 11px;
	line-height: 1;
	padding: 0;
}

.product-reviews-form__thumb-remove:hover {
	background: rgba(0, 0, 0, .85);
}

.product-reviews-form__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.product-reviews-form__status {
	font-size: 13px;
	margin: 0;
}

.product-reviews-form__status--success { color: var(--wp--preset--color--success); }
.product-reviews-form__status--error   { color: var(--wp--preset--color--error); }

/* ── Buttons (scoped to module) ──────────────────────────────────── */

.kw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 6px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background .15s, color .15s, border-color .15s, opacity .15s;
	text-decoration: none;
	line-height: 1.4;
	font-family: inherit;
}

.kw-btn--sm { padding: 6px 12px; font-size: 13px; }

.kw-btn--ghost {
	background: transparent;
	border-color: var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
}
.kw-btn--ghost:hover { background: var(--wp--preset--color--surface-alt); }

.kw-btn--primary {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--surface);
}
.kw-btn--primary:hover { opacity: 0.9; }
.kw-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Popup overlay ───────────────────────────────────────────────── */

.kw-popup-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, .5);
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.kw-popup-overlay.is-open { display: flex; }

.kw-popup-dialog {
	background: var(--wp--preset--color--surface);
	border-radius: 12px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.kw-popup-dialog--md { max-width: 520px; }

.kw-popup-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	position: sticky;
	top: 0;
	background: var(--wp--preset--color--surface);
	z-index: 1;
}

.kw-popup-dialog__title {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

.kw-popup-dialog__close {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wp--preset--color--text-light);
	padding: 0;
	transition: background .15s, color .15s;
}

.kw-popup-dialog__close:hover {
	background: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--text);
}

.kw-popup { padding: 20px 24px 24px; }

/* ── Stars component (partial fill) ─────────────────────────────── */

.product-reviews-stars {
	position: relative;
	display: inline-block;
	font-size: 18px;
	line-height: 1;
	letter-spacing: 2px;
	white-space: nowrap;
}

.product-reviews-stars__bg  { color: var(--wp--preset--color--border); }

.product-reviews-stars__fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: var(--wp--preset--color--warning);
}

/* ── Reviews Summary ─────────────────────────────────────────────── */

.product-reviews-summary { display: inline-flex; }

.product-reviews-summary__inner {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
}

.product-reviews-summary__stars { display: flex; align-items: center; }

.product-reviews-summary__text {
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--text);
	line-height: 1.2;
}

.product-reviews-summary__count {
	color: var(--wp--preset--color--text-light);
	font-weight: 400;
}

/* ── PhotoSwipe z-index override ─────────────────────────────────── */

.pswp { z-index: 99999 !important; }
