/* EH Color Swatches — Frontend premium (carrés) */

.eh-cs-swatches-wrapper {
	margin: 0;
	padding: 0;
}

.eh-cs-swatches-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
}

.eh-cs-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.eh-cs-swatch {
	position: relative;
	flex: 0 0 30px;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 2px !important;
	cursor: pointer;
	background-clip: padding-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.eh-cs-swatch:hover {
	border-color: rgba(0, 0, 0, 0.18);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transform: translateY(-1px);
}

.eh-cs-swatch:focus-visible {
	outline: 2px solid #c9a96e;
	outline-offset: 2px;
}

.eh-cs-swatch__ring {
	position: absolute;
	inset: -3px;
	border-radius: 3px !important;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
	pointer-events: none;
}

.eh-cs-swatch--selected {
	border-color: rgba(201, 169, 110, 0.45);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.eh-cs-swatch--selected .eh-cs-swatch__ring {
	border-color: #c9a96e;
}

.eh-cs-selected-name {
	font-size: 11px;
	font-weight: 600;
	color: #6b6560;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
	min-height: 0;
}

.eh-cs-selected-name:empty {
	display: none;
}

/* Label WooCommerce natif conservé */
.eh-cs-variations table.variations tr:has(.eh-cs-swatches-wrapper) th.label {
	display: table-cell;
	vertical-align: middle;
	padding-bottom: 6px;
}

.eh-cs-variations table.variations tr:has(.eh-cs-swatches-wrapper) td.value {
	padding-top: 4px;
	padding-bottom: 12px;
	vertical-align: middle;
}

.eh-cs-variations table.variations tr:has(.eh-cs-swatches-wrapper) td.value select.eh-cs-raw-select {
	display: none !important;
}

/* Tablette */
@media (max-width: 1024px) {
	.eh-cs-swatch {
		flex: 0 0 28px;
		width: 28px;
		height: 28px;
	}

	.eh-cs-swatches {
		gap: 7px;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.eh-cs-swatches-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.eh-cs-swatch {
		flex: 0 0 26px;
		width: 26px;
		height: 26px;
	}

	.eh-cs-swatches {
		gap: 6px;
	}

	.eh-cs-selected-name {
		font-size: 10px;
	}
}

/* Très petit écran */
@media (max-width: 380px) {
	.eh-cs-swatch {
		flex: 0 0 24px;
		width: 24px;
		height: 24px;
	}

	.eh-cs-swatch__ring {
		inset: -2px;
		border-width: 1.5px;
	}
}
