/* WC Extras — Color Swatches (structural layout only; colors, size,
   shape, spacing, and borders are generated by Elementor from the
   widget's Style tab controls). */

.wc-extras-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}

.wc-extras-swatches__item {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wc-extras-swatch {
	display: block;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background-color: #ccc;
	border: 2px solid transparent;
	box-sizing: border-box;
	position: relative;
	line-height: 0;
	appearance: none;
	-webkit-appearance: none;
}

.wc-extras-swatch--nocolor {
	background-image: linear-gradient( 135deg, transparent 46%, #d33 48%, #d33 52%, transparent 54% );
	background-color: #f2f2f2;
}

.wc-extras-swatch--image {
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.wc-extras-swatch:focus-visible {
	outline: 2px solid #1e88e5;
	outline-offset: 2px;
}

.wc-extras-swatches__label {
	margin-top: 6px;
	text-align: center;
}

/* CSS-only tooltip, shown on hover/focus when enabled. */
.wc-extras-swatch[data-tooltip] {
	overflow: visible;
}

.wc-extras-swatch[data-tooltip]::after {
	content: attr( data-tooltip );
	position: absolute;
	bottom: calc( 100% + 8px );
	left: 50%;
	transform: translateX( -50% ) scale( 0.9 );
	white-space: nowrap;
	padding: 4px 9px;
	border-radius: 4px;
	font-size: 12px;
	line-height: 1.4;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 10;
}

.wc-extras-swatch[data-tooltip]:hover::after,
.wc-extras-swatch[data-tooltip]:focus-visible::after {
	opacity: 1;
	transform: translateX( -50% ) scale( 1 );
}
