/**
 * Colour selectors on the product page (luksplayz-commerce, includes/colours/frontend.php).
 *
 * Same look as the approved swatches (personalization.css): 44 px circles with a thin ring, the selected one ringed
 * in the accent, names under the swatches. On personalised products the cards are numbered steps
 * (lpz-pz__step from personalization.css); elsewhere this file draws the same card.
 */

/* Simple products lay out form.cart as a wrapping flex row (quantity + button): take a whole row. */
.lpz-col-group {
	flex: 1 1 100%;
	width: 100%;
	display: grid;
	gap: 0.75rem;
	min-width: 0;
	margin: 0 0 0.75rem;
}

.lpz-col {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 1.125rem 1.25rem 1.25rem;
	border: 1px solid var(--lpz-border, #2a2f3c);
	border-radius: var(--lpz-radius-lg, 16px);
	background: var(--lpz-surface, #171a23);
}

.lpz-col > legend {
	float: left;
	width: 100%;
	margin: 0 0 0.875rem;
	padding: 0;
	color: var(--lpz-text, #f5f5f7);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.lpz-col > legend ~ * {
	clear: both;
}

.lpz-col__req {
	color: var(--lpz-danger, #f87171);
}

.lpz-col__chosen {
	position: absolute;
	top: 1.3rem;
	right: 1.25rem;
	max-width: 40%;
	overflow: hidden;
	color: var(--lpz-text-muted, #9ca3af);
	font-size: 0.875rem;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lpz-col__swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, 4.75rem);
	justify-items: center;
	row-gap: 0.5rem;
}

.lpz-col__swatch {
	position: relative;
	display: grid;
	justify-items: center;
	align-content: start;
	gap: 0.5rem;
	width: 4.75rem;
	margin: 0;
	cursor: pointer;
	text-align: center;
}

/* The radio stays focusable and readable for screen readers; the circle is what people see. */
.lpz-col__input {
	position: absolute;
	top: 4px;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: 0 0 0 -22px;
	opacity: 0;
	cursor: pointer;
}

.lpz-col__dot {
	display: block;
	width: 44px;
	height: 44px;
	margin: 4px;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--lpz-border-strong, #3a4050);
}

.lpz-col__swatch:hover .lpz-col__dot {
	box-shadow: 0 0 0 2px var(--lpz-accent-hover, #a78bfa);
}

.lpz-col__input:checked + .lpz-col__dot {
	box-shadow: 0 0 0 2px var(--lpz-surface, #171a23), 0 0 0 4px var(--lpz-accent, #8b5cf6);
}

.lpz-col__input:focus-visible + .lpz-col__dot {
	outline: 2px solid var(--lpz-accent-hover, #a78bfa);
	outline-offset: 5px;
}

/* "Bez odabira" for optional selectors: an empty circle with a diagonal line. */
.lpz-col__swatch--none .lpz-col__dot {
	background: linear-gradient(135deg, transparent 46%, var(--lpz-text-muted, #9ca3af) 47% 53%, transparent 54%);
}

.lpz-col__name {
	width: 4.5rem;
	color: var(--lpz-text-muted, #9ca3af);
	font-size: 0.75rem;
	line-height: 1.2;
	overflow-wrap: break-word;
}

.lpz-col__input:checked ~ .lpz-col__name {
	color: var(--lpz-text, #f5f5f7);
	font-weight: 600;
}

.lpz-col__empty {
	margin: 0;
	color: var(--lpz-text-muted, #9ca3af);
	font-size: 0.875rem;
}

@media (max-width: 544px) {
	.lpz-col {
		padding: 1rem;
	}

	.lpz-col__chosen {
		top: 1.15rem;
		right: 1rem;
	}
}
