/**
 * Negreiros Color Swatches — tienda
 */

.ncs-field {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin: 0 0 6px;
}

.ncs-native {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.ncs-swatches {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ncs-swatches li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ncs-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: var(--ncs-radius, 50%);
	background: none;
	cursor: pointer;
	transition: border-color 0.16s ease, transform 0.16s ease;
	-webkit-tap-highlight-color: transparent;
}

.ncs-swatch:hover {
	border-color: rgba(0, 0, 0, 0.28);
}

.ncs-swatch:focus-visible {
	outline: 2px solid var(--ncs-accent, #1a1a1a);
	outline-offset: 2px;
}

.ncs-swatch.is-selected {
	border-color: var(--ncs-accent, #1a1a1a);
}

.ncs-swatch__visual {
	display: block;
	width: var(--ncs-size, 34px);
	height: var(--ncs-size, 34px);
	border-radius: var(--ncs-radius, 50%);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
	background-size: cover;
	background-position: center;
	pointer-events: none;
}

.ncs-swatch__visual--label {
	width: auto;
	min-width: var(--ncs-size, 34px);
	height: auto;
	padding: 7px 14px;
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.01em;
	white-space: nowrap;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* Marca de selección */
.ncs-swatch.is-selected .ncs-swatch__visual::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 5px;
	margin: -4px 0 0 -5px;
	border-left: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(-45deg);
	filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.55));
}

.ncs-swatch--label.is-selected .ncs-swatch__visual::after {
	display: none;
}

.ncs-swatch--label.is-selected .ncs-swatch__visual {
	box-shadow: inset 0 0 0 2px var(--ncs-accent, #1a1a1a);
}

/* Agotado */
.ncs-swatch.is-disabled {
	cursor: not-allowed;
}

.ncs-swatch.is-disabled .ncs-swatch__visual {
	opacity: 0.4;
}

.ncs-swatch.is-disabled::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 10%;
	width: 80%;
	height: 1px;
	background: currentColor;
	opacity: 0.65;
	transform: rotate(-45deg);
}

.ncs-swatches[data-oos="disable"] .ncs-swatch.is-disabled::before,
.ncs-swatches[data-oos="hide"] .ncs-swatch.is-disabled::before {
	display: none;
}

.ncs-swatches[data-oos="hide"] .ncs-swatch.is-disabled {
	display: none;
}

/* Globo */
.ncs-swatch__tip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 5;
	padding: 5px 9px;
	border-radius: 3px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	line-height: 1.3;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%);
	transition: opacity 0.14s ease;
	pointer-events: none;
}

.ncs-swatch:hover .ncs-swatch__tip,
.ncs-swatch:focus-visible .ncs-swatch__tip {
	opacity: 1;
	visibility: visible;
}

/* Nombre del color elegido */
.ncs-current {
	font-size: 14px;
	line-height: 1.4;
	opacity: 0.75;
}

.ncs-current:empty {
	display: none;
}

/* Catálogo */
.ncs-swatches--loop {
	gap: 6px;
	margin: 8px 0 4px;
	justify-content: inherit;
}

.ncs-swatches--loop .ncs-swatch {
	padding: 3px;
}

.ncs-swatches--loop .ncs-swatch__visual {
	width: var(--ncs-size-loop, 20px);
	height: var(--ncs-size-loop, 20px);
}

.ncs-swatches--loop .ncs-swatch__visual--label {
	width: auto;
	height: auto;
	padding: 4px 9px;
	font-size: 11px;
}

/* Móvil: área táctil cómoda */
@media (max-width: 782px) {
	.ncs-swatch {
		padding: 7px;
	}

	.ncs-swatch__tip {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ncs-swatch,
	.ncs-swatch__tip {
		transition: none;
	}
}

/* Galería del producto en cuadrícula de 2 columnas */
.woocommerce-product-gallery:not(.flexslider):not(.ncs-gallery--single) .woocommerce-product-gallery__wrapper:not(.slick-initialized) {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--ncs-gallery-gap, 10px);
	width: 100% !important;
	margin: 0;
	transform: none !important;
}

.woocommerce-product-gallery:not(.flexslider):not(.ncs-gallery--single) .woocommerce-product-gallery__wrapper:not(.slick-initialized) > .woocommerce-product-gallery__image,
.woocommerce-product-gallery:not(.flexslider):not(.ncs-gallery--single) .woocommerce-product-gallery__wrapper:not(.slick-initialized) > li,
.woocommerce-product-gallery:not(.flexslider):not(.ncs-gallery--single) .woocommerce-product-gallery__wrapper:not(.slick-initialized) > div {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	flex: none !important;
}

.woocommerce-product-gallery:not(.flexslider):not(.ncs-gallery--single) .woocommerce-product-gallery__wrapper:not(.slick-initialized) img {
	display: block;
	width: 100%;
	height: auto;
}

/* Un color con una sola foto ocupa todo el ancho de la columna */
.woocommerce-product-gallery.ncs-gallery--single .woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery.ncs-gallery--single .woocommerce-product-gallery__wrapper .slick-track {
	display: block;
	width: 100% !important;
	margin: 0;
	transform: none !important;
}

.woocommerce-product-gallery.ncs-gallery--single .woocommerce-product-gallery__image,
.woocommerce-product-gallery.ncs-gallery--single .woocommerce-product-gallery__image.slick-slide {
	float: none;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0;
	padding: 0;
	flex: 0 0 100%;
}

.woocommerce-product-gallery.ncs-gallery--single .woocommerce-product-gallery__image img {
	width: 100%;
	height: auto;
}
