/**
 * Senplo Linked Colors — frontend swatch selector styles.
 *
 * Centered, minimal composition — label, then swatches, matching a
 * refined single-product layout (Nike / Zara / Reserva style selector).
 */

.senplo-lc-swatches {
	--senplo-lc-dot-size: 30px;
	--senplo-lc-ring-gap: 5px;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	width: 100%;
	max-width: 100%;
	margin: 24px 0 28px;
	text-align: center;
	box-sizing: border-box;
}

/*
 * Some themes (Uncode included) lay the product summary out as a flex or
 * grid column with `align-items: flex-start`, which shrinks every child to
 * its own content width instead of stretching it — that leaves nothing for
 * `align-items/justify-content: center` above to center against, so the
 * swatches hug the left edge. Forcing `width: 100%` above is normally
 * enough; this rule is a second safety net for themes that also apply
 * `flex-basis: auto` / `width: fit-content` at a higher specificity.
 */
.woocommerce div.product .summary .senplo-lc-swatches,
.woocommerce-page div.product .summary .senplo-lc-swatches {
	width: 100%;
	flex: 1 1 100%;
}

.senplo-lc-swatches__label {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6b6b6b;
}

.senplo-lc-swatches__current-name {
	margin-left: 4px;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	color: #111;
}

.senplo-lc-swatches__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 14px;
	width: 100%;
}

.senplo-lc-dot {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc( var( --senplo-lc-dot-size ) + ( var( --senplo-lc-ring-gap ) * 2 ) + 2px );
	height: calc( var( --senplo-lc-dot-size ) + ( var( --senplo-lc-ring-gap ) * 2 ) + 2px );
	border-radius: 50%;
	border: 1px solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.senplo-lc-dot__inner {
	display: block;
	width: var( --senplo-lc-dot-size );
	height: var( --senplo-lc-dot-size );
	border-radius: 50%;
	background-color: var( --senplo-lc-swatch-color, #ccc );
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	box-shadow: inset 0 0 0 1px rgba( 255, 255, 255, 0.4 );
	transition: transform 0.18s ease;
}

.senplo-lc-dot:hover .senplo-lc-dot__inner {
	transform: scale( 1.07 );
}

.senplo-lc-dot:focus-visible {
	outline: none;
	border-color: #111;
}

.senplo-lc-dot.is-current {
	border-color: #111;
}

.senplo-lc-dot.is-disabled {
	cursor: not-allowed;
	border-color: transparent;
	opacity: 0.4;
}

.senplo-lc-dot.is-disabled .senplo-lc-dot__inner {
	background-image: linear-gradient( 135deg, transparent 46%, rgba( 0, 0, 0, 0.55 ) 48%, rgba( 0, 0, 0, 0.55 ) 52%, transparent 54% );
}

.senplo-lc-popover {
	position: absolute;
	z-index: 20;
	bottom: calc( 100% + 14px );
	left: 50%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	width: 140px;
	padding: 12px;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.06 );
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba( 0, 0, 0, 0.14 );
	pointer-events: none;
	opacity: 0;
	transform: translate( -50%, 6px );
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.senplo-lc-popover.is-visible {
	opacity: 1;
	transform: translate( -50%, 0 );
}

.senplo-lc-popover::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX( -50% );
	border: 6px solid transparent;
	border-top-color: #fff;
}

.senplo-lc-popover__image {
	width: 100%;
	height: 116px;
	object-fit: cover;
	border-radius: 5px;
	background: #f3f3f3;
}

.senplo-lc-popover__name {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #111;
	text-align: center;
}

.senplo-lc-popover__price {
	font-size: 0.75rem;
	color: #777;
	text-align: center;
}

.senplo-lc-popover__price:empty {
	display: none;
}

@media ( hover: none ) {
	.senplo-lc-popover {
		display: none !important;
	}
}
