/* Cosa Nuestra Popup - estilos del frontend (popup de cartel) */

.cnp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	/* Negro puro, como la portada de la web. */
	background: rgba(0, 0, 0, 0.94);
	box-sizing: border-box;
}

.cnp-overlay.cnp-is-visible {
	display: flex;
	animation: cnp-fade-in 0.25s ease;
}

.cnp-modal {
	position: relative;
	/* Tamaño reducido (~50%): el cartel no ocupa casi toda la pantalla. */
	max-width: 46vw;
	max-height: 46vh;
	box-sizing: border-box;
	animation: cnp-pop-in 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.cnp-modal img {
	display: block;
	max-width: 100%;
	max-height: 46vh;
	width: auto;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.cnp-image-link {
	display: block;
	cursor: pointer;
	transition: transform 0.18s ease;
}

.cnp-image-link:hover {
	transform: scale(1.01);
}

.cnp-close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 26px;
	line-height: 36px;
	text-align: center;
	color: #fff;
	cursor: pointer;
	background: #000;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
	transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* Hover en rojo/naranja fuego, como el corazón de la portada. */
.cnp-close:hover {
	background: #ff3d00;
	border-color: #ff3d00;
	transform: rotate(90deg);
}

@keyframes cnp-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes cnp-pop-in {
	0% { opacity: 0; transform: scale(0.6) translateY(30px); }
	60% { opacity: 1; transform: scale(1.05) translateY(0); }
	100% { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 600px) {
	.cnp-overlay {
		padding: 16px;
	}

	/* En móvil ampliamos un poco para que el cartel no quede demasiado pequeño. */
	.cnp-modal {
		max-width: 78vw;
		max-height: 70vh;
	}

	.cnp-modal img {
		max-height: 70vh;
	}

	.cnp-close {
		top: -10px;
		right: -10px;
		width: 36px;
		height: 36px;
		line-height: 34px;
		font-size: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cnp-overlay.cnp-is-visible,
	.cnp-modal {
		animation: none;
	}
}
