/**
 * PP Color Swatches Pro — Frontend styles for color swatch circles.
 */

.ppsp-color-swatches {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 12px 0;
	flex-wrap: wrap;
}

.ppsp-color-swatches--has-labels {
	gap: 14px;
}

.ppsp-color-swatch {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	cursor: pointer;
}

.ppsp-color-swatch--active {
	cursor: default;
}

.ppsp-swatch-circle {
	display: block;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #d0d0d0;
	position: relative;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.ppsp-color-swatch:hover .ppsp-swatch-circle {
	transform: scale(1.15);
	border-color: var(--theme-palette-color-1, #333);
}

.ppsp-color-swatch--active:hover .ppsp-swatch-circle {
	transform: none;
}

.ppsp-color-swatch--active .ppsp-swatch-circle {
	border-color: var(--theme-palette-color-1, #333);
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--theme-palette-color-1, #333);
}

.ppsp-swatch-label {
	display: block;
	font-size: 10px;
	line-height: 1.2;
	color: #666;
	margin-top: 4px;
	text-align: center;
	max-width: 50px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ppsp-color-swatch--active .ppsp-swatch-label {
	color: var(--theme-palette-color-1, #333);
	font-weight: 600;
}

/* Tooltip on circle */
.ppsp-swatch-circle::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--theme-palette-color-1, #333);
	color: #fff;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	z-index: 10;
}

.ppsp-color-swatch:hover .ppsp-swatch-circle::after {
	opacity: 1;
}
