/* =========================================================================
   Attractive Product Reviews — frontend styles
   ========================================================================= */
.apr-wrap {
	--apr-accent: #ff9f1c;
	--apr-accent-soft: #fff4e0;
	--apr-ink: #1a1d21;
	--apr-muted: #6b7280;
	--apr-line: #ececf0;
	--apr-card: #ffffff;
	--apr-bg: #fafafb;
	--apr-radius: 16px;
	--apr-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.18);
	font-family: inherit;
	color: var(--apr-ink);
	max-width: 860px;
}

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

/* ---------- Summary ---------- */
.apr-summary {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 28px;
	align-items: center;
	padding: 26px 28px;
	background: var(--apr-card);
	border: 1px solid var(--apr-line);
	border-radius: var(--apr-radius);
	box-shadow: var(--apr-shadow);
	margin-bottom: 24px;
}
.apr-summary__score { text-align: center; border-right: 1px solid var(--apr-line); padding-right: 24px; }
.apr-summary__big {
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -1px;
	background: linear-gradient(135deg, var(--apr-accent), #ff6b35);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.apr-summary__count { color: var(--apr-muted); font-size: 13px; margin-top: 6px; }

.apr-bar { display: flex; align-items: center; gap: 10px; margin: 5px 0; }
.apr-bar__label { width: 30px; font-size: 13px; color: var(--apr-muted); font-variant-numeric: tabular-nums; }
.apr-bar__track { flex: 1; height: 8px; background: #f0f0f3; border-radius: 99px; overflow: hidden; }
.apr-bar__fill {
	display: block; height: 100%;
	background: linear-gradient(90deg, var(--apr-accent), #ffb347);
	border-radius: 99px;
	transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.apr-bar__num { width: 28px; text-align: right; font-size: 13px; color: var(--apr-muted); font-variant-numeric: tabular-nums; }

/* ---------- Stars ---------- */
.apr-stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.apr-star { fill: #d8d8de; }
.apr-star--on { fill: var(--apr-accent); }
.apr-summary__score .apr-stars { margin-top: 10px; }

/* ---------- Form ---------- */
.apr-form-card { margin-bottom: 28px; }
.apr-form-toggle {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--apr-ink); color: #fff;
	border: none; border-radius: 12px;
	padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease;
}
.apr-form-toggle:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(16,24,40,.45); }
.apr-form-toggle svg { stroke: #fff; }

.apr-form {
	margin-top: 16px;
	padding: 24px;
	background: var(--apr-card);
	border: 1px solid var(--apr-line);
	border-radius: var(--apr-radius);
	box-shadow: var(--apr-shadow);
	animation: apr-slide .25s ease;
}
@keyframes apr-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.apr-field { margin-bottom: 16px; }
.apr-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.apr-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--apr-ink); }
.apr-form input[type="text"],
.apr-form input[type="email"],
.apr-form textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--apr-line);
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: var(--apr-ink);
	transition: border-color .15s, box-shadow .15s;
}
.apr-form input:focus,
.apr-form textarea:focus {
	outline: none;
	border-color: var(--apr-accent);
	box-shadow: 0 0 0 3px var(--apr-accent-soft);
}
.apr-form textarea { resize: vertical; }

/* Interactive rating */
.apr-rate { display: inline-flex; gap: 2px; margin-bottom: 18px; }
.apr-rate__star {
	background: none; border: none; padding: 2px; cursor: pointer;
	line-height: 0;
}
.apr-rate__star svg { fill: #d8d8de; transition: fill .12s ease, transform .12s ease; }
.apr-rate__star:hover svg { transform: scale(1.12); }
.apr-rate__star.is-active svg,
.apr-rate.is-hovering .apr-rate__star.is-hover svg { fill: var(--apr-accent); }

/* Upload */
.apr-upload__btn {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 16px;
	border: 1.5px dashed var(--apr-line);
	border-radius: 10px;
	cursor: pointer; font-size: 13px; font-weight: 600; color: var(--apr-muted);
	transition: border-color .15s, color .15s, background .15s;
}
.apr-upload__btn:hover { border-color: var(--apr-accent); color: var(--apr-accent); background: var(--apr-accent-soft); }
.apr-upload__btn svg { stroke: currentColor; }
.apr-upload__previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.apr-preview {
	position: relative; width: 64px; height: 64px;
	border-radius: 10px; overflow: hidden; border: 1px solid var(--apr-line);
}
.apr-preview img { width: 100%; height: 100%; object-fit: cover; }
.apr-preview__remove {
	position: absolute; top: 2px; right: 2px;
	width: 18px; height: 18px; border-radius: 50%;
	background: rgba(0,0,0,.6); color: #fff; border: none; cursor: pointer;
	font-size: 12px; line-height: 18px; padding: 0;
}

.apr-form__footer { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.apr-submit {
	background: linear-gradient(135deg, var(--apr-accent), #ff6b35);
	color: #fff; border: none; border-radius: 12px;
	padding: 12px 26px; font-size: 14px; font-weight: 700; cursor: pointer;
	transition: transform .15s, box-shadow .15s, opacity .15s;
}
.apr-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(255,107,53,.7); }
.apr-submit:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.apr-form__msg { font-size: 13px; }
.apr-form__msg.is-ok { color: #16a34a; }
.apr-form__msg.is-err { color: #dc2626; }

/* Honeypot — hidden from humans, visible to dumb bots */
.apr-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 0; width: 0; overflow: hidden;
}

/* Math captcha field */
.apr-captcha--math input[type="text"] {
	max-width: 140px;
}

/* ---------- Review list ---------- */
.apr-list { display: flex; flex-direction: column; gap: 16px; }
.apr-empty { color: var(--apr-muted); text-align: center; padding: 40px 0; }

.apr-review {
	padding: 22px 24px;
	background: var(--apr-card);
	border: 1px solid var(--apr-line);
	border-radius: var(--apr-radius);
	box-shadow: var(--apr-shadow);
	transition: transform .18s ease, box-shadow .18s ease;
}
.apr-review:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 16px 36px -18px rgba(16,24,40,.28); }

.apr-review__head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.apr-avatar {
	width: 46px; height: 46px; border-radius: 50%;
	display: grid; place-items: center;
	background: linear-gradient(135deg, var(--apr-accent), #ff6b35);
	color: #fff; font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.apr-review__name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.apr-verified {
	display: inline-flex; align-items: center; gap: 3px;
	font-size: 11px; font-weight: 600; color: #16a34a;
	background: #ecfdf3; padding: 2px 8px; border-radius: 99px;
}
.apr-verified svg { stroke: #16a34a; }
.apr-review__sub { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.apr-review__sub time { font-size: 12px; color: var(--apr-muted); }
.apr-review__body { font-size: 14.5px; line-height: 1.65; color: #374151; }
.apr-review__body p { margin: 0 0 8px; }

/* Gallery */
.apr-review__gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Store / admin replies */
.apr-replies { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.apr-reply {
	background: var(--apr-bg);
	border: 1px solid var(--apr-line);
	border-radius: 12px;
	padding: 12px 16px;
	margin-left: 18px;
	position: relative;
}
.apr-reply--staff {
	background: var(--apr-accent-soft);
	border-color: var(--apr-accent);
	border-left-width: 3px;
}
.apr-reply__head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.apr-reply__icon { color: var(--apr-muted); flex-shrink: 0; }
.apr-reply__name { font-weight: 700; font-size: 13.5px; color: var(--apr-ink); }
.apr-reply__badge {
	font-size: 11px; font-weight: 700; color: #fff;
	background: var(--apr-accent); padding: 2px 8px; border-radius: 99px;
}
.apr-reply__date { font-size: 12px; color: var(--apr-muted); margin-left: auto; }
.apr-reply__body { font-size: 14px; line-height: 1.6; color: #374151; }
.apr-reply__body p { margin: 0 0 6px; }
.apr-reply__body p:last-child { margin-bottom: 0; }

.apr-thumb {
	width: 84px; height: 84px; border-radius: 12px; overflow: hidden;
	display: block; cursor: zoom-in; border: 1px solid var(--apr-line);
	transition: transform .15s ease;
}
.apr-thumb:hover { transform: scale(1.04); }
.apr-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Footer / helpful */
.apr-review__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--apr-line); }
.apr-helpful {
	display: inline-flex; align-items: center; gap: 6px;
	background: none; border: 1px solid var(--apr-line);
	border-radius: 99px; padding: 7px 14px;
	font-size: 13px; font-weight: 600; color: var(--apr-muted); cursor: pointer;
	transition: all .15s ease;
}
.apr-helpful:hover { border-color: var(--apr-accent); color: var(--apr-accent); background: var(--apr-accent-soft); }
.apr-helpful svg { stroke: currentColor; }
.apr-helpful.is-voted { color: var(--apr-accent); border-color: var(--apr-accent); background: var(--apr-accent-soft); cursor: default; }

/* ---------- Review type toggle + product picker (wall form) ---------- */
.apr-type-toggle { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.apr-type-option {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 14px;
	border: 1.5px solid var(--apr-line);
	border-radius: 10px;
	font-size: 13.5px; font-weight: 600; color: var(--apr-muted);
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.apr-type-option input { accent-color: var(--apr-accent); }
.apr-type-option:has(input:checked) {
	border-color: var(--apr-accent); color: var(--apr-ink); background: var(--apr-accent-soft);
}
.apr-form select {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--apr-line);
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	color: var(--apr-ink);
}
.apr-form select:focus {
	outline: none;
	border-color: var(--apr-accent);
	box-shadow: 0 0 0 3px var(--apr-accent-soft);
}

/* Source badge on the "all reviews" wall */
.apr-review__source { margin-top: 4px; }
.apr-source-badge {
	display: inline-flex; align-items: center;
	font-size: 11.5px; font-weight: 600;
	color: var(--apr-muted);
	background: var(--apr-bg);
	border: 1px solid var(--apr-line);
	padding: 3px 10px; border-radius: 99px;
	text-decoration: none;
}
a.apr-source-badge--product:hover { color: var(--apr-accent); border-color: var(--apr-accent); }
.apr-source-badge--general { color: #7c3aed; background: #f5f0ff; border-color: #e4d8ff; }

/* Pending badge */
.apr-pending-badge {
	display: inline-flex; align-items: center;
	font-size: 11px; font-weight: 700; color: #b45309;
	background: #fff7ed; border: 1px solid #fed7aa;
	padding: 2px 8px; border-radius: 99px;
}
.apr-review--pending { border-color: #fed7aa; }

/* Inline edit form */
.apr-edit-form {
	margin-top: 12px; padding: 16px;
	background: var(--apr-bg);
	border: 1px solid var(--apr-line);
	border-radius: 12px;
}
.apr-edit-form textarea {
	width: 100%; margin-top: 10px;
	padding: 10px 12px;
	border: 1px solid var(--apr-line);
	border-radius: 10px;
	font-size: 14px; font-family: inherit;
	resize: vertical;
}
.apr-edit-form textarea:focus {
	outline: none; border-color: var(--apr-accent);
	box-shadow: 0 0 0 3px var(--apr-accent-soft);
}
.apr-edit-form__footer { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.apr-submit--sm { padding: 8px 18px; font-size: 13px; }
.apr-cancel-edit {
	background: none; border: none; color: var(--apr-muted);
	font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px;
}
.apr-cancel-edit:hover { color: var(--apr-ink); }

/* Review actions: edit / approve / trash / delete */
.apr-review__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.apr-review__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.apr-action {
	background: none;
	border: 1px solid var(--apr-line);
	border-radius: 99px;
	padding: 6px 13px;
	font-size: 12.5px; font-weight: 600; color: var(--apr-muted);
	cursor: pointer;
	transition: all .15s ease;
}
.apr-action:hover { border-color: var(--apr-accent); color: var(--apr-accent); background: var(--apr-accent-soft); }
.apr-action:disabled { opacity: .5; cursor: default; }
.apr-action--danger:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

/* Load more */
.apr-load-more-wrap { text-align: center; margin-top: 20px; }
.apr-load-more {
	background: none;
	border: 1.5px solid var(--apr-line);
	border-radius: 12px;
	padding: 11px 24px; font-size: 13.5px; font-weight: 700; color: var(--apr-ink);
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.apr-load-more:hover { border-color: var(--apr-accent); color: var(--apr-accent); background: var(--apr-accent-soft); }
.apr-load-more:disabled { opacity: .6; cursor: default; }

/* ---------- Lightbox ---------- */
.apr-lightbox {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(10,12,16,.86);
	display: flex; align-items: center; justify-content: center;
	padding: 30px; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.apr-lightbox.is-open { opacity: 1; pointer-events: auto; }
.apr-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.apr-lightbox__close {
	position: absolute; top: 22px; right: 26px;
	background: rgba(255,255,255,.12); border: none; color: #fff;
	width: 42px; height: 42px; border-radius: 50%; font-size: 22px; cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
	.apr-summary { grid-template-columns: 1fr; gap: 18px; text-align: center; }
	.apr-summary__score { border-right: none; border-bottom: 1px solid var(--apr-line); padding-right: 0; padding-bottom: 18px; }
	.apr-summary__score .apr-stars { justify-content: center; display: inline-flex; }
	.apr-field-row { grid-template-columns: 1fr; }
}
