/* =========================================================================
 * Product variants («Демо / Повна …») — chips on the product page (opposite the
 * price) and in the checkout order card. Same look as the checkout tip chips
 * (.rm-chip): grey hairline, the active one wears the brand gradient. Compact.
 * Markup: rm_variant_chips() in inc/variants.php · behaviour: js/variants.js
 * ====================================================================== */

.rm-ver__opts { display: flex; flex-wrap: wrap; gap: 6px; }

.rm-ver__opt {
	position: relative;
	height: 28px; padding: 0 10px;
	display: inline-flex; align-items: center;
	border: none; border-radius: var(--radius-sm, 8px); cursor: pointer;
	background: var(--color-bg-elevated);
	box-shadow: inset 0 0 0 1px var(--color-border-strong);
	color: var(--color-text-muted);
	font: inherit; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
	transition: background .3s, color .3s, box-shadow .3s;
}
.rm-ver__opt:hover { background: var(--color-bg-elevated-hover); color: var(--color-text); }
.rm-ver__opt.on {
	background: var(--gradient-brand-btn); color: #fff;
	box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.rm-ver__opt:focus { outline: none; }
.rm-ver__opt:focus-visible { box-shadow: inset 0 0 0 1px var(--color-magenta); }
.rm-ver__opt.on:focus-visible { box-shadow: var(--shadow-brand), inset 0 0 0 1px rgba(255, 255, 255, .5); }

/* Tooltip (the variant's description) — on hover, or on tap on touch screens. */
.rm-ver__opt[data-tip]::after {
	content: attr(data-tip);
	position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5;
	width: max-content; max-width: 260px; white-space: normal;
	padding: 8px 10px; border-radius: 8px;
	background: #161618;
	box-shadow: inset 0 0 0 1px var(--color-border-strong), 0 10px 24px rgba(0, 0, 0, .45);
	color: var(--color-text); font-size: 12px; font-weight: 500; line-height: 1.35; text-align: left;
	opacity: 0; transform: translateY(4px); pointer-events: none;
	transition: opacity .2s, transform .2s;
}
@media (hover: hover) {
	.rm-ver__opt[data-tip]:hover::after { opacity: 1; transform: none; }
}
.rm-ver__opt[data-tip].tip-on::after,
.rm-ver__opt[data-tip]:focus-visible::after { opacity: 1; transform: none; }

/* ---- Product page: chips on the left, the big price on the right, bottoms
   aligned (js/variants.js lifts the chips to the digits' baseline). ---- */
.rm-ver-prow {
	margin-top: auto; /* same "pin to the panel bottom" role as .product__price-row */
	padding-top: var(--space-5);
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px;
}
.rm-ver-prow .product__price-row { margin: 0 0 0 auto; padding-top: 0; }
.rm-ver-prow .rm-ver { margin-bottom: var(--rm-ver-lift, 0px); }

/* ---- Checkout order card: smaller chips, price opposite ---- */
.rm-ver-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.rm-ver-row .rm-item__price { margin: 0; }
.rm-ver--checkout .rm-ver__opts { gap: 5px; }
.rm-ver--checkout .rm-ver__opt { height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11px; }
.rm-ver.is-busy { opacity: .55; pointer-events: none; }

/* Tablet / phone: no ambient motion (site-wide rule) — tooltips just appear. */
@media (max-width: 1024px) {
	.rm-ver__opt, .rm-ver__opt[data-tip]::after { transition: none; }
	.rm-ver__opt[data-tip]::after { max-width: min(260px, 70vw); }
}
