/*
 * عابرين — pages/product.css
 * Single product page (woocommerce/single-product.php + template-parts/product/*):
 * top block (gallery + info), variation chips, customer fields card, offer box,
 * buy row, delivery/trust badges, description + activation steps box, reviews
 * box (summary, list, form with star picker), share row, related carousel and
 * the mobile sticky buy bar. Handle: stv-page-product.
 */

/* ===== Page + top block ===== */
/* The page container only: the breadcrumbs bar and the sticky bar have their own `.stv-container` */
.stv-product-page > .stv-container:not(.stv-product-page__notices) {
	padding-block: var(--stv-space-4) var(--stv-space-8);
}

/*
 * WooCommerce notices (woocommerce_before_single_product) sit in the page
 * container, aligned with the product; the wrapper takes no room while the
 * notices list is empty (woocommerce.css hides an empty wrapper).
 */
.stv-product-page__notices .woocommerce-notices-wrapper:not(:empty) { margin-block: var(--stv-space-4) var(--stv-space-2); }

.stv-product__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--stv-space-6); align-items: start; }

/* ===== Gallery ===== */
.stv-gallery { display: grid; gap: var(--stv-space-3); touch-action: pan-y; }

.stv-gallery__main {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--stv-radius-lg);
	border: 1px solid var(--stv-color-border);
	background: var(--stv-color-surface-2);
}

.stv-gallery__img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--stv-transition); }

.stv-gallery__main.is-loading .stv-gallery__img,
.stv-gallery__main.is-switching .stv-gallery__img {
	opacity: .4;
}

.stv-gallery__main.is-dragging { cursor: grabbing; }
.stv-gallery__main.is-dragging .stv-gallery__img { transition: none; }
.stv-gallery__badge { position: absolute; inset-block-start: var(--stv-space-3); inset-inline-start: var(--stv-space-3); z-index: 2; }

.stv-gallery__arrow {
	position: absolute;
	inset-block-start: 50%;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	transform: translateY(-50%);
	border: 1px solid var(--stv-color-border-strong);
	border-radius: 50%;
	background: var(--stv-color-surface);
	color: var(--stv-color-text);
	box-shadow: var(--stv-shadow-card);
	transition: background-color var(--stv-transition), color var(--stv-transition);
}

.stv-gallery__arrow--prev { inset-inline-start: var(--stv-space-3); }
.stv-gallery__arrow--next { inset-inline-end: var(--stv-space-3); }
.stv-gallery__arrow .stv-icon { font-size: 20px; }

@media (hover: hover) {
	.stv-gallery__arrow:hover { background: var(--stv-color-primary); color: var(--stv-color-on-primary); }
}

.stv-gallery__arrow:focus-visible { outline: none; box-shadow: var(--stv-focus-ring); }

/* Thumbnails (desktop) */
.stv-gallery__thumbs { display: none; list-style: none; flex-direction: column; gap: var(--stv-space-2); }

.stv-gallery__thumb {
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-surface-2);
	transition: border-color var(--stv-transition), opacity var(--stv-transition);
	opacity: .75;
}

.stv-gallery__thumb-img { width: 100%; height: 100%; object-fit: cover; }

.stv-gallery__thumb.is-active,
.stv-gallery__thumb[aria-selected="true"] {
	border-color: var(--stv-color-primary);
	opacity: 1;
}

@media (hover: hover) {
	.stv-gallery__thumb:hover { opacity: 1; }
}

.stv-gallery__thumb:focus-visible { outline: none; box-shadow: var(--stv-focus-ring); }

/* Dots (mobile): 24 × 24 hit area around a 10px dot drawn by ::before, like the fader dots (WCAG 2.5.8) */
.stv-gallery__dots { display: flex; justify-content: center; gap: var(--stv-space-1); }

.stv-gallery__dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.stv-gallery__dot::before {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--stv-color-text-muted);
	transition: background-color var(--stv-transition), transform var(--stv-transition);
}

.stv-gallery__dot.is-active::before,
.stv-gallery__dot[aria-selected="true"]::before {
	background: var(--stv-color-primary);
	transform: scale(1.2);
}

.stv-gallery__dot:focus-visible { outline: none; }
.stv-gallery__dot:focus-visible::before { box-shadow: 0 0 0 2px var(--stv-color-background), 0 0 0 4px var(--stv-color-primary); }

@media (forced-colors: active) {
	.stv-gallery__dot::before { forced-color-adjust: none; background: CanvasText; }

	.stv-gallery__dot.is-active::before,
	.stv-gallery__dot[aria-selected="true"]::before { background: Highlight; }

	.stv-gallery__dot:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* ===== Info column ===== */
.stv-product__info { display: flex; flex-direction: column; gap: var(--stv-space-4); min-width: 0; }
.stv-product__title { font-size: var(--stv-font-size-2xl); font-weight: var(--stv-weight-heading); line-height: var(--stv-lh-heading); }

.stv-product__rating {
	display: inline-flex;
	align-items: center;
	gap: var(--stv-space-2);
	align-self: flex-start;
	color: var(--stv-color-text-muted);
	font-size: var(--stv-font-size-sm);
	text-decoration: none;
}

@media (hover: hover) {
	.stv-product__rating:hover .stv-product__rating-count { color: var(--stv-color-primary); }
}

.stv-product__excerpt { color: var(--stv-color-text-muted); }

/*
 * Short description on phones (SPEC §19.6, عابرين › عام › المتجر). product.js
 * adds `.is-clamped` below 900px when the text is longer than N lines; the
 * mask fades the last line into whatever is behind it (dark or light mode).
 */
.stv-product__excerpt-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: var(--stv-space-2); }
.stv-product__excerpt-wrap--lines-2 { --stv-excerpt-lines: 2; }
.stv-product__excerpt-wrap--lines-3 { --stv-excerpt-lines: 3; }
.stv-product__excerpt-wrap--lines-4 { --stv-excerpt-lines: 4; }
.stv-product__excerpt-wrap--lines-5 { --stv-excerpt-lines: 5; }
.stv-product__excerpt-wrap--lines-6 { --stv-excerpt-lines: 6; }
.stv-product__excerpt-wrap--lines-7 { --stv-excerpt-lines: 7; }
.stv-product__excerpt-wrap--lines-8 { --stv-excerpt-lines: 8; }
.stv-product__excerpt-wrap .stv-product__excerpt { align-self: stretch; }
.stv-product__excerpt-more { display: inline-flex; align-items: center; gap: var(--stv-space-1); min-height: 44px; padding-inline: var(--stv-space-1); border-radius: var(--stv-radius-sm); color: var(--stv-color-primary); font-size: var(--stv-font-size-sm); font-weight: var(--stv-weight-ui); cursor: pointer; }
.stv-product__excerpt-more[hidden] { display: none; }
.stv-product__excerpt-more:focus-visible { outline: none; box-shadow: var(--stv-focus-ring); }
.stv-product__excerpt-more-icon { font-size: 18px; transition: transform var(--stv-transition); }
.stv-product__excerpt-wrap.is-expanded .stv-product__excerpt-more-icon { transform: rotate(180deg); }

@media (max-width: 899px) {
	.stv-product__excerpt-wrap--hide { display: none; }

	.stv-product__excerpt-wrap.is-clamped:not(.is-expanded) .stv-product__excerpt {
		max-height: calc(var(--stv-excerpt-lines, 3) * 1.8em);
		overflow: hidden;
		-webkit-mask-image: linear-gradient(to bottom, #000000 calc(100% - 2.2em), transparent);
		mask-image: linear-gradient(to bottom, #000000 calc(100% - 2.2em), transparent);
	}

	.stv-product__excerpt-wrap.is-clamped:not(.is-expanded) .stv-product__excerpt > * + * { margin-block-start: var(--stv-space-2); } /* the N lines show text, not paragraph gaps */
}

@supports (max-height: 1lh) {
	@media (max-width: 899px) {
		.stv-product__excerpt-wrap.is-clamped:not(.is-expanded) .stv-product__excerpt { max-height: calc(var(--stv-excerpt-lines, 3) * 1lh); }
	}
}
.stv-product__price { font-size: var(--stv-font-size-2xl); font-weight: var(--stv-weight-heading); line-height: 1.3; }

.stv-product__price .stv-price--current,
.stv-product__price .stv-price ins {
	color: var(--stv-color-price);
}

.stv-product__price .stv-price del,
.stv-product__price .stv-price--old {
	font-size: var(--stv-font-size-lg);
	font-weight: var(--stv-weight-body);
	color: var(--stv-color-text-muted);
}

.stv-product__price .stv-price__from { font-size: var(--stv-font-size-base); font-weight: var(--stv-weight-body); color: var(--stv-color-text-muted); }
.stv-price--free { color: var(--stv-color-success); font-weight: var(--stv-weight-ui); }

/* Variations: chip groups */
.stv-product__variations {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-4);
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface);
	transition: border-color var(--stv-transition);
}

.stv-product__variations.is-error { border-color: var(--stv-color-error); }
.stv-product__variations.is-resolved { border-color: var(--stv-color-border-strong); }

.stv-product__variations .stv-chip--select.is-disabled,
.stv-product__variations .stv-chip--select[aria-disabled="true"] {
	opacity: .45;
	text-decoration: line-through;
	cursor: not-allowed;
}

.stv-product__variations .stv-chips { border: 0; }

.stv-product__variations .stv-chips__label {
	display: block;
	margin-block-end: var(--stv-space-2);
	font-size: var(--stv-font-size-sm);
	font-weight: var(--stv-weight-ui);
}

.stv-product__variations .stv-chips__list { display: flex; flex-wrap: wrap; gap: var(--stv-space-2); }
.stv-product__variation-hint { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }
.stv-product__variations.is-error .stv-product__variation-hint { color: var(--stv-color-error); }

/* Customer fields card (product-fields module) */
.stv-product-fields {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-3);
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface-2);
}

.stv-product-fields__title { font-size: var(--stv-font-size-base); font-weight: var(--stv-weight-ui); }
.stv-product-fields__field { margin: 0; }
.stv-product-fields.is-error { border-color: var(--stv-color-error); }

.stv-product-fields .stv-input.is-error,
.stv-product-fields .stv-field.is-error .stv-input {
	border-color: var(--stv-color-error);
}

/* Subscription box: segmented "اشتراك جديد / تجديد اشتراك" + renewal username */
.stv-subscription { gap: var(--stv-space-4); }
.stv-subscription__choice { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.stv-subscription__choice legend { margin-block-end: var(--stv-space-2); padding: 0; }

.stv-segmented {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--stv-space-1);
	padding: var(--stv-space-1);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-surface);
}

.stv-segmented__option { position: relative; display: block; margin: 0; cursor: pointer; }

.stv-segmented__input {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.stv-segmented__label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--stv-space-2);
	min-block-size: 44px;
	padding: var(--stv-space-2) var(--stv-space-3);
	border-radius: calc(var(--stv-radius-md) - 4px);
	font-size: var(--stv-font-size-sm);
	font-weight: var(--stv-weight-ui);
	color: var(--stv-color-text-muted);
	transition: background-color var(--stv-transition), color var(--stv-transition), box-shadow var(--stv-transition);
}

.stv-segmented__icon { inline-size: 18px; block-size: 18px; flex: 0 0 auto; }
.stv-segmented__option:hover .stv-segmented__label { color: var(--stv-color-text); }

.stv-segmented__input:checked + .stv-segmented__label {
	background: var(--stv-color-primary-soft);
	color: var(--stv-color-primary);
	box-shadow: inset 0 0 0 1px var(--stv-color-primary);
}

.stv-segmented__input:focus-visible + .stv-segmented__label {
	outline: 2px solid var(--stv-color-primary);
	outline-offset: 2px;
}

.stv-segmented__input.is-error + .stv-segmented__label,
.stv-subscription__choice.is-error .stv-segmented { box-shadow: inset 0 0 0 1px var(--stv-color-error); }

.stv-subscription__user.is-collapsed { display: none; }

/* Without JS the renewal option still reveals the username field. */
.stv-subscription:has([data-stv-sub-type="renew"]:checked) .stv-subscription__user.is-collapsed { display: block; }

@media (prefers-reduced-motion: reduce) {
	.stv-segmented__label { transition: none; }
}

/* Offer / gift box (product-offers module) */
.stv-offer-box {
	display: flex;
	align-items: center;
	gap: var(--stv-space-3);
	padding: var(--stv-space-4);
	border: 1px solid var(--stv-color-success);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-success-soft);
}

.stv-offer-box__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-surface);
	color: var(--stv-color-success);
}

.stv-offer-box__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.stv-offer-box__body { display: flex; flex-direction: column; gap: var(--stv-space-1); min-width: 0; }

.stv-offer-box__badge {
	align-self: flex-start;
	padding: 2px 10px;
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-success);
	color: var(--stv-color-black);
	font-size: var(--stv-font-size-xs);
	font-weight: var(--stv-weight-ui);
}

.stv-offer-box__text { font-size: var(--stv-font-size-sm); }

.stv-offer-box__gift,
.stv-offer-box__name,
.stv-offer-box__gift-name {
	font-weight: var(--stv-weight-ui);
}

/* Buy row */
.stv-product__buy { display: flex; flex-wrap: wrap; gap: var(--stv-space-3); align-items: center; }
.stv-product__buy .stv-qty { flex: 1 0 100%; }
.stv-product__buy .stv-qty .stv-qty__input { flex: 1 1 auto; } /* phones: the full-width stepper is filled by its value, not left empty */
.stv-product__buy .stv-qty .stv-qty__btn { width: 48px; }
.stv-product__buy .stv-qty--single { display: none; }

.stv-product__add,
.stv-product__buy-now {
	flex: 1 1 calc(50% - var(--stv-space-3));
	min-width: 160px;
}

.stv-product__stock { font-size: var(--stv-font-size-sm); font-weight: var(--stv-weight-ui); }
.stv-product__stock.is-in-stock { color: var(--stv-color-success); }
.stv-product__stock.is-out-of-stock { color: var(--stv-color-error); }
.stv-product__sku { font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }
.stv-product__sku-value { font-family: var(--stv-font-family-mono); direction: ltr; unicode-bidi: isolate; }

/* Delivery line + trust badges */
.stv-product__delivery {
	display: inline-flex;
	align-items: center;
	gap: var(--stv-space-2);
	align-self: flex-start;
	padding: var(--stv-space-2) var(--stv-space-3);
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-success-soft);
	color: var(--stv-color-success);
	font-size: var(--stv-font-size-sm);
	font-weight: var(--stv-weight-ui);
}

.stv-product__delivery--manual { background: var(--stv-color-warning-soft); color: var(--stv-color-warning); }
.stv-product__delivery-icon { font-size: 20px; }

.stv-trust {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--stv-space-2) var(--stv-space-3);
	list-style: none;
	padding-block-start: var(--stv-space-4);
	border-block-start: 1px solid var(--stv-color-border);
}

.stv-trust__item {
	display: flex;
	align-items: center;
	gap: var(--stv-space-2);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
}

.stv-trust__icon { font-size: 18px; color: var(--stv-color-primary); }

/* ===== Boxes (description, reviews, share) ===== */
.stv-product__box,
.stv-product__share {
	margin-block-start: var(--stv-space-6);
	padding: var(--stv-space-5);
}

.stv-product__box-title {
	display: flex;
	align-items: center;
	gap: var(--stv-space-2);
	margin-block-end: var(--stv-space-4);
	font-size: var(--stv-font-size-xl);
	font-weight: var(--stv-weight-heading);
}

.stv-product__box-title .stv-icon { color: var(--stv-color-primary); }
.stv-product__content { max-width: none; }

/* Description box: "الوصف" / "خطوات التفعيل" tabs (shared .stv-tabs underline style) */
.stv-product__desc-tablist { display: flex; gap: var(--stv-space-1); overflow-x: auto; scrollbar-width: none; margin-block-end: var(--stv-space-2); border-bottom: 1px solid var(--stv-color-border); }
.stv-product__desc-tablist::-webkit-scrollbar { display: none; }
.stv-product__desc-tablist .stv-tabs__tab { gap: var(--stv-space-2); min-height: 48px; padding-inline: var(--stv-space-4); font-size: var(--stv-font-size-lg); font-weight: var(--stv-weight-heading); }
.stv-product__desc-tab-icon { font-size: 20px; color: var(--stv-color-primary); }

/* Small phones: both tabs fit without the hidden-scrollbar overflow (311px of tabs in 238–308px): tighter tabs up to 419px, no decorative icons below 360px */
@media (max-width: 419px) {
	.stv-product__desc-tablist .stv-tabs__tab { padding-inline: var(--stv-space-2); font-size: var(--stv-font-size-base); }
}

@media (max-width: 359px) {
	.stv-product__desc-tablist .stv-product__desc-tab-icon { display: none; }
}
.stv-product__desc-panel { padding-block-start: var(--stv-space-4); }
.stv-product__desc-panel[hidden] { display: none; }
.stv-activation__list { margin: 0; }

/* Activation steps accordion (any context outside the description tabs) */
.stv-activation { margin-block-start: var(--stv-space-4); padding-block-start: var(--stv-space-4); border-block-start: 1px solid var(--stv-color-border); }
.stv-activation .stv-accordion__trigger { font-size: var(--stv-font-size-base); }
.stv-activation .stv-steps-list { margin-block-start: var(--stv-space-3); }

/* A step: its text (bare links become links), then its button link (inc/woocommerce/activation-steps.php) */
.stv-steps-list__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--stv-space-2); min-width: 0; }
.stv-steps-list__inline-link { color: var(--stv-color-primary); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.stv-steps-list__link { gap: var(--stv-space-2); max-inline-size: 100%; }
.stv-steps-list__link-label { min-width: 0; overflow-wrap: anywhere; }
.stv-steps-list__link-icon { flex: 0 0 auto; }

@media (hover: hover) {
	.stv-steps-list__inline-link:hover { color: var(--stv-color-primary-hover); }
}

/* ===== Reviews box ===== */
.stv-reviews__summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--stv-space-5);
	padding: var(--stv-space-4);
	border-radius: var(--stv-radius-md);
	background: var(--stv-color-surface-2);
}

.stv-reviews__average {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--stv-space-1);
	text-align: center;
}

.stv-reviews__average-value {
	font-size: var(--stv-font-size-4xl);
	font-weight: var(--stv-weight-heading);
	line-height: 1;
	color: var(--stv-color-text);
}

.stv-reviews__average-count { font-size: var(--stv-font-size-sm); color: var(--stv-color-text-muted); }
.stv-reviews__bars { display: flex; flex-direction: column; gap: var(--stv-space-2); list-style: none; }

.stv-reviews__bar-row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) 36px;
	align-items: center;
	gap: var(--stv-space-3);
	font-size: var(--stv-font-size-xs);
	color: var(--stv-color-text-muted);
}

.stv-reviews__bar-label {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	min-width: 28px;
	font-weight: var(--stv-weight-ui);
	color: var(--stv-color-text);
}

.stv-reviews__bar-label .stv-icon { font-size: 14px; color: var(--stv-color-rating); }

.stv-reviews__bar {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	height: 8px;
	border: 0;
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-surface-3);
	overflow: hidden;
}

.stv-reviews__bar::-webkit-progress-bar { background: var(--stv-color-surface-3); border-radius: var(--stv-radius-pill); }
.stv-reviews__bar::-webkit-progress-value { background: var(--stv-color-rating); border-radius: var(--stv-radius-pill); }
.stv-reviews__bar::-moz-progress-bar { background: var(--stv-color-rating); border-radius: var(--stv-radius-pill); }
.stv-reviews__bar-count { text-align: end; }

/* Review list */
.stv-reviews__list { display: flex; flex-direction: column; list-style: none; margin-block-start: var(--stv-space-5); }

.stv-review {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--stv-space-3);
	padding-block: var(--stv-space-4);
	border-block-start: 1px solid var(--stv-color-border);
}

.stv-review:first-child { border-block-start: 0; padding-block-start: 0; }
.stv-review__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--stv-space-3); }

.stv-review__head .stv-avatar {
	width: 48px;
	height: 48px;
	flex: 0 0 auto;
	border-radius: 50%;
	object-fit: cover;
}

.stv-review__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stv-space-1) var(--stv-space-2);
	flex: 1 1 auto;
	min-width: 0;
}

.stv-review__author { font-weight: var(--stv-weight-ui); }

.stv-badge--verified {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border-radius: var(--stv-radius-pill);
	background: var(--stv-color-success-soft);
	color: var(--stv-color-success);
	font-size: var(--stv-font-size-xs);
	font-weight: var(--stv-weight-ui);
}

.stv-review__date { flex-basis: 100%; font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }
.stv-review__head .stv-rating { margin-inline-start: auto; }
.stv-review__text { font-size: var(--stv-font-size-sm); color: var(--stv-color-text); }
.stv-review__text > * + * { margin-block-start: var(--stv-space-2); }
.stv-reviews__empty { margin-block-start: var(--stv-space-4); color: var(--stv-color-text-muted); }
.stv-reviews__more-wrap { display: flex; justify-content: center; margin-block-start: var(--stv-space-5); }
.stv-reviews__more-wrap [hidden] { display: none; }

/* Review form */
.stv-review-form {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-4);
	margin-block-start: var(--stv-space-6);
	padding: var(--stv-space-5);
	border: 1px solid var(--stv-color-border);
	border-radius: var(--stv-radius-lg);
	background: var(--stv-color-surface-2);
}

.stv-review-form__title { font-size: var(--stv-font-size-lg); font-weight: var(--stv-weight-heading); }

.stv-review-form__login,
.stv-review-form__as {
	font-size: var(--stv-font-size-sm);
	color: var(--stv-color-text-muted);
}

.stv-review-form__actions { display: flex; flex-wrap: wrap; gap: var(--stv-space-3); }

/* Star picker: DOM order 1→5; all stars fill when a value is chosen and the
   stars after the checked one are emptied again (needs :has(); the JS adds
   .is-hover / .is-filled classes as the universal fallback). */
.stv-star-picker {
	display: flex;
	flex-direction: column;
	gap: var(--stv-space-2);
}

.stv-star-picker__stars { display: inline-flex; gap: 2px; }

.stv-star-picker__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--stv-radius-sm);
	color: var(--stv-color-text-faint);
	cursor: pointer;
	transition: color var(--stv-transition), transform var(--stv-transition);
}

.stv-star-picker__icon { font-size: 32px; }

.stv-star-picker__stars:has(.stv-star-picker__input:checked) .stv-star-picker__label,
.stv-star-picker__label.is-filled,
.stv-star-picker__label.is-hover {
	color: var(--stv-color-rating);
}

.stv-star-picker__stars:has(.stv-star-picker__input:checked) .stv-star-picker__label .stv-star-picker__icon,
.stv-star-picker__label.is-filled .stv-star-picker__icon,
.stv-star-picker__label.is-hover .stv-star-picker__icon {
	fill: currentColor;
}

.stv-star-picker__input:checked ~ .stv-star-picker__label:not(.is-hover):not(.is-filled) { color: var(--stv-color-text-faint); }
.stv-star-picker__input:checked ~ .stv-star-picker__label:not(.is-hover):not(.is-filled) .stv-star-picker__icon { fill: none; }

/* The checked star itself stays filled (the ~ rule above also matched it) */
.stv-star-picker__input:checked + .stv-star-picker__label:not(.is-hover):not(.is-filled) { color: var(--stv-color-rating); }
.stv-star-picker__input:checked + .stv-star-picker__label:not(.is-hover):not(.is-filled) .stv-star-picker__icon { fill: currentColor; }
.stv-star-picker__stars.is-hovering .stv-star-picker__label:not(.is-hover) { color: var(--stv-color-text-faint); }
.stv-star-picker__stars.is-hovering .stv-star-picker__label:not(.is-hover) .stv-star-picker__icon { fill: none; }

.stv-star-picker.is-hovering .stv-star-picker__label:not(.is-hover),
.stv-star-picker.is-hovering .stv-star-picker__label:not(.is-hover) .stv-star-picker__icon {
	color: var(--stv-color-text-faint);
	fill: none;
}

.stv-star-picker__label.is-active,
.stv-star-picker__label.is-active .stv-star-picker__icon,
.stv-star-picker.is-hovering .stv-star-picker__label.is-hover,
.stv-star-picker.is-hovering .stv-star-picker__label.is-hover .stv-star-picker__icon {
	color: var(--stv-color-rating);
	fill: currentColor;
}

.stv-star-picker.is-error .stv-star-picker__hint { color: var(--stv-color-error); }
.stv-star-picker.is-selected .stv-star-picker__hint { color: var(--stv-color-text); }
.stv-review-form.is-loading { opacity: .7; pointer-events: none; }
.stv-review-form.is-sent .stv-review-form__actions { display: none; }
.stv-star-picker__input:focus-visible + .stv-star-picker__label { box-shadow: var(--stv-focus-ring); }

@media (hover: hover) {
	.stv-star-picker__label:hover { transform: scale(1.1); }
}

.stv-star-picker__hint { min-height: 1.5em; font-size: var(--stv-font-size-xs); color: var(--stv-color-text-muted); }

/* ===== Share row ===== */
.stv-share--product .stv-share__list { display: flex; flex-wrap: wrap; gap: var(--stv-space-3); list-style: none; }
.stv-share__url { margin-block-start: var(--stv-space-3); }
.stv-share__url-input { direction: ltr; text-align: start; font-family: var(--stv-font-family-mono); font-size: var(--stv-font-size-sm); }

/* ===== Related products ===== */
.stv-product__related { margin-block-start: var(--stv-space-7); padding-block: 0; }
.stv-product__related .stv-section-head { margin-block-end: var(--stv-space-5); }

/* ===== Mobile sticky buy bar ===== */
.stv-sticky-bar {
	position: fixed;
	inset-inline: var(--stv-space-3);
	inset-block-end: calc(var(--stv-tabbar-height) + env(safe-area-inset-bottom, 0px) + var(--stv-space-2));
	z-index: var(--stv-z-sticky);
	padding: var(--stv-space-2) var(--stv-space-3);
	border: 1px solid var(--stv-color-border-strong);
	border-radius: var(--stv-radius-xl);
	background: color-mix(in srgb, var(--stv-color-surface) 92%, transparent);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	box-shadow: var(--stv-shadow-card);
	transform: translateY(calc(100% + var(--stv-tabbar-height) + var(--stv-space-4)));
	opacity: 0;
	visibility: hidden;
	transition: transform 240ms ease-out, opacity var(--stv-transition), visibility 0s linear 240ms;
}

.stv-sticky-bar[hidden] { display: block; }

/*
 * No space is reserved in the page for the bar: content always scrolls on
 * into the footer, and the bar slides away while the footer is in view
 * (product.js), so the footer's last lines are never covered.
 */

/* The back-to-top button moves above the visible bar instead of covering its button (SPEC §19.6) */
body.stv-tpl-product .stv-back-top { transition: opacity var(--stv-transition), transform var(--stv-transition), bottom 240ms ease-out; }
body.stv-has-sticky-bar .stv-back-top { bottom: calc(var(--stv-tabbar-height) + env(safe-area-inset-bottom, 0px) + var(--stv-space-2) + 72px + var(--stv-space-3)); }

.stv-sticky-bar.is-visible {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	transition: transform 240ms ease-out, opacity var(--stv-transition), visibility 0s;
}

.stv-sticky-bar__inner { display: flex; align-items: center; gap: var(--stv-space-3); padding-inline: 0; }
.stv-sticky-bar__thumb { width: 48px; height: 48px; flex: 0 0 auto; border-radius: var(--stv-radius-md); }

.stv-sticky-bar__text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	gap: 2px;
}

.stv-sticky-bar__name {
	overflow: hidden;
	font-size: var(--stv-font-size-sm);
	font-weight: var(--stv-weight-ui);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.stv-sticky-bar__price { font-size: var(--stv-font-size-sm); font-weight: var(--stv-weight-ui); color: var(--stv-color-price); }
.stv-sticky-bar__btn { flex: 0 0 auto; }

/* ===== Breakpoints ===== */
@media (min-width: 600px) {
	.stv-product__title { font-size: var(--stv-font-size-3xl); }
	.stv-product__buy .stv-qty { flex: 0 0 auto; }
	.stv-product__buy .stv-qty .stv-qty__input { flex: 0 0 56px; }
	.stv-product__buy .stv-qty .stv-qty__btn { width: 40px; }
	.stv-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.stv-reviews__summary { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: var(--stv-space-5); }
	.stv-reviews__average { min-width: 140px; padding-inline-end: var(--stv-space-5); border-inline-end: 1px solid var(--stv-color-border); }
	.stv-review { grid-template-columns: minmax(0, 1fr); }
	.stv-review__date { flex-basis: auto; }

	.stv-product__box,
	.stv-product__share {
		padding: var(--stv-space-6);
	}
}

@media (min-width: 900px) {
	.stv-product__top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--stv-space-7); }
	.stv-gallery { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }

	.stv-gallery__thumbs {
		display: flex;
		order: -1;
		max-height: 100%;
		overflow-y: auto;
		scrollbar-width: none;
	}

	.stv-gallery__thumbs::-webkit-scrollbar { display: none; }
	.stv-gallery__dots { display: none; }
	.stv-gallery[data-count="1"] { grid-template-columns: minmax(0, 1fr); }

	/* Thumbnails replace the arrows on desktop */
	.stv-gallery__arrow { display: none; }
	.stv-product__info { gap: var(--stv-space-5); }

	.stv-sticky-bar {
		inset-inline: auto var(--stv-space-4);
		inset-block-end: var(--stv-space-4);
		max-width: 420px;
		width: calc(100% - 2 * var(--stv-space-4));
		transform: translateY(calc(100% + var(--stv-space-5)));
	}

	.stv-sticky-bar.is-visible { transform: translateY(0); }
	body.stv-has-sticky-bar .stv-back-top { bottom: calc(var(--stv-space-4) + 72px + var(--stv-space-3)); }
}

@media (min-width: 1200px) {
	.stv-product__top { grid-template-columns: 1.1fr .9fr; }
	.stv-product__title { font-size: var(--stv-font-size-4xl); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
	.stv-gallery__img,
	.stv-gallery__arrow,
	.stv-gallery__thumb,
	.stv-gallery__dot::before,
	.stv-star-picker__label,
	.stv-sticky-bar {
		transition: none;
	}

	.stv-gallery__dot.is-active::before,
	.stv-gallery__dot[aria-selected="true"]::before,
	.stv-star-picker__label:hover {
		transform: none;
	}

	.stv-sticky-bar { transform: none; }
	.stv-sticky-bar:not(.is-visible) { display: none; }
	body.stv-tpl-product .stv-back-top,
	.stv-product__excerpt-more-icon { transition: none; }
}
