/**
 * Review Pro front-end styles.
 * Everything is scoped under .rp- prefixes so nothing leaks into the theme.
 */

:root {
	--rp-accent: #f0a500;
	--rp-track: #e9ecef;
	--rp-line: #e0e3e8;
	--rp-muted: #6b7280;
	--rp-text: #1f2530;
}

/* ---------- rating summary ---------- */
.rp-summary {
	display: grid;
	grid-template-columns: minmax(140px, 200px) 1fr;
	gap: 28px;
	align-items: center;
	padding: 22px 0 26px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--rp-line);
}

@media (max-width: 600px) {
	.rp-summary {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

.rp-summary__score {
	text-align: center;
}

.rp-summary__avg {
	display: block;
	font-size: 2.75rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--rp-text);
	font-variant-numeric: tabular-nums;
}

.rp-summary__stars {
	display: block;
	margin: 4px 0 6px;
	font-size: 1.05rem;
	letter-spacing: 2px;
}

.rp-summary__count {
	display: block;
	font-size: 0.8125rem;
	color: var(--rp-muted);
}

.rp-star { color: var(--rp-track); }
.rp-star--on { color: var(--rp-accent); }

/* ---------- breakdown bars ---------- */
.rp-summary__bars {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rp-bar {
	display: grid;
	grid-template-columns: 42px 1fr 44px;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 3px 6px;
	background: none;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
	text-align: left;
	transition: background-color .15s, border-color .15s;
}

.rp-bar:hover:not(:disabled),
.rp-bar[aria-pressed="true"] {
	background: rgba(0, 0, 0, .03);
	border-color: var(--rp-line);
}

.rp-bar:disabled { cursor: default; }

.rp-bar:focus-visible {
	outline: 2px solid var(--rp-accent);
	outline-offset: 1px;
}

.rp-bar__label {
	font-size: 0.8125rem;
	color: var(--rp-muted);
	white-space: nowrap;
}

.rp-bar__label span { color: var(--rp-accent); margin-left: 2px; }

.rp-bar__track {
	height: 8px;
	background: var(--rp-track);
	border-radius: 4px;
	overflow: hidden;
}

.rp-bar__fill {
	display: block;
	height: 100%;
	background: var(--rp-accent);
	border-radius: 4px;
	transition: width .4s ease;
}

.rp-bar__count {
	font-size: 0.8125rem;
	color: var(--rp-muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rp-clear-filter {
	grid-column: 1 / -1;
	justify-self: start;
	margin-top: 6px;
	padding: 6px 14px;
	background: none;
	border: 1px solid var(--rp-line);
	border-radius: 4px;
	font-size: 0.8125rem;
	cursor: pointer;
}

.rp-clear-filter:hover { border-color: var(--rp-muted); }

/* ---------- review photos ---------- */
.rp-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 4px;
}

.rp-photo {
	padding: 0;
	border: 1px solid var(--rp-line);
	border-radius: 4px;
	background: none;
	cursor: pointer;
	overflow: hidden;
	line-height: 0;
	transition: border-color .15s, transform .15s;
}

.rp-photo:hover { border-color: var(--rp-accent); transform: translateY(-1px); }
.rp-photo:focus-visible { outline: 2px solid var(--rp-accent); outline-offset: 2px; }

.rp-photo img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	display: block;
}

/* ---------- lightbox ---------- */
.rp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 18, 24, .88);
	padding: 24px;
}

.rp-lightbox img {
	max-width: 100%;
	max-height: 90vh;
	border-radius: 4px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, .5);
}

.rp-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 40px;
	height: 40px;
	font-size: 24px;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, .12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.rp-lightbox__close:hover { background: rgba(255, 255, 255, .24); }

/* ---------- helpful ---------- */
.rp-helpful { margin-top: 10px; }

.rp-helpful__btn {
	padding: 5px 12px;
	font-size: 0.8125rem;
	color: var(--rp-muted);
	background: none;
	border: 1px solid var(--rp-line);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color .15s, color .15s;
}

.rp-helpful__btn:hover:not(:disabled) { border-color: var(--rp-accent); color: var(--rp-text); }
.rp-helpful__btn:disabled { opacity: .6; cursor: default; }
.rp-helpful__count { font-variant-numeric: tabular-nums; }

/* ---------- upload field ---------- */
.rp-upload { margin-top: 14px; }

.rp-upload label { display: block; margin-bottom: 5px; font-weight: 600; }

.rp-upload__hint {
	display: block;
	margin-top: 4px;
	font-size: 0.8125rem;
	color: var(--rp-muted);
}

.rp-upload__preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.rp-upload__thumb {
	position: relative;
	width: 68px;
	height: 68px;
	border: 1px solid var(--rp-line);
	border-radius: 4px;
	overflow: hidden;
}

.rp-upload__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rp-upload__error {
	display: block;
	margin-top: 8px;
	font-size: 0.8125rem;
	color: #b42318;
}

.rp-upload__error:empty { display: none; }

/* ---------- filtered state ---------- */
.rp-hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.rp-bar__fill, .rp-photo, .rp-helpful__btn { transition: none; }
}
