/* ============================================================
   DF Moto Accesorios — Swatches de color (2026-09-16)
   Integrado al diseño existente: Oswald uppercase, negro #0A0A0A,
   rojo #E60000, esquinas rectas (border-radius:0).
   Solo aplica a fichas de producto con variaciones de color.
   ============================================================ */

.woocommerce div.product .moto-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 4px 0 2px;
}

.woocommerce div.product .moto-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;          /* táctil cómodo en móvil */
	padding: 8px 14px 8px 10px;
	background: #fff;
	border: 1px solid #D6D3D1;
	border-radius: 0;
	cursor: pointer;
	font-family: 'Inter', sans-serif;
	font-size: 13px;
	color: #0A0A0A;
	line-height: 1.2;
	transition: border-color .2s, box-shadow .2s, background .2s;
	-webkit-tap-highlight-color: transparent;
}

.woocommerce div.product .moto-swatch:hover:not(.is-disabled) {
	border-color: #0A0A0A;
}

.woocommerce div.product .moto-swatch:focus-visible {
	outline: 2px solid #E60000;
	outline-offset: 2px;
}

/* Seleccionado: borde negro + marca roja, sin ambigüedad */
.woocommerce div.product .moto-swatch.is-selected {
	border-color: #0A0A0A;
	box-shadow: inset 0 0 0 1px #0A0A0A;
	background: #FAFAFA;
	font-weight: 600;
}

.woocommerce div.product .moto-swatch.is-selected .moto-swatch__label {
	color: #0A0A0A;
}

.woocommerce div.product .moto-swatch.is-selected::after {
	content: "";
	position: absolute;
	top: -1px;
	right: -1px;
	width: 14px;
	height: 14px;
	background: #E60000
		url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E")
		center/10px 10px no-repeat;
}

/* Agotado: visible pero claramente no disponible */
.woocommerce div.product .moto-swatch.is-disabled {
	cursor: not-allowed;
	opacity: .45;
	background: #F5F5F5;
	border-style: dashed;
}

.woocommerce div.product .moto-swatch.is-disabled .moto-swatch__label {
	text-decoration: line-through;
	color: #6B7280;
}

/* Muestra de color (círculo) */
.woocommerce div.product .moto-swatch__dot {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--moto-swatch-color, #ccc);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}

/* Colores claros (cromado/plateado/blanco): aro para que se distingan */
.woocommerce div.product .moto-swatch__dot[style*="#C9CDD2"],
.woocommerce div.product .moto-swatch__dot[style*="#B8BEC6"] {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
}

.woocommerce div.product .moto-swatch__label {
	font-size: 13px;
	letter-spacing: .02em;
	white-space: nowrap;
}

/* Etiqueta "Agotado" dentro del swatch deshabilitado */
.woocommerce div.product .moto-swatch__oos {
	font-family: 'Oswald', sans-serif;
	font-size: 9px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: #E60000;
	border: 1px solid currentColor;
	padding: 1px 5px;
	line-height: 1.5;
}

/* El <select> nativo queda oculto pero accesible para WooCommerce */
.woocommerce div.product select[data-moto-swatch] {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Etiqueta "Color" coherente con el resto del formulario */
.woocommerce div.product .variations th.label label {
	font-family: 'Oswald', sans-serif;
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-weight: 600;
	color: #0A0A0A;
}

/* Móvil/tablet: grid de 2 columnas parejas (evita huérfanos), táctil cómodo */
@media (max-width: 640px) {
	.woocommerce div.product .moto-swatches {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}
	.woocommerce div.product .moto-swatch {
		width: 100%;
		min-height: 46px;
		padding: 10px 12px 10px 10px;
		font-size: 12px;
		justify-content: flex-start;
	}
	.woocommerce div.product .moto-swatch__dot {
		width: 20px;
		height: 20px;
	}
	/* El badge "AGOTADO" pasa a su propia línea para no desbordar el swatch */
	.woocommerce div.product .moto-swatch.is-disabled {
		flex-wrap: wrap;
		row-gap: 3px;
	}
	.woocommerce div.product .moto-swatch__oos {
		flex: 1 1 100%;
		text-align: center;
		letter-spacing: .12em;
		padding: 1px 4px;
	}
}
