/* STS Product Reviews – review form */

.sts-guest-review {
	--sts-accent: #2563eb;
	--sts-text: #1f2937;
	--sts-muted: #6b7280;
	--sts-line: #d9dee7;
	--sts-soft: #eff4ff;
	--sts-star: #f59e0b;
	--sts-radius: 14px;

	box-sizing: border-box;
	max-width: 640px;
	margin: 2rem auto;
	padding: 0 1rem;
	color: var(--sts-text);
	line-height: 1.55;
}
@supports (color: color-mix(in srgb, red, blue)) {
	.sts-guest-review { --sts-soft: color-mix(in srgb, var(--sts-accent) 9%, #fff); }
}
.sts-guest-review *,
.sts-guest-review *::before,
.sts-guest-review *::after { box-sizing: border-box; }
.sts-guest-review [hidden] { display: none !important; }

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

.sts-guest-review .sts-vh {
	/* Visually hidden and never revealed on focus (unlike WordPress's .screen-reader-text). */
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0;
	pointer-events: none;
}

.sts-guest-review__header { margin-bottom: 1.25rem; text-align: center; }
.sts-guest-review__title { margin: 0 0 0.35rem; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; }
.sts-guest-review__intro { margin: 0; color: var(--sts-muted); }

/* ---------- Notices ---------- */
.sts-guest-notice { margin: 0 0 1.1rem; padding: 0.85rem 1rem; border: 1px solid; border-radius: 10px; font-size: 0.95rem; }
.sts-guest-notice--success { color: #14532d; background: #ecfdf3; border-color: #a7e3bf; }
.sts-guest-notice--error { color: #7f1d1d; background: #fef2f2; border-color: #f5b4b4; }

/* ---------- Card ---------- */
.sts-guest-review__form,
.sts-guest-review__done {
	padding: 1.5rem;
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}
.sts-step { min-width: 0; margin: 0; padding: 0; border: 0; }

/* ---------- Progress ---------- */
.sts-guest-review__progress { display: none; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.is-stepped .sts-guest-review__progress { display: flex; justify-content: space-between; position: relative; }
.is-stepped .sts-guest-review__progress::before {
	content: "";
	position: absolute;
	top: 14px;
	right: 16%;
	left: 16%;
	height: 2px;
	background: var(--sts-line);
}
.sts-guest-review__progress li { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; gap: 0.35rem; color: var(--sts-muted); font-size: 0.8rem; font-weight: 600; }
.sts-guest-review__dot {
	display: grid;
	width: 30px;
	height: 30px;
	place-items: center;
	color: var(--sts-muted);
	background: #fff;
	border: 2px solid var(--sts-line);
	border-radius: 50%;
	font-size: 0.85rem;
	transition: all 0.2s ease;
}
.sts-guest-review__progress li.is-current { color: var(--sts-text); }
.sts-guest-review__progress li.is-current .sts-guest-review__dot { color: #fff; background: var(--sts-accent); border-color: var(--sts-accent); }
.sts-guest-review__progress li.is-done .sts-guest-review__dot { color: var(--sts-accent); background: var(--sts-soft); border-color: var(--sts-accent); font-size: 0; }
.sts-guest-review__progress li.is-done .sts-guest-review__dot::before { content: "✓"; font-size: 0.9rem; font-weight: 700; }

/* Steps are only hidden when JavaScript drives them. */
.is-stepped .sts-step:not(.is-active) { display: none; }
.is-stepped .sts-step.is-active { animation: sts-step-in 0.25s ease; }
@keyframes sts-step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Fields ---------- */
.sts-field { margin: 0 0 1.25rem; }
.sts-field__label { display: block; margin: 0 0 0.4rem; font-size: 0.95rem; font-weight: 600; }
.sts-field__label .required { color: #dc2626; }
.sts-field__optional { color: var(--sts-muted); font-weight: 400; }
.sts-field__hint { display: flex; justify-content: space-between; gap: 1rem; margin: 0.35rem 0 0; color: var(--sts-muted); font-size: 0.82rem; }
.sts-field__error { margin: 0.4rem 0 0; color: #b91c1c; font-size: 0.85rem; font-weight: 600; }

.sts-guest-review input[type="text"],
.sts-guest-review input[type="email"],
.sts-guest-review input[type="search"],
.sts-guest-review textarea {
	display: block;
	width: 100%;
	padding: 0.75rem 0.9rem;
	color: var(--sts-text);
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: 10px;
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sts-guest-review textarea { min-height: 9rem; resize: vertical; }
.sts-guest-review input:focus-visible,
.sts-guest-review textarea:focus-visible {
	outline: none;
	border-color: var(--sts-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--sts-accent) 25%, transparent);
}
.sts-field.has-error input,
.sts-field.has-error textarea { border-color: #dc2626; }

.sts-guest-review__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Product picker ---------- */
.sts-picker__selected {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 0.9rem;
	background: var(--sts-soft);
	border: 1px solid color-mix(in srgb, var(--sts-accent) 35%, #fff);
	border-radius: 10px;
}
.sts-picker__name { font-weight: 600; overflow-wrap: anywhere; }
.sts-picker__change { padding: 0; color: var(--sts-accent); background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; }
.sts-picker__list { max-height: 14rem; margin: 0.5rem 0 0; padding: 0; overflow-y: auto; list-style: none; border: 1px solid var(--sts-line); border-radius: 10px; }
.sts-picker__list:empty { display: none; }
.sts-picker__list li + li { border-top: 1px solid var(--sts-line); }
.sts-picker__option { display: block; width: 100%; padding: 0.65rem 0.9rem; color: inherit; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.sts-picker__option:hover,
.sts-picker__option:focus-visible { background: var(--sts-soft); outline: none; }
.sts-guest-review__product-status { margin: 0.4rem 0 0; color: var(--sts-muted); font-size: 0.82rem; }

/* ---------- Star picker ---------- */
.sts-rate { display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 0.15rem; }
.sts-rate input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sts-rate label { padding: 0 0.1rem; color: #cbd2dc; font-size: 2.4rem; line-height: 1; cursor: pointer; transition: color 0.12s ease, transform 0.12s ease; }
.sts-rate label:hover,
.sts-rate label:hover ~ label,
.sts-rate input:checked ~ label { color: var(--sts-star); }
.sts-rate label:hover { transform: scale(1.12); }
.sts-rate input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--sts-accent) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
.sts-rate__text { order: -1; padding-right: 0.7rem; color: var(--sts-muted); font-size: 0.9rem; font-weight: 600; }

/* ---------- Photos ---------- */
.sts-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sts-drop__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	padding: 1.25rem 1rem;
	color: var(--sts-muted);
	text-align: center;
	background: #fafbfc;
	border: 2px dashed var(--sts-line);
	border-radius: 12px;
	font-size: 0.85rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.sts-drop__label strong { color: var(--sts-text); font-size: 0.95rem; }
.sts-drop__label svg { color: var(--sts-accent); }
.sts-drop__label:hover,
.sts-drop.is-over .sts-drop__label { background: var(--sts-soft); border-color: var(--sts-accent); }
.sts-drop__input:focus-visible + .sts-drop__label { outline: 3px solid color-mix(in srgb, var(--sts-accent) 45%, transparent); outline-offset: 2px; }
.sts-drop__previews { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.sts-drop__previews:empty { display: none; }
.sts-drop__item { position: relative; width: 4.5rem; height: 4.5rem; }
.sts-drop__item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sts-drop__remove {
	position: absolute;
	top: -0.45rem;
	right: -0.45rem;
	display: grid;
	width: 1.4rem;
	height: 1.4rem;
	place-items: center;
	padding: 0;
	color: #fff;
	background: #111827;
	border: 2px solid #fff;
	border-radius: 50%;
	font-size: 0.8rem;
	line-height: 1;
	cursor: pointer;
}

/* ---------- Buttons ---------- */
.sts-guest-review__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.6rem; margin-top: 1.5rem; }
.sts-guest-review__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.8rem 1.5rem;
	color: var(--sts-text);
	background: #fff;
	border: 1px solid var(--sts-line);
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease;
}
.sts-guest-review__btn--primary { color: #fff; background: var(--sts-accent); border-color: var(--sts-accent); }
.sts-guest-review__btn:hover { filter: brightness(0.97); }
.sts-guest-review__btn--primary:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
.sts-guest-review__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--sts-accent) 45%, transparent); outline-offset: 2px; }
.sts-guest-review__btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
/* Without JavaScript only the submit button makes sense. */
.sts-guest-review__next,
.sts-guest-review__back { display: none; }
.is-stepped .sts-guest-review__next,
.is-stepped .sts-guest-review__back { display: inline-flex; }
.is-stepped .sts-guest-review__actions .sts-guest-review__back { margin-right: auto; }
.is-stepped.is-last .sts-guest-review__next { display: none; }
.is-stepped:not(.is-last) .sts-guest-review__submit { display: none; }
.sts-guest-review__token-status { margin: 0.5rem 0 0; color: #b91c1c; font-size: 0.85rem; }
.sts-guest-review__token-status:empty { display: none; }
.sts-guest-review__captcha { margin-top: 0.5rem; }

/* ---------- Done panel ---------- */
.sts-guest-review__done { padding: 2.25rem 1.5rem; text-align: center; }
.sts-guest-review__done-icon { display: inline-grid; width: 64px; height: 64px; place-items: center; margin-bottom: 0.75rem; color: #15803d; background: #ecfdf3; border-radius: 50%; }
.sts-guest-review__done h2 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.sts-guest-review__done p { margin: 0 auto 1.4rem; max-width: 30rem; color: var(--sts-muted); }
.sts-guest-review__done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }

@media (max-width: 480px) {
	.sts-guest-review__form,
	.sts-guest-review__done { padding: 1.15rem; }
	.sts-guest-review__actions .sts-guest-review__btn { flex: 1; }
	.sts-rate label { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) {
	.is-stepped .sts-step.is-active { animation: none; }
	.sts-guest-review__dot,
	.sts-rate label { transition: none; }
}
