/* Customer Reviews Manager — Public Styles
   All selectors are namespaced with .crm- to avoid theme conflicts. */

.crm-review-form-wrap,
.crm-reviews-wrap {
	max-width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: 'Poppins', sans-serif;
}

.crm-review-form-wrap *,
.crm-reviews-wrap * {
	box-sizing: border-box;
	font-family: inherit;
}


/* Form */
.crm-review-form {
	display: flex;
	flex-direction: column;
	gap: 1.1em;
}

.crm-form-title {
	margin: 0 0 0.2em;
}

.crm-form-description {
	margin: 0 0 0.6em;
	opacity: 0.75;
}

.crm-form-row {
	display: flex;
	flex-direction: column;
    align-items: start;
	gap: 0.35em;
}

.crm-form-row label,
.crm-rating-label {
	font-weight: 600;
	font-size: 0.95em;
}

.crm-required {
	color: #c0392b;
}

.crm-review-form input[type="text"],
.crm-review-form input[type="email"],
.crm-review-form textarea {
	width: 100%;
	padding: 0.6em 0.75em;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 1em;
	font-family: inherit;
	background: #fff;
	color: inherit;
}

.crm-review-form input:focus,
.crm-review-form textarea:focus,
.crm-star-hit:focus-visible,
.crm-read-more:focus-visible,
.crm-submit-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.crm-field-hint {
	margin: 0.2em 0 0;
	font-size: 0.85em;
	opacity: 0.65;
}

.crm-char-counter {
	margin: 0.2em 0 0;
	font-size: 0.85em;
	text-align: right;
	opacity: 0.65;
}

/* Honeypot: hidden from sighted users and screen readers alike */
.crm-hp-field {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.crm-review-form .crm-submit-btn {
	background-color: #00000000;
    font-family: "Poppins", Sans-serif;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 28px;
    fill: #1F99CE;
    color: #1F99CE;
    border-style: solid;
    border-width: 1px 1px 1px 1px;
    border-color: #1F99CE;
    padding: 12px 40px 12px 40px;
    transition: all ease 300ms;
}

.crm-review-form .crm-submit-btn:hover {
	color: #fff;
    background: #1F99CE;
    border-color: #1F99CE;
}

.crm-review-form .crm-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.crm-form-message {
	font-size: 0.95em;
	padding: 0.2em 0;
}

.crm-form-message.crm-message-success {
	color: #2e7d32;
	font-weight: 600;
}

.crm-form-message.crm-message-error {
	color: #c0392b;
	font-weight: 600;
}

/* Star rating — shared display + input styles.
   Custom inline SVG (no icon font / external CDN dependency, matching the
   plugin's "no third-party plugins required" design). Each star stacks a
   gray "background" star under an orange "foreground" star; the
   foreground is clipped to 0% / 50% / 100% width to render empty, half,
   and full stars precisely — instead of the old approach of relying on
   the "★" text glyph and an nth-child width hack, which rendered as
   distorted, misaligned stars in every browser tested. */
.crm-star-rating {
	all: initial;
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.15em !important;
	line-height: 1 !important;
	vertical-align: middle !important;
	font-family: 'Poppins', sans-serif;
}

.crm-star {
	all: initial;
	position: relative !important;
	display: inline-block !important;
	box-sizing: border-box !important;
}

.crm-star-bg,
.crm-star-fg {
	all: initial;
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	height: 100% !important;
	pointer-events: none !important;
	box-sizing: border-box !important;
}

.crm-star-bg {
	width: 100% !important;
	color: #d8d8d8;
}

.crm-star-fg {
	width: 0%;
	overflow: hidden !important;
	color: #FFF825;
}

/* The SVG is sized to the *full* star (via the --crm-star-size custom
   property, set per context below) and absolutely positioned inside both
   the bg and fg layers — never sized as a percentage of its immediate
   parent. That's what makes the half-star clip work: .crm-star-fg's own
   width is what's set to 0/50/100% (in reviews.js / render_stars()), and
   since the SVG inside it stays full-size, .crm-star-fg's `overflow:
   hidden` crops it cleanly instead of squashing it down to fit.
   `all: initial` on the layers above also means this is immune to any
   global `svg{}` / `path{}` sizing rules a theme or icon library defines
   elsewhere on the page. */
.crm-star-svg {
	all: unset;
	display: block !important;
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: var( --crm-star-size, 1.15em ) !important;
	height: var( --crm-star-size, 1.15em ) !important;
	fill: currentColor !important;
	stroke: none !important;
}

/* Read-only display stars (review cards, summary, admin table). */
.crm-star-rating-display .crm-star {
	--crm-star-size: 1.15em;
	width: 1.15em !important;
	height: 1.15em !important;
}

/* Interactive input stars: each star has two invisible half-width hit
   targets layered on top (left half = X.5, right half = X.0) so users can
   click/tap directly on the half of the star they mean, plus full arrow-key
   support already wired up in reviews.js. */
.crm-star-rating-input {
	gap: 0.15em;
}

.crm-star-rating-input .crm-star {
	--crm-star-size: 1.7em;
	width: 1.7em !important;
	height: 1.7em !important;
	cursor: pointer;
}

/* Hard reset against theme/plugin `button` rules — global button styling
   (borders, background, box-shadow, padding, border-radius, min-width…)
   is the single most common source of "stars render as visible little
   boxes" and "half-star clicks land on the wrong half" bugs, since those
   rules change the buttons' effective box model out from under the exact
   50%-width hit areas below. `all: unset` strips every inherited/cascaded
   property first; everything the widget actually needs is then re-applied
   with `!important` so it always wins regardless of load order or the
   specificity of whatever else targets `button` on the page. */
.crm-star-hit {
	all: unset;
	box-sizing: border-box !important;
	position: absolute !important;
	top: 0 !important;
	height: 100% !important;
	width: 50% !important;
	min-width: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	outline-offset: 2px;
}

.crm-star-hit-half {
	left: 0 !important;
}

.crm-star-hit-full {
	left: 50% !important;
}

.crm-rating-readout {
	margin: 0.3em 0 0;
	font-size: 0.9em;
	font-weight: 600;
}

/* Review listing */
.crm-reviews-summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 1.5em;
	padding-bottom: 1em;
	border-bottom: 1px solid #eee;
}

.crm-average-number {
	font-weight: 700;
	font-size: 1.1em;
}

.crm-review-count {
	opacity: 0.65;
	font-size: 0.9em;
}

.crm-reviews-list {
	display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.crm-review-card {
	padding: 1.1em 1.3em;
	border: 1px solid #eaeaea;
	border-radius: 10px;
	background: #fff;
}

.crm-review-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6em;
	margin-bottom: 0.15em;
}

.crm-review-author {
	font-weight: 700;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-state {
	font-size: 0.85em;
	opacity: 0.6;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-state::before {
	content: '\2022';
	margin-right: 0.5em;
	opacity: 0.6;
}

.crm-review-rating-number {
	font-size: 0.85em;
	opacity: 0.6;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-date {
	font-size: 0.85em;
	opacity: 0.55;
	margin-bottom: 0.6em;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-title {
	margin: 0 0 0.35em;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.3;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-body p {
	margin: 0;
	line-height: 1.55;
    font-family: 'Poppins',Sans-serif;
}

.crm-review-body .crm-read-more {
	margin-top: 0.4em;
	padding: 0;
	border: 0;
	background: transparent;
	color: #1d4ed8;
	font-weight: 600;
	cursor: pointer;
	font-size: 0.9em;
    font-family: 'Poppins',Sans-serif;
    color: #1F99CE;
}

.crm-review-body .crm-read-more:hover {
	text-decoration: underline;
    background: transparent;
}

.crm-no-reviews {
	opacity: 0.65;
	font-style: italic;
    font-family: 'Poppins',Sans-serif;
}

.crm-load-more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75em;
	margin-top: 2em;
}

.crm-reviews-wrap .crm-load-more {
	padding: 0.7em 2.2em;
	color: #1F99CE;
	border: 1px solid #1F99CE;
	border-radius: 50px;
	background: #fff;
	cursor: pointer;
	font-family: 'Poppins', Sans-serif;
	font-size: 1em;
	font-weight: 500;
	line-height: 1.2;
	transition: all ease 300ms;
}

.crm-reviews-wrap .crm-load-more:hover:not( :disabled ) {
	background: #1F99CE;
	color: #fff;
}

.crm-reviews-wrap .crm-load-more:focus-visible {
	outline: 2px solid #1F99CE;
	outline-offset: 3px;
}

.crm-reviews-wrap .crm-load-more:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Small spinner while a batch is in flight. */
.crm-reviews-wrap .crm-load-more.is-loading .crm-load-more-label::before {
	content: '';
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-right: 0.55em;
	vertical-align: -0.1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: crm-spin 0.7s linear infinite;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.crm-reviews-wrap .crm-load-more.is-loading .crm-load-more-label::before {
		animation: none;
	}
}

.crm-load-more-status {
	margin: 0;
	font-size: 0.9em;
	font-family: 'Poppins', Sans-serif;
	opacity: 0.7;
}

/* Newly appended cards get tabindex="-1" for focus management — never show
   a focus ring on the card itself. */
.crm-review-card:focus {
	outline: none;
}

.crm-notice {
	padding: 0.8em 1em;
	border-radius: 6px;
	background: #f6f6f6;
}

/* "Read More" SweetAlert2 popup body. */
.crm-swal-author {
	margin: 0 0 0.8em;
	text-align: left;
	font-size: 0.85em;
	opacity: 0.6;
}

.crm-swal-review-text {
	margin: 0;
	text-align: left;
	white-space: pre-wrap;
	line-height: 1.55;
}

/* Responsive */
@media (max-width: 1279px)
{
#crm-reviews-list
{
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
}
@media (max-width: 833px)
{
#crm-reviews-list
{
grid-template-columns: 1fr;
gap: 20px;
}
}
@media (max-width: 480px) {
	.crm-review-form-wrap,
	.crm-reviews-wrap {
		padding: 0 0.25em;
	}

	.crm-star-rating-input .crm-star {
		--crm-star-size: 1.9em;
		width: 1.9em !important;
		height: 1.9em !important;
	}

	.crm-submit-btn {
		width: 100%;
		text-align: center;
	}
}
