/* =========================================================
   Propuesta Selector de Variaciones - Compra Simple
   Oculta el formulario nativo (misma regla probada del plugin
   original) y muestra solo: select principal, swatches y cantidad.

   Adaptación al tema: sin colores de marca fijos. Tipografía,
   color de texto y superficies se heredan del sitio; solo quedan
   valores neutros para bordes/hover (gris relativo al contraste)
   y medidas de accesibilidad (44/48px). Un tema puede personalizar
   con dos variables globales: --ja-ps-linea y --ja-ps-hover.
   ========================================================= */

.variations,
.wc-block-components-product-add-to-cart-attribute-picker,
.single_variation_wrap .woocommerce-variation-add-to-cart .quantity,
.single_variation_wrap .woocommerce-variation,
.single_add_to_cart_button {
	display: none !important;
}

form.variations_form .variations {
	display: none !important;
}

/* Contenedor */
#ja-ps-container.ja-ps {
	margin: 20px 0;
	padding: 20px;
	border: 1px solid var(--ja-ps-linea, rgba(127, 127, 127, 0.4));
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 480px;
	font-family: inherit;
	color: inherit;
	background: transparent;
}

/* Campos */
.ja-ps-campo {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ja-ps-etiqueta {
	font: inherit;
	color: inherit;
	opacity: 0.8;
}

.ja-ps-stock {
	margin: 0;
	font-size: 0.92em;
	font-weight: 600;
}

.ja-ps-stock.is-available {
	color: #2d6a3f;
}

.ja-ps-stock.is-unavailable {
	color: #a33535;
}

/* Select del atributo principal */
#ja-ps-container .ja-ps-select-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
}

#ja-ps-container .ja-ps-select-wrap::after {
	content: '⌄';
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-56%);
	pointer-events: none;
	font-size: 20px;
	line-height: 1;
}

#ja-ps-container .ja-ps-select {
	font: inherit;
	color: inherit;
	background: #fff;
	padding: 10px 46px 10px 12px;
	border: 1px solid var(--ja-ps-linea, rgba(127, 127, 127, 0.4));
	border-radius: 8px;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	-webkit-appearance: none;
	appearance: none;
}

#ja-ps-container .ja-ps-select:focus {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

/* Swatches del secundario */
.ja-ps-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ja-ps-swatch {
	cursor: pointer;
	transition: all 0.2s ease;
	font: inherit;
	color: inherit;
	border: 2.5px solid transparent;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--ja-ps-linea, rgba(127, 127, 127, 0.5));
}

.ja-ps-swatch.is-color {
	width: 36px;
	height: 36px;
	padding: 0;
}

.ja-ps-swatch.is-text {
	width: auto;
	height: auto;
	min-height: 36px;
	padding: 5px 12px;
	border-radius: 18px;
	line-height: normal;
	text-align: center;
	background: transparent;
}

.ja-ps-swatch:hover:not(.disabled) {
	box-shadow: 0 0 0 1px currentColor;
	transform: translateY(-1px);
}

.ja-ps-swatch:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ja-ps-swatch.selected {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	transform: translateY(-1px);
}

.ja-ps-swatch.is-text.selected {
	background: var(--ja-ps-hover, rgba(127, 127, 127, 0.15));
}

.ja-ps-swatch.disabled {
	opacity: 0.35;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.ja-ps-swatch.is-out-of-stock:not(.disabled) {
	opacity: 0.55;
	box-shadow: 0 0 0 1px #a33535;
}

/* Botonera de cantidad */
.ja-ps-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ja-ps-linea, rgba(127, 127, 127, 0.4));
	border-radius: 10px;
	overflow: hidden;
	width: auto;
	align-self: flex-start;
}

.ja-ps-cantidad {
	width: 64px;
	text-align: center;
	border: none;
	outline: none;
	font: inherit;
	color: inherit;
	padding: 10px 0;
	background: transparent;
	-moz-appearance: textfield;
	appearance: textfield;
	margin: 0;
}

.ja-ps-cantidad::-webkit-outer-spin-button,
.ja-ps-cantidad::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ja-ps-cantidad:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.ja-ps-stepper-btn {
	width: 44px;
	height: 44px;
	border: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	padding: 0;
	line-height: 1;
	transition: background 0.2s, transform 0.05s;
}

.ja-ps-stepper-btn:hover {
	background: var(--ja-ps-hover, rgba(127, 127, 127, 0.15));
}

.ja-ps-stepper-btn:active {
	transform: scale(0.95);
}

.ja-ps-stepper-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

/* Botón de compra (borrado con color de texto: legible en cualquier tema;
   si se quiere relleno de marca, el tema puede definir --ja-ps-hover / un
   background propio sobre .ja-ps-agregar) */
.ja-ps-agregar {
	width: 100%;
	min-height: 48px;
	font: inherit;
	color: inherit;
	background: transparent;
	border: 2px solid currentColor;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s, transform 0.05s;
}

.ja-ps-agregar:hover:not(:disabled) {
	background: var(--ja-ps-hover, rgba(127, 127, 127, 0.15));
	transform: translateY(-1px);
}

.ja-ps-agregar:active:not(:disabled) {
	transform: scale(0.99);
}

.ja-ps-agregar:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.ja-ps-agregar:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Móvil */
@media (max-width: 600px) {
	#ja-ps-container.ja-ps {
		padding: 16px;
		max-width: 100%;
	}

	.ja-ps-swatches {
		width: 100%;
	}
}
