/* Advanced Product Reviews for WooCommerce — front-end */

:root {
	--apr-accent: #4f46e5;
	--apr-accent-hover: #4338ca;
	--apr-star: #ff9d00;
	--apr-star-empty: #d8dadf;
	--apr-text: #1f2330;
	--apr-muted: #6b7280;
	--apr-border: #e6e7eb;
	--apr-bg-soft: #f6f7f9;
	--apr-radius: 12px;
	--apr-verified: #1a8754;
}

.apr-reviews {
	color: var(--apr-text);
	font-size: 15px;
	line-height: 1.55;
}

.apr-reviews *,
.apr-reviews *::before,
.apr-reviews *::after {
	box-sizing: border-box;
}

.apr-reviews .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Estrelas (exibição) ---------- */
.apr-stars {
	display: inline-block;
	line-height: 1;
}

.apr-stars-track {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	font-size: 16px;
	letter-spacing: 2px;
	color: var(--apr-star-empty);
}

.apr-stars-fill {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: var(--apr-star);
}

/* ---------- Box de resumo ---------- */
.apr-summary {
	display: grid;
	grid-template-columns: minmax(160px, 220px) 1fr;
	gap: 28px;
	padding: 24px;
	margin-bottom: 28px;
	background: var(--apr-bg-soft);
	border: 1px solid var(--apr-border);
	border-radius: var(--apr-radius);
}

.apr-summary-score {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 6px;
	padding-right: 24px;
	border-right: 1px solid var(--apr-border);
}

.apr-summary-average {
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
}

.apr-summary-score .apr-stars-track {
	font-size: 20px;
}

.apr-summary-count {
	color: var(--apr-muted);
	font-size: 14px;
}

.apr-summary-bars {
	display: flex;
	flex-direction: column;
	gap: 6px;
	justify-content: center;
}

.apr-bar-row {
	display: grid;
	grid-template-columns: 42px 1fr 44px;
	align-items: center;
	gap: 10px;
}

.apr-bar-label {
	font-size: 13px;
	color: var(--apr-muted);
	white-space: nowrap;
}

.apr-bar-track,
.apr-crit-track,
.apr-rc-track {
	height: 8px;
	background: #e9eaee;
	border-radius: 999px;
	overflow: hidden;
}

.apr-bar-fill {
	display: block;
	height: 100%;
	background: var(--apr-star);
	border-radius: 999px;
}

.apr-bar-value {
	font-size: 13px;
	color: var(--apr-muted);
	text-align: right;
}

.apr-summary-criteria {
	grid-column: 1 / -1;
	padding-top: 20px;
	border-top: 1px solid var(--apr-border);
}

.apr-summary-subtitle {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--apr-muted);
}

.apr-crit-row {
	display: grid;
	grid-template-columns: minmax(120px, 220px) 1fr 40px;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.apr-crit-label {
	font-size: 14px;
}

.apr-crit-fill {
	display: block;
	height: 100%;
	background: var(--apr-accent);
	border-radius: 999px;
}

.apr-crit-value {
	font-size: 13px;
	font-weight: 600;
	text-align: right;
}

/* ---------- Galeria ---------- */
.apr-gallery {
	margin-bottom: 28px;
}

.apr-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 10px;
}

.apr-gallery-item,
.apr-review-photo {
	padding: 0;
	margin: 0;
	border: 1px solid var(--apr-border);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background: none;
	aspect-ratio: 1 / 1;
	transition: transform .15s ease;
}

.apr-gallery-item:hover,
.apr-review-photo:hover {
	transform: scale(1.03);
}

.apr-gallery-item img,
.apr-review-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---------- Toolbar ---------- */
.apr-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.apr-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.apr-chip {
	padding: 7px 14px;
	font-size: 13px;
	border: 1px solid var(--apr-border);
	border-radius: 999px;
	background: #fff;
	color: var(--apr-text);
	cursor: pointer;
	transition: all .15s ease;
}

.apr-chip:hover {
	border-color: var(--apr-accent);
}

.apr-chip.is-active {
	background: var(--apr-accent);
	border-color: var(--apr-accent);
	color: #fff;
}

.apr-toolbar-right {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.apr-search input,
.apr-sort select {
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid var(--apr-border);
	border-radius: 8px;
	background: #fff;
	color: var(--apr-text);
}

.apr-search input {
	min-width: 200px;
}

/* ---------- Botões ---------- */
.apr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	border: 1px solid var(--apr-border);
	border-radius: 8px;
	background: #fff;
	color: var(--apr-text);
	cursor: pointer;
	transition: all .15s ease;
}

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

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

.apr-btn-primary:hover {
	background: var(--apr-accent-hover);
	border-color: var(--apr-accent-hover);
}

.apr-btn[disabled] {
	opacity: .6;
	cursor: progress;
}

.apr-loadmore-wrap {
	text-align: center;
	margin-top: 22px;
}

/* ---------- Lista de avaliações ---------- */
.apr-list-wrap {
	transition: opacity .2s ease;
}

.apr-list-wrap[aria-busy="true"] {
	opacity: .45;
	pointer-events: none;
}

.apr-list-clean {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.apr-list-masonry {
	column-count: 2;
	column-gap: 18px;
}

.apr-list-masonry .apr-review {
	break-inside: avoid;
	margin-bottom: 18px;
}

.apr-empty {
	padding: 32px;
	text-align: center;
	color: var(--apr-muted);
	background: var(--apr-bg-soft);
	border-radius: var(--apr-radius);
}

.apr-review {
	padding: 18px;
	border: 1px solid var(--apr-border);
	border-radius: var(--apr-radius);
	background: #fff;
}

.apr-review-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.apr-avatar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--apr-accent);
	color: #fff;
	font-weight: 700;
	overflow: hidden;
	flex-shrink: 0;
}

.apr-avatar-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.apr-review-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.apr-review-name {
	font-weight: 700;
}

.apr-badge-verified {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	font-weight: 600;
	color: var(--apr-verified);
}

.apr-review-date {
	font-size: 13px;
	color: var(--apr-muted);
	white-space: nowrap;
}

.apr-review-rating {
	margin-bottom: 8px;
}

.apr-review-criteria {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 6px 16px;
}

.apr-review-criteria li {
	display: grid;
	grid-template-columns: 1fr 70px;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--apr-muted);
}

.apr-rc-track {
	height: 6px;
}

.apr-rc-fill {
	display: block;
	height: 100%;
	background: var(--apr-star);
	border-radius: 999px;
}

.apr-review-body {
	margin-bottom: 10px;
}

.apr-review-body p {
	margin: 0 0 8px;
}

.apr-review-media {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.apr-review-media .apr-review-photo {
	width: 78px;
	height: 78px;
}

/* ---------- Modal ---------- */
.apr-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.apr-modal[hidden] {
	display: none;
}

.apr-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 18, 26, .55);
}

.apr-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px;
	background: #fff;
	border-radius: var(--apr-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.apr-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	font-size: 24px;
	line-height: 1;
	border: 0;
	background: none;
	color: var(--apr-muted);
	cursor: pointer;
}

.apr-form-title {
	margin: 0 0 18px;
	font-size: 20px;
}

/* ---------- Formulário ---------- */
.apr-field {
	display: block;
	margin-bottom: 16px;
}

.apr-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.apr-field-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
}

.apr-form input[type="text"],
.apr-form input[type="email"],
.apr-form input[type="search"],
.apr-form textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	font-family: inherit;
	border: 1px solid var(--apr-border);
	border-radius: 8px;
	background: #fff;
	color: var(--apr-text);
}

.apr-form input:focus,
.apr-form textarea:focus,
.apr-form select:focus {
	outline: 2px solid var(--apr-accent);
	outline-offset: 1px;
	border-color: var(--apr-accent);
}

.apr-form textarea {
	resize: vertical;
}

/* honeypot */
.apr-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* estrelas interativas */
.apr-stars-input {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
}

.apr-stars-input input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.apr-stars-input label {
	font-size: 30px;
	line-height: 1;
	padding: 0 2px;
	color: var(--apr-star-empty);
	cursor: pointer;
	transition: color .1s ease;
}

.apr-stars-input label:hover,
.apr-stars-input label:hover ~ label,
.apr-stars-input input:checked ~ label {
	color: var(--apr-star);
}

.apr-stars-input input:focus-visible + label {
	outline: 2px solid var(--apr-accent);
	border-radius: 4px;
}

/* dropzone */
.apr-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 22px;
	text-align: center;
	color: var(--apr-muted);
	border: 2px dashed var(--apr-border);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.apr-dropzone p {
	margin: 0;
	font-size: 13px;
}

.apr-dropzone.is-dragover,
.apr-dropzone:hover {
	border-color: var(--apr-accent);
	background: var(--apr-bg-soft);
}

.apr-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.apr-preview {
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--apr-border);
}

.apr-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.apr-preview.is-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	color: var(--apr-muted);
	background: var(--apr-bg-soft);
}

.apr-preview-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 20px;
	height: 20px;
	font-size: 14px;
	line-height: 18px;
	text-align: center;
	border: 0;
	border-radius: 50%;
	background: rgba(15, 18, 26, .75);
	color: #fff;
	cursor: pointer;
}

.apr-form-feedback {
	margin-bottom: 12px;
	font-size: 14px;
}

.apr-form-feedback:empty {
	display: none;
}

.apr-form-feedback.is-error {
	color: #c0392b;
}

.apr-form-feedback.is-success {
	color: var(--apr-verified);
}

.apr-form-actions {
	display: flex;
	justify-content: flex-end;
}

/* ---------- Lightbox ---------- */
.apr-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 12, 18, .9);
}

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

.apr-lightbox-close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 40px;
	height: 40px;
	font-size: 30px;
	line-height: 1;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
}

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
	.apr-summary {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.apr-summary-score {
		padding-right: 0;
		padding-bottom: 20px;
		border-right: 0;
		border-bottom: 1px solid var(--apr-border);
	}

	.apr-list-masonry {
		column-count: 1;
	}

	.apr-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.apr-search input {
		min-width: 0;
		width: 100%;
	}

	.apr-field-row {
		grid-template-columns: 1fr;
	}
}

/* ---------- Resumo por IA ---------- */
.apr-summary-ai {
	grid-column: 1 / -1;
	padding-top: 20px;
	border-top: 1px solid var(--apr-border);
}

.apr-ai-text {
	margin: 0 0 6px;
}

.apr-ai-note {
	font-size: 12px;
	color: var(--apr-muted);
}

/* ---------- Perguntas & Respostas ---------- */
.apr-qa {
	color: var(--apr-text);
	font-size: 15px;
}

.apr-qa-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 28px;
}

.apr-qa-item {
	padding: 16px 18px;
	border: 1px solid var(--apr-border);
	border-radius: var(--apr-radius);
	background: #fff;
}

.apr-qa-row {
	display: flex;
	gap: 10px;
}

.apr-qa-answer {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed var(--apr-border);
}

.apr-qa-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	flex-shrink: 0;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 700;
	color: #fff;
}

.apr-qa-mark-q {
	background: var(--apr-accent);
}

.apr-qa-mark-a {
	background: var(--apr-verified);
}

.apr-qa-body {
	flex: 1;
	min-width: 0;
}

.apr-qa-text p {
	margin: 0 0 6px;
}

.apr-qa-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--apr-muted);
}

.apr-badge-store {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: var(--apr-accent);
	border-radius: 999px;
}

.apr-qa-reply {
	margin-top: 10px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--apr-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.apr-qa-answer-form {
	margin-top: 12px;
}

.apr-qa-answer-form[hidden] {
	display: none;
}

.apr-qa-ask {
	padding: 20px;
	background: var(--apr-bg-soft);
	border-radius: var(--apr-radius);
}

.apr-qa-ask .apr-form-title {
	margin-top: 0;
}

/* ---------- Resposta da loja ---------- */
.apr-review-reply {
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--apr-bg-soft);
	border-left: 3px solid var(--apr-accent);
	border-radius: 8px;
}

.apr-review-reply-text {
	margin-top: 4px;
}

.apr-review-reply-text p {
	margin: 0 0 6px;
}

.apr-review-reply-meta {
	font-size: 13px;
	color: var(--apr-muted);
}

.apr-review-reply-form {
	margin-top: 10px;
}

.apr-review-reply-form[hidden] {
	display: none;
}
