/**
 * Product Review Plus — front-end styles.
 * The panel mirrors Salient's off-canvas motion: overlay fade, eased slide-in,
 * and a staggered reveal of the content inside.
 */

:root {
	--prp-accent: #2f7bf6;
	--prp-panel-bg: #ffffff;
	--prp-text: #1c1c1c;
	--prp-muted: #75787d;
	--prp-line: rgba(0, 0, 0, 0.09);
	--prp-radius: 6px;
	--prp-ease: cubic-bezier(0.25, 1, 0.33, 1);
	--prp-star: #f5a623;
}

/* ---------------------------------------------------------------- Off canvas */

.prp-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 100000;
	visibility: hidden;
	pointer-events: none;
}

.prp-offcanvas.is-open {
	visibility: visible;
	pointer-events: auto;
}

.prp-offcanvas__bg {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	opacity: 0;
	transition: opacity 0.7s var(--prp-ease);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.prp-offcanvas.is-open .prp-offcanvas__bg {
	opacity: 1;
}

.prp-offcanvas__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	width: min(540px, 100%);
	max-width: 100%;
	background: var(--prp-panel-bg);
	color: var(--prp-text);
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	box-shadow: 0 0 60px rgba(0, 0, 0, 0.18);
	transition: transform 0.85s var(--prp-ease);
	will-change: transform;
}

.prp-position-right .prp-offcanvas__panel {
	right: 0;
	transform: translateX(102%);
}

.prp-position-left .prp-offcanvas__panel {
	left: 0;
	transform: translateX(-102%);
}

.prp-offcanvas.is-open .prp-offcanvas__panel {
	transform: translateX(0);
}

.prp-offcanvas__inner {
	padding: 60px 46px 60px;
	min-height: 100%;
	box-sizing: border-box;
	outline: none;
}

.prp-offcanvas__close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	z-index: 2;
	transition: background 0.3s var(--prp-ease);
}

.prp-position-left .prp-offcanvas__close {
	right: auto;
	left: 20px;
}

.prp-offcanvas__close:hover {
	background: rgba(0, 0, 0, 0.05);
}

.prp-close-line {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	margin: -1px 0 0 -9px;
	background: var(--prp-text);
	transition: transform 0.4s var(--prp-ease);
}

.prp-close-line:first-child {
	transform: rotate(45deg);
}

.prp-close-line:last-child {
	transform: rotate(-45deg);
}

.prp-offcanvas__close:hover .prp-close-line:first-child {
	transform: rotate(135deg);
}

.prp-offcanvas__close:hover .prp-close-line:last-child {
	transform: rotate(45deg);
}

/* Staggered reveal, matching Salient's off-canvas content animation. */
@keyframes prp-fade-up {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.prp-anim {
	animation: prp-fade-up 0.9s var(--prp-ease) both;
	animation-delay: calc(var(--prp-i, 0) * 70ms + 180ms);
}

@media (prefers-reduced-motion: reduce) {
	.prp-offcanvas__panel,
	.prp-offcanvas__bg {
		transition-duration: 0.01ms;
	}
	.prp-anim {
		animation: none;
	}
}

html.prp-locked,
body.prp-locked {
	overflow: hidden;
}

/* ------------------------------------------------------------------- Content */

.prp-panel__head {
	margin-bottom: 26px;
}

.prp-panel__title {
	margin: 0 0 6px;
	font-size: 26px;
	line-height: 1.25;
	color: var(--prp-text);
}

.prp-panel__subtitle {
	margin: 0;
	color: var(--prp-muted);
	font-size: 14px;
}

.prp-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--prp-muted);
	font-size: 14px;
	padding: 20px 0;
}

/* Product summary */

.prp-product {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	margin-bottom: 30px;
	border: 1px solid var(--prp-line);
	border-radius: var(--prp-radius);
	background: rgba(0, 0, 0, 0.015);
}

.prp-product__media {
	flex: 0 0 76px;
	width: 76px;
	line-height: 0;
}

.prp-product__media img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.prp-product__name {
	margin: 0 0 4px;
	font-size: 16px;
	line-height: 1.35;
}

.prp-product__order {
	margin: 0;
	font-size: 13px;
	color: var(--prp-muted);
}

/* Product picker */

.prp-picker {
	list-style: none;
	margin: 0;
	padding: 0;
}

.prp-picker__item {
	margin: 0 0 12px;
	list-style: none;
}

.prp-picker__btn {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--prp-line);
	border-radius: var(--prp-radius);
	background: transparent;
	text-align: left;
	cursor: pointer;
	color: var(--prp-text);
	transition: border-color 0.35s var(--prp-ease), transform 0.35s var(--prp-ease), box-shadow 0.35s var(--prp-ease);
}

button.prp-picker__btn:hover {
	border-color: var(--prp-accent);
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.07);
}

.prp-picker__item.is-reviewed .prp-picker__btn {
	opacity: 0.55;
	cursor: default;
}

.prp-picker__media img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.prp-picker__body {
	flex: 1 1 auto;
	display: block;
}

.prp-picker__name {
	display: block;
	font-weight: 600;
	line-height: 1.35;
	margin-bottom: 2px;
}

.prp-picker__meta {
	display: block;
	font-size: 13px;
	color: var(--prp-muted);
}

.prp-picker__arrow {
	color: var(--prp-accent);
	font-size: 18px;
}

.prp-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 18px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--prp-muted);
	font-size: 13px;
	cursor: pointer;
}

.prp-back:hover {
	color: var(--prp-accent);
}

/* Fields */

.prp-field {
	margin-bottom: 26px;
}

.prp-label {
	display: block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--prp-text);
}

.prp-form textarea {
	width: 100%;
	min-height: 140px;
	padding: 14px 16px;
	border: 1px solid var(--prp-line);
	border-radius: var(--prp-radius);
	background: #fff;
	color: var(--prp-text);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.6;
	box-sizing: border-box;
	transition: border-color 0.3s var(--prp-ease);
	resize: vertical;
}

.prp-form textarea:focus {
	border-color: var(--prp-accent);
	outline: none;
}

/* Rating */

.prp-rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.prp-rating__input {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.prp-rating__star {
	cursor: pointer;
	line-height: 1;
	padding: 2px;
	margin: 0;
}

.prp-rating__glyph {
	display: block;
	font-size: 30px;
	line-height: 1;
	color: rgba(0, 0, 0, 0.16);
	transition: color 0.25s var(--prp-ease), transform 0.25s var(--prp-ease);
}

.prp-rating__star.is-on .prp-rating__glyph {
	color: var(--prp-star);
}

.prp-rating__star:hover .prp-rating__glyph {
	transform: scale(1.12);
}

.prp-rating__input:focus-visible + .prp-rating__star .prp-rating__glyph {
	outline: 2px solid var(--prp-accent);
	outline-offset: 2px;
}

.prp-rating__value {
	margin-left: 10px;
	font-size: 13px;
	color: var(--prp-muted);
}

/* Media */

.prp-media__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.prp-media__hint {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--prp-muted);
}

.prp-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

.prp-thumbs li {
	position: relative;
	width: 82px;
	height: 82px;
	margin: 0;
	border-radius: 4px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
	list-style: none;
}

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

.prp-thumbs .prp-thumb__video {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 11px;
	color: var(--prp-muted);
	text-align: center;
	padding: 6px;
	box-sizing: border-box;
	word-break: break-word;
}

.prp-thumbs .prp-thumb__remove {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 14px;
	line-height: 20px;
	cursor: pointer;
}

.prp-thumbs li.is-uploading {
	display: flex;
	align-items: center;
	justify-content: center;
}

.prp-thumbs li.is-uploading::after {
	content: "";
	width: 20px;
	height: 20px;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--prp-accent);
	border-radius: 50%;
	animation: prp-spin 0.8s linear infinite;
}

@keyframes prp-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Buttons */

.prp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: var(--prp-radius);
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.35s var(--prp-ease), background 0.35s var(--prp-ease), box-shadow 0.35s var(--prp-ease), color 0.35s var(--prp-ease);
}

.prp-btn:hover {
	transform: translateY(-2px);
}

.prp-btn--primary {
	background: var(--prp-accent);
	color: #fff;
}

.prp-btn--primary:hover {
	color: #fff;
	box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.prp-btn--ghost {
	background: transparent;
	border-color: var(--prp-line);
	color: var(--prp-text);
}

.prp-btn--ghost:hover {
	border-color: var(--prp-accent);
	color: var(--prp-accent);
}

.prp-btn[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.prp-btn__icon {
	font-size: 16px;
	line-height: 1;
}

.prp-spinner {
	display: none;
	width: 15px;
	height: 15px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: prp-spin 0.8s linear infinite;
}

.prp-btn.is-busy .prp-spinner {
	display: block;
}

.prp-actions {
	margin-top: 30px;
	padding-top: 24px;
	border-top: 1px solid var(--prp-line);
}

.prp-actions .prp-btn--primary {
	min-width: 160px;
}

.prp-actions__note {
	margin: 12px 0 0;
	font-size: 12px;
	color: var(--prp-muted);
}

/* Notices */

.prp-notice {
	margin: 0 0 20px;
	padding: 13px 16px;
	border-radius: var(--prp-radius);
	font-size: 14px;
	background: rgba(214, 54, 56, 0.08);
	border: 1px solid rgba(214, 54, 56, 0.25);
	color: #a3282a;
}

.prp-notice.is-info {
	background: rgba(0, 0, 0, 0.04);
	border-color: var(--prp-line);
	color: var(--prp-muted);
}

/* Success / message states */

.prp-success,
.prp-state {
	text-align: left;
}

.prp-success__mark {
	width: 56px;
	height: 56px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--prp-accent);
	color: #fff;
	font-size: 26px;
	line-height: 56px;
	text-align: center;
}

.prp-success__text,
.prp-state__text {
	margin: 0 0 26px;
	color: var(--prp-muted);
	font-size: 15px;
	line-height: 1.65;
}

.prp-success__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* --------------------------------------------------- Review media on product */

.prp-review-media {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 14px 0 4px;
}

.prp-review-media__item {
	display: block;
	width: 84px;
	height: 84px;
	border-radius: 4px;
	overflow: hidden;
	line-height: 0;
}

.prp-review-media__item img,
.prp-review-media__img {
	width: 84px;
	height: 84px;
	object-fit: cover;
	display: block;
	transition: transform 0.4s var(--prp-ease);
}

.prp-review-media__item:hover img {
	transform: scale(1.06);
}

.prp-review-media__video {
	width: 260px;
	max-width: 100%;
	border-radius: 4px;
	background: #000;
}

/* Lightbox */

.prp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	background: rgba(0, 0, 0, 0.88);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s var(--prp-ease);
}

.prp-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.prp-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 4px;
}

.prp-lightbox__close {
	position: absolute;
	top: 20px;
	right: 24px;
	border: 0;
	background: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

/* Salient tweaks: inherit the theme's heading font and button feel. */

.prp-salient .prp-panel__title,
.prp-salient .prp-product__name {
	font-family: inherit;
	letter-spacing: -0.01em;
}

.prp-salient .prp-btn {
	border-radius: 4px;
	letter-spacing: 0.02em;
}

/* Orders table button */

.woocommerce-orders-table__cell-order-actions .button.prp-review {
	background-color: var(--prp-accent);
	color: #fff;
}

@media (max-width: 690px) {
	.prp-offcanvas__inner {
		padding: 68px 24px 44px;
	}

	.prp-panel__title {
		font-size: 22px;
	}

	.prp-offcanvas__panel {
		width: 100%;
	}
}
