/* Product availability line, rating near the title, reviews list and form (inc/availability.php, inc/reviews.php).
 * Enqueued on product pages only. Nothing here may be wider than the screen at 390px: every flex child can shrink. */

/* Availability line beside the quote buttons */
.pstock {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--text);
	overflow-wrap: anywhere;
}

.pstock__dot {
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--brand);
	box-shadow: 0 0 0 3px var(--brand-tint);
}

.pstock--order .pstock__dot {
	background: #e08a00;
	box-shadow: 0 0 0 3px #fff1d9;
}

/* Stars: grey layer plus a gold layer cut to --rv (share of 5) */
.rstars {
	position: relative;
	display: inline-block;
	flex: none;
	font-size: 17px;
	line-height: 1;
	letter-spacing: 1px;
	color: #cbd4cd;
	white-space: nowrap;
	vertical-align: middle;
}

.rstars::before,
.rstars::after {
	content: "\2605\2605\2605\2605\2605";
}

.rstars::after {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--rv, 0);
	overflow: hidden;
	color: #e08a00;
}

/* "4,8 · 5 đánh giá" near the title */
.prating {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	align-self: flex-start;
	max-width: 100%;
	color: var(--text-muted);
	font-size: 14px;
	line-height: 1.3;
	text-decoration: none;
}

.prating strong {
	color: var(--text);
	font-weight: 700;
}

.prating:hover span:last-child {
	color: var(--brand-dark);
	text-decoration: underline;
}

/* Reviews section */
.previews .psection__title + .previews__sum {
	margin-top: 4px;
}

.previews__sum {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 0;
	font-size: 15px;
	color: var(--text-muted);
}

.previews__sum strong {
	color: var(--text);
	font-size: 22px;
	font-family: var(--font-head);
}

.rlist {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
}

.rcard {
	min-width: 0;
	padding: 20px 22px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
}

.rcard__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.rcard__badge {
	padding: 4px 9px;
	border-radius: 99px;
	background: var(--brand-tint);
	color: var(--brand-dark);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.rcard__text {
	margin: 12px 0 0;
	font-size: 14.5px;
	line-height: 1.7;
	color: var(--text);
	overflow-wrap: anywhere;
	white-space: pre-line;
}

.rcard__by {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: var(--text-muted);
	overflow-wrap: anywhere;
}

.rcard__by strong {
	color: var(--text);
}

/* Write a review */
.rform-wrap {
	margin-top: 24px;
	max-width: 760px;
}

.rform-toggle {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 12px 18px;
	border: 1px solid var(--border-strong);
	border-radius: 8px;
	color: var(--text);
	font-family: var(--font-head);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.3px;
	line-height: 1.3;
	cursor: pointer;
	list-style: none;
}

.rform-toggle::-webkit-details-marker {
	display: none;
}

.rform-toggle:hover {
	border-color: var(--brand);
	color: var(--brand-dark);
}

.rform-wrap[open] > .rform-toggle {
	border-color: var(--brand);
}

.rform {
	margin-top: 18px;
	padding: 22px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface-alt);
}

.rform p {
	margin: 0 0 14px;
}

.rform label,
.rform legend {
	display: block;
	margin-bottom: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--text);
}

.rform input[type="text"],
.rform input[type="email"],
.rform textarea {
	display: block;
	width: 100%;
	min-width: 0;
	padding: 11px 12px;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
}

.rform textarea {
	resize: vertical;
}

.rform__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
}

.rform__hint,
.rform__note {
	display: block;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--text-muted);
}

.rform__hint {
	margin-top: 4px;
}

.rform__note--verified {
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--brand-tint);
	color: var(--brand-dark);
}

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

.rform__msg {
	margin: 0 0 14px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--brand-dark);
	overflow-wrap: anywhere;
}

.rform__msg:empty {
	display: none;
}

.rform__msg.is-error {
	color: var(--red);
}

.rform__msg:focus {
	outline: none;
}

.rform.is-done .rform__fields {
	display: none;
}

.rform.is-done .rform__msg {
	margin-bottom: 0;
}

.rform__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	height: 48px;
	padding-inline: 28px;
	border: 0;
	border-radius: 8px;
	background: var(--brand);
	color: var(--text-invert);
	font-family: var(--font-head);
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 1.2px;
	cursor: pointer;
}

.rform__submit:hover {
	background: var(--brand-dark);
}

.rform__submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Star picker: radios in DOM order 5..1 laid out right-to-left, so "checked or hovered" colours the ones after it */
.rstars-input {
	min-width: 0;
	margin: 0 0 14px;
	padding: 0;
	border: 0;
}

.rstars-input__row {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
}

.rstars-input input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.rstars-input label {
	margin: 0;
	padding: 2px 4px;
	border-radius: 6px;
	font-size: 34px;
	line-height: 1;
	color: #cbd4cd;
	cursor: pointer;
}

.rstars-input input:checked ~ label,
.rstars-input label:hover,
.rstars-input label:hover ~ label {
	color: #e08a00;
}

.rstars-input input:focus-visible + label {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

@media (max-width: 760px) {
	.rlist,
	.rform__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.rform {
		padding: 16px;
	}

	.rstars-input label {
		font-size: 38px;
		padding: 2px 3px;
	}
}
