/* NP Variation Buttons v1.0.5 */

/* Native select stays in the DOM (WooCommerce drives it) but is visually hidden. */
.npvb-hidden-select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	/* WooCommerce core gives ".variations select" min-width:75%. On an absolutely
	   positioned element that % resolves against the whole viewport, so without these
	   resets the invisible select is ~75vw wide and makes the page scroll sideways. */
	min-width: 0 !important;
	max-width: 1px !important;
	min-height: 0 !important;
	max-height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

.npvb-group {
	display: flex;
	flex-wrap: wrap;
	gap: var(--npvb-gap, 10px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.npvb-btn {
	position: relative;
	box-sizing: border-box;
	min-height: 44px;
	padding: var(--npvb-pad-y, 14px) var(--npvb-pad-x, 22px);
	font-size: var(--npvb-font, 16px);
	line-height: 1.2;
	color: var(--npvb-text, #000);
	background: var(--npvb-bg, #fff);
	border: 2px solid var(--npvb-border, #e5e5e5);
	border-radius: var(--npvb-radius, 4px);
	cursor: pointer;
	box-shadow: none;
	text-transform: none;
	transition: border-color .15s ease, transform .15s ease;
}

.npvb-btn:hover:not(.is-unavailable):not(.is-selected) {
	border-color: var(--npvb-active, #000);
}

.npvb-btn.is-selected {
	border-color: var(--npvb-active, #000);
	box-shadow: 0 0 0 1px var(--npvb-active, #000) inset;
	transform: scale(var(--npvb-scale, 1.08));
}

@media (prefers-reduced-motion: reduce) {
	.npvb-btn { transition: none; }
	.npvb-btn.is-selected { transform: none; }
}

.npvb-btn:focus-visible {
	outline: 2px solid var(--npvb-active, #000);
	outline-offset: 2px;
}

/* Unavailable: faded text + diagonal strikethrough, not clickable. */
.npvb-btn.is-unavailable {
	color: var(--npvb-disabled, #d0d0d0);
	cursor: not-allowed;
	overflow: hidden;
}

.npvb-btn.is-unavailable::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top right, transparent calc(50% - 1px), var(--npvb-disabled, #d0d0d0) calc(50% - 1px), var(--npvb-disabled, #d0d0d0) calc(50% + 1px), transparent calc(50% + 1px));
	pointer-events: none;
}
