/* Carpet Ends Variation Buttons */

/* Buttons stay hidden until the script is running, so the plain dropdown is the fallback. */
.cevb-buttons {
	display: none;
}

.cevb-wrap.cevb-ready .cevb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 10px;
}

/* Hide the real dropdown but keep it in the form so WooCommerce still reads it. */
.cevb-wrap.cevb-ready select {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	opacity: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	pointer-events: none !important;
	border: 0 !important;
}

/* Stack each label above its buttons. */
form.cevb-form table.variations,
form.cevb-form table.variations tbody,
form.cevb-form table.variations tr,
form.cevb-form table.variations th,
form.cevb-form table.variations td {
	display: block;
	width: 100%;
	border: 0;
	background: transparent;
	text-align: left;
}

form.cevb-form table.variations th.label {
	padding: 6px 0 4px;
	font-weight: 600;
	line-height: 1.3;
}

form.cevb-form table.variations td.value {
	padding: 0;
}

form.cevb-form .reset_variations {
	display: inline-block;
	margin-top: 2px;
	font-size: 13px;
}

/* The buttons. Specific selectors so the theme's generic button styles don't leak in. */
.variations_form .cevb-buttons .cevb-btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 40px;
	margin: 0;
	padding: 8px 14px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	color: #1f1f1f;
	background: #ffffff;
	border: 1px solid #c8c8c8;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.variations_form .cevb-buttons .cevb-btn:hover {
	color: #1f1f1f;
	background: #ffffff;
	border-color: #1f1f1f;
}

.variations_form .cevb-buttons .cevb-btn:focus {
	outline: none;
}

.variations_form .cevb-buttons .cevb-btn:focus-visible {
	outline: 2px solid #1f1f1f;
	outline-offset: 2px;
}

.variations_form .cevb-buttons .cevb-btn.is-selected,
.variations_form .cevb-buttons .cevb-btn.is-selected:hover {
	color: #ffffff;
	background: #1f1f1f;
	border-color: #1f1f1f;
}

/* Not available with the current choices: still clickable (it resets the others). */
.variations_form .cevb-buttons .cevb-btn.is-unavailable {
	color: #8a8a8a;
	background: #f4f4f4;
	border-style: dashed;
}
