/* MORA Popup Imagen — parte pública */

.mpi {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 20px;
	overflow: auto;
	background: rgba(0, 0, 0, 0.65);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.mpi[hidden] {
	display: none;
}

.mpi.mpi--abierto {
	opacity: 1;
	pointer-events: auto;
}

html.mpi-bloqueado {
	overflow: hidden;
}

.mpi__caja {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: auto;
}

.mpi .mpi__img {
	display: block;
	width: auto;
	height: auto;
	max-width: calc(100vw - 40px);
	max-width: min(calc(100vw - 40px), 900px);
	max-height: 78vh;
	max-height: 78dvh;
	margin: 0;
	border: 0;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

/* El botón de cierre se blinda contra los estilos genéricos de <button> del tema. */
.mpi .mpi__cerrar {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #111;
	background-image: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: 0;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.mpi .mpi__cerrar:hover {
	background: #333;
	color: #fff;
}

.mpi .mpi__cerrar:focus-visible,
.mpi a.mpi__boton:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.mpi a.mpi__boton,
.mpi a.mpi__boton:hover,
.mpi a.mpi__boton:focus,
.mpi a.mpi__boton:visited {
	color: var(--mpi-texto, #fff);
	text-decoration: none;
}

.mpi a.mpi__boton {
	display: inline-block;
	max-width: 100%;
	box-sizing: border-box;
	padding: 14px 28px;
	border: 0;
	border-radius: 6px;
	background: var(--mpi-fondo, #111);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.mpi a.mpi__boton:hover {
	filter: brightness(1.15);
}

@media (prefers-reduced-motion: reduce) {
	.mpi,
	.mpi a.mpi__boton {
		transition: none;
	}
}
