.ma-avst {
	margin: 1.25em 0;
	padding: 16px;
	background: var(--ma-avst-box-bg, transparent);
	border: 1px solid var(--ma-avst-border, #d6d6d6);
	border-radius: var(--ma-avst-radius, 4px);
	font-family: var(--ma-avst-font, inherit);
	font-size: var(--ma-avst-size, 15px);
}

.ma-avst--hidden {
	display: none;
}

.ma-avst__title {
	margin: 0 0 4px;
	font-weight: 600;
	font-size: calc(var(--ma-avst-size, 15px) + 1px);
}

.ma-avst__text {
	margin: 0 0 12px;
	font-size: calc(var(--ma-avst-size, 15px) - 1px);
	opacity: .85;
}

.ma-avst .ma-avst__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ma-avst .ma-avst__form input.ma-avst__input {
	flex: 1 1 180px;
	min-width: 0;
	padding: 12px 14px;
	background-color: var(--ma-avst-input-bg, #fff);
	color: var(--ma-avst-input-text, inherit);
	border: 1px solid var(--ma-avst-border, #d6d6d6);
	box-shadow: none;
	border-radius: var(--ma-avst-radius, 4px);
	font-family: inherit;
	font-size: inherit;
	line-height: 1.3;
}

.ma-avst .ma-avst__form input.ma-avst__input:focus {
	outline: 2px solid var(--ma-avst-btn, #111);
	outline-offset: 1px;
}

.ma-avst .ma-avst__form button.ma-avst__btn {
	flex: 0 0 auto;
	padding: 12px 24px;
	background-color: var(--ma-avst-btn, #111);
	color: var(--ma-avst-btn-text, #fff);
	border: 0;
	box-shadow: none;
	border-radius: var(--ma-avst-radius, 4px);
	font-family: inherit;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: opacity .15s ease, background .15s ease;
}

.ma-avst .ma-avst__form button.ma-avst__btn:hover {
	background-color: var(--ma-avst-btn-hover, var(--ma-avst-btn, #111));
	opacity: .9;
}

.ma-avst .ma-avst__form button.ma-avst__btn[disabled] {
	opacity: .55;
	cursor: default;
}

.ma-avst--full .ma-avst__fields {
	width: 100%;
}

.ma-avst__privacy {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 10px;
	font-size: calc(var(--ma-avst-size, 15px) - 2px);
	line-height: 1.4;
}

.ma-avst__msg {
	margin: 10px 0 0;
	font-size: calc(var(--ma-avst-size, 15px) - 1px);
	display: none;
}

.ma-avst__msg.is-visible {
	display: block;
}

.ma-avst__msg.is-error {
	color: #b3261e;
}

.ma-avst__msg.is-ok {
	color: #1e7b34;
}

.ma-avst__pick {
	margin: 10px 0 0;
	font-size: calc(var(--ma-avst-size, 15px) - 2px);
	opacity: .75;
	display: none;
}

.ma-avst.is-waiting-variation .ma-avst__form {
	display: none;
}

.ma-avst.is-waiting-variation .ma-avst__pick {
	display: block;
}

.ma-avst__hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0;
	overflow: hidden;
}

.ma-avst.is-done .ma-avst__form .ma-avst__fields,
.ma-avst.is-done .ma-avst__privacy {
	display: none;
}

@media (max-width: 480px) {
	.ma-avst .ma-avst__fields {
		flex-direction: column;
	}
	/* En columna, flex-basis mide alto: hay que anularlo o el campo crece. */
	.ma-avst .ma-avst__form input.ma-avst__input {
		flex: 0 0 auto;
		width: 100%;
	}
	.ma-avst .ma-avst__form button.ma-avst__btn {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ma-avst .ma-avst__form button.ma-avst__btn {
		transition: none;
	}
}

/* --- Botón en la grilla y popup ------------------------------------- */

.ma-avst-modal[hidden] {
	display: none;
}

.ma-avst-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ma-avst-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .55);
}

.ma-avst-modal__card {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 26px 24px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
	animation: ma-avst-in .18s ease-out;
}

@keyframes ma-avst-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.ma-avst-modal .ma-avst-modal__close,
.ma-avst-modal .ma-avst-modal__close:hover,
.ma-avst-modal .ma-avst-modal__close:focus,
.ma-avst-modal .ma-avst-modal__close:active {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 34px;
	height: 34px;
	min-height: 0;
	padding: 0;
	background: none !important;
	background-color: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none;
	border-radius: 0;
	font-size: 26px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transform: none;
}

.ma-avst-modal .ma-avst-modal__close {
	color: #999;
	transition: color .15s ease;
}

.ma-avst-modal .ma-avst-modal__close:hover {
	color: #111;
}

.ma-avst-modal .ma-avst-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ma-avst-modal__title {
	margin: 0 24px 4px 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

.ma-avst-modal__body .ma-avst {
	margin: 12px 0 0;
	padding: 0;
	border: 0;
	background: none;
}

.ma-avst-modal__body .ma-avst .ma-avst__fields {
	flex-direction: column;
}

.ma-avst-modal__body .ma-avst .ma-avst__form input.ma-avst__input {
	flex: 0 0 auto;
	width: 100%;
	height: auto;
	min-height: 0;
}

.ma-avst-modal__body .ma-avst .ma-avst__form button.ma-avst__btn {
	width: 100%;
}

.ma-avst-modal.is-loading .ma-avst-modal__body::after {
	content: '';
	display: block;
	width: 22px;
	height: 22px;
	margin: 24px auto;
	border: 2px solid rgba(0, 0, 0, .15);
	border-top-color: rgba(0, 0, 0, .5);
	border-radius: 50%;
	animation: ma-avst-spin .7s linear infinite;
}

@keyframes ma-avst-spin {
	to { transform: rotate(360deg); }
}

body.ma-avst-locked {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.ma-avst-modal__card { animation: none; }
	.ma-avst-modal.is-loading .ma-avst-modal__body::after { animation: none; }
}
