/* Malta MegaSoft Payment — voucher y modal con la marca Ikin */

.malta-ms-voucher,
.malta-ms-modal {
	--ms-hueso: #FBF9F5;
	--ms-verde: #0E2A22;
	--ms-tierra: #8a4d2b;
	--ms-tierra-claro: #ce9473;
	--ms-tinta: #1B1B18;
	--ms-gris: #6f6f66;
	--ms-borde: #dcd6cc;
	--ms-exito: #2f6b4f;
	--ms-error: #9b2c2c;
	--ms-display: 'Marcellus', Georgia, 'Times New Roman', serif;
	--ms-texto: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Voucher ---------- */
.malta-ms-voucher {
	--ms-accent: var(--ms-verde);
	max-width: 760px;
	margin: 0 auto 40px;
	background: var(--ms-hueso);
	border: 1px solid var(--ms-borde);
	border-top: 4px solid var(--ms-accent);
	border-radius: 14px;
	color: var(--ms-tinta);
	font-family: var(--ms-texto);
	font-weight: 300;
	overflow: hidden;
}
.malta-ms-voucher--approved { --ms-accent: var(--ms-exito); }
.malta-ms-voucher--rejected { --ms-accent: var(--ms-error); }
.malta-ms-voucher--pending,
.malta-ms-voucher--review   { --ms-accent: var(--ms-tierra); }

.malta-ms-voucher__head {
	padding: 28px 32px 8px;
}
.malta-ms-voucher__eyebrow {
	display: block;
	font-size: .72rem;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--ms-tierra);
	font-weight: 500;
	margin-bottom: 6px;
}
.malta-ms-voucher__title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 8px !important;
	font-family: var(--ms-display) !important;
	font-weight: 400 !important;
	font-size: 1.7rem !important;
	line-height: 1.2;
	color: var(--ms-accent) !important;
}
.malta-ms-voucher__icon {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ms-accent);
	position: relative;
}
.malta-ms-voucher__icon::after {
	content: '';
	position: absolute;
	inset: 0;
	background: #fff;
	-webkit-mask: var(--ms-icon) center / 16px no-repeat;
	mask: var(--ms-icon) center / 16px no-repeat;
}
.malta-ms-voucher--approved .malta-ms-voucher__icon { --ms-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.malta-ms-voucher--rejected .malta-ms-voucher__icon { --ms-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.malta-ms-voucher--pending .malta-ms-voucher__icon,
.malta-ms-voucher--review .malta-ms-voucher__icon { --ms-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='5.5' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M8 5v3.2l2 1.3' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }

.malta-ms-voucher__message {
	margin: 0 0 12px;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--ms-tinta);
}
.malta-ms-voucher__sandbox,
.malta-ms-modal__sandbox {
	display: inline-block;
	margin: 0 0 8px;
	padding: 2px 10px;
	font-size: .72rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	border: 1px dashed var(--ms-tierra);
	border-radius: 999px;
	color: var(--ms-tierra);
}

.malta-ms-voucher__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 24px;
	padding: 12px 32px 24px;
	align-items: start;
}
.malta-ms-voucher__data {
	margin: 0;
}
.malta-ms-voucher__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 0;
	border-bottom: 1px solid #ece6db;
	font-size: .92rem;
}
.malta-ms-voucher__row dt {
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--ms-gris);
	font-weight: 400;
	margin: 0;
}
.malta-ms-voucher__row dd {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	text-align: right;
	font-weight: 500;
	overflow-wrap: anywhere;
}
.malta-ms-voucher__ticket {
	margin: 0;
}
.malta-ms-voucher__ticket figcaption {
	font-size: .72rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ms-gris);
	margin-bottom: 8px;
}
.malta-ms-voucher__pre {
	margin: 0;
	padding: 18px 20px;
	background: #fff;
	border: 1px dashed #cfc6b8;
	border-radius: 8px;
	font-family: 'Courier New', Courier, monospace;
	font-size: 13px;
	line-height: 1.5;
	white-space: pre;
	overflow-x: auto;
	color: var(--ms-tinta);
}
.malta-ms-voucher__pre strong {
	font-weight: 700;
}

.malta-ms-voucher__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	padding: 18px 32px 26px;
	border-top: 1px solid #ece6db;
}

.malta-ms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	border: 1px solid var(--ms-verde, #0E2A22);
	border-radius: 999px;
	background: var(--ms-verde, #0E2A22);
	color: #fff !important;
	font-family: var(--ms-texto);
	font-size: .9rem;
	font-weight: 500;
	letter-spacing: .04em;
	text-decoration: none !important;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.malta-ms-btn:hover,
.malta-ms-btn:focus-visible {
	background: var(--ms-tierra, #8a4d2b);
	border-color: var(--ms-tierra, #8a4d2b);
}
.malta-ms-btn:focus-visible {
	outline: 2px solid var(--ms-tierra-claro, #ce9473);
	outline-offset: 2px;
}
.malta-ms-btn--ghost {
	background: transparent;
	color: var(--ms-verde, #0E2A22) !important;
}
.malta-ms-btn--ghost:hover {
	color: #fff !important;
}

.malta-ms-amount {
	margin: 10px 0 0;
	font-size: .95rem;
}

@media (max-width: 680px) {
	.malta-ms-voucher__head,
	.malta-ms-voucher__body,
	.malta-ms-voucher__actions { padding-left: 18px; padding-right: 18px; }
	.malta-ms-voucher__body { grid-template-columns: 1fr; }
	.malta-ms-voucher__title { font-size: 1.4rem !important; }
	.malta-ms-voucher__pre { font-size: 12px; }
}

/* Imprimir solo el comprobante */
@media print {
	body.malta-ms-printing * { visibility: hidden !important; }
	body.malta-ms-printing .malta-ms-voucher,
	body.malta-ms-printing .malta-ms-voucher * { visibility: visible !important; }
	body.malta-ms-printing .malta-ms-voucher { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
	body.malta-ms-printing .malta-ms-voucher__actions { display: none !important; }
}

/* ---------- Compatibilidad con el tema Rixos ----------
   El tema aplica `form label { float:left; width:100%; clear:both }` (pensado para Contact Form 7)
   a TODAS las etiquetas de formulario. Eso colapsa la caja del método de pago en el checkout de
   bloques (la caja mide 16 px y el texto queda fuera) y solapa el título en "Pagar pedido". */
.wc-block-checkout .wc-block-components-radio-control__option {
	float: none;
	clear: none;
}
.malta-ms-blocks-label {
	font-family: var(--ms-texto, 'Jost', sans-serif);
	font-size: 1rem;
	font-weight: 500;
	color: #0E2A22;
}
/* El tema también flota los <p> de los formularios (`form:not(.woocommerce-checkout) p`), por eso
   se necesita más especificidad para que la caja envuelva la descripción. */
.wc-block-checkout .wc-block-components-radio-control-accordion-content .malta-ms-blocks-description p {
	float: none;
	clear: none;
	width: auto;
	margin: 0 0 .75em;
}
/* Checkout clásico y página "Pagar pedido" (los selectores con #payment ganan a las reglas del tema) */
#payment ul.payment_methods {
	list-style: none;
	padding-left: 0;
}
#payment ul.payment_methods > li > label {
	float: none;
	clear: none;
	width: auto;
}
#payment .payment_box p {
	float: none;
	clear: none;
	width: auto;
	margin: 0 0 .75em;
}

/* ---------- Modal plataforma no disponible ---------- */
.malta-ms-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--ms-texto);
}
.malta-ms-modal[data-open="false"] { display: none; }
.malta-ms-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(14, 42, 34, .72);
}
.malta-ms-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 480px;
	padding: 36px 32px 30px;
	background: var(--ms-hueso);
	border-top: 4px solid var(--ms-tierra);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	text-align: center;
	color: var(--ms-tinta);
	animation: malta-ms-in .25s ease-out;
}
.malta-ms-modal__icon {
	display: inline-flex;
	width: 56px;
	height: 56px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f3e7dd;
	color: var(--ms-tierra);
	margin-bottom: 12px;
}
.malta-ms-modal__eyebrow {
	margin: 0 0 4px;
	font-size: .72rem;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--ms-tierra);
	font-weight: 500;
}
.malta-ms-modal__title {
	margin: 0 0 12px !important;
	font-family: var(--ms-display) !important;
	font-weight: 400 !important;
	font-size: 1.6rem !important;
	color: var(--ms-verde) !important;
}
.malta-ms-modal__text {
	margin: 0 0 10px;
	font-size: 1rem;
	line-height: 1.55;
}
.malta-ms-modal__note {
	margin: 0 0 18px;
	font-size: .85rem;
	color: var(--ms-gris);
}
@keyframes malta-ms-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.malta-ms-modal__dialog { animation: none; }
}
