/* =========================================================
 * Smartz · Botón Añadir al Carrito — estilos base
 * Los colores y medidas se controlan desde Elementor.
 * ========================================================= */

.smartz-atc {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
}

.smartz-atc *,
.smartz-atc *::before,
.smartz-atc *::after {
	box-sizing: border-box;
}

/* ---------- Texto de stock (superior) ---------- */
.smartz-atc__stock {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	line-height: 1.3;
}

.smartz-atc__stock-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: 0 0 auto;
}

/* ---------- Fila: cantidad + botón ---------- */
.smartz-atc__row {
	display: flex;
	align-items: stretch;
	gap: 12px;
	width: 100%;
}

/* ---------- Selector de cantidad ---------- */
.smartz-atc__qty {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	overflow: hidden;
}

.smartz-atc__qty-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	min-height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.smartz-atc__qty-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.smartz-atc__qty-input {
	width: 44px;
	height: 100%;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	-moz-appearance: textfield;
	appearance: textfield;
}

.smartz-atc__qty-input::-webkit-outer-spin-button,
.smartz-atc__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.smartz-atc__qty-input:focus {
	outline: none;
}

/* ---------- Botón principal ---------- */
.smartz-atc__button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	gap: 10px;
	border: 0;
	width: 100%;
	text-align: center;
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	line-height: 1.2;
}

.smartz-atc__button:hover {
	text-decoration: none;
}

.smartz-atc__btn-icon,
.smartz-atc__secure-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.smartz-atc__btn-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Estados deshabilitados: agotado (simple) y variación sin seleccionar (variable). */
.smartz-atc__button--disabled,
.smartz-atc__button.disabled,
.smartz-atc__button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.smartz-atc__button--disabled {
	pointer-events: none;
}

/* Loading de WooCommerce al añadir por Ajax */
.smartz-atc__button.loading {
	opacity: 0.7;
	cursor: wait;
}

/* Enlace "Ver carrito" que añade WooCommerce tras el botón: lo ocultamos
   porque el carrito de Elementor ya refleja el cambio. */
.smartz-atc .added_to_cart {
	display: none !important;
}

/* ---------- Productos variables (desplegables por defecto) ---------- */
.smartz-atc__variations-form {
	width: 100%;
	margin: 0;
}

.smartz-atc .variations {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 8px;
}

.smartz-atc .variations th,
.smartz-atc .variations td {
	padding: 5px 0;
	text-align: left;
	vertical-align: middle;
}

.smartz-atc .variations th.label {
	padding-right: 12px;
	white-space: nowrap;
}

.smartz-atc .variations select {
	width: 100%;
	max-width: 100%;
}

.smartz-atc .reset_variations {
	display: inline-block;
	font-size: 12px;
	margin: 0 0 8px;
}

.smartz-atc .single_variation {
	margin-bottom: 8px;
}

.smartz-atc .single_variation:empty {
	margin-bottom: 0;
}

.smartz-atc .woocommerce-variation-add-to-cart {
	width: 100%;
}

/* ---------- Mensaje inferior ---------- */
.smartz-atc__secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	line-height: 1.3;
}

.smartz-atc__secure-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
	/* Apilado de cantidad + botón en móvil (controlado desde el widget). */
	.smartz-atc-stack-mobile-yes .smartz-atc__row {
		flex-direction: column;
		align-items: stretch;
	}

	.smartz-atc-stack-mobile-yes .smartz-atc__qty {
		width: 100%;
		justify-content: space-between;
	}

	.smartz-atc-stack-mobile-yes .smartz-atc__qty-input {
		flex: 1 1 auto;
		width: auto;
	}
}

@media (max-width: 480px) {
	.smartz-atc__button {
		letter-spacing: 0;
	}
}
