/* GLATAM Newsletter Modal */
.gnm-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	color: #111;
}

.gnm-modal.is-active {
	display: flex;
}

.gnm-modal.is-visible .gnm-dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.gnm-modal.is-visible .gnm-overlay {
	opacity: 1;
}

.gnm-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.68);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 260ms ease;
}

.gnm-dialog {
	position: relative;
	z-index: 2;
	width: min(var(--gnm-modal-width, 760px), calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	opacity: 0;
	transform: translateY(14px) scale(0.985);
	transition: opacity 260ms ease, transform 260ms ease;
}

.gnm-card {
	display: grid;
	grid-template-columns: minmax(240px, 1fr) minmax(280px, 0.92fr);
	gap: 28px;
	width: 100%;
	background: #fff;
	border-radius: 18px;
	padding: 22px;
	box-shadow: 0 32px 90px rgba(0, 0, 0, 0.35);
	overflow: hidden;
}

.gnm-media {
	min-height: 390px;
	border-radius: 16px;
	overflow: hidden;
	background: #f4f4f4;
}

.gnm-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gnm-panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 18px 4px 18px 0;
}

.gnm-eyebrow {
	margin: 0 0 8px;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8b8b8b;
}

.gnm-title {
	margin: 0 0 26px;
	color: #dd1f25;
	font-family: Georgia, "Times New Roman", serif;
	font-style: italic;
	font-weight: 700;
	font-size: clamp(30px, 4vw, 42px);
	line-height: 0.98;
	letter-spacing: -0.03em;
}

.gnm-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 5;
	width: 31px;
	height: 31px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(0, 0, 0, 0.48);
	border-radius: 999px;
	background: #fff;
	color: #111;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	padding: 0;
	transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.gnm-close:hover,
.gnm-close:focus {
	transform: rotate(90deg);
	background: #111;
	color: #fff;
	outline: none;
}

.gnm-form .wpcf7 {
	width: 100%;
}

.gnm-form form {
	margin: 0;
}

.gnm-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.gnm-form input[type="text"],
.gnm-form input[type="email"],
.gnm-form input[type="tel"],
.gnm-form input[type="url"],
.gnm-form input[type="number"],
.gnm-form textarea,
.gnm-form select {
	width: 100%;
	height: 46px;
	border: 0;
	border-bottom: 1px solid #dedede;
	border-radius: 0;
	background: transparent;
	color: #111;
	font-size: 14px;
	line-height: 1.4;
	padding: 8px 0;
	box-shadow: none;
	outline: none;
}

.gnm-form input::placeholder,
.gnm-form textarea::placeholder {
	color: #8a9aaf;
	opacity: 1;
}

.gnm-form input[type="text"]:focus,
.gnm-form input[type="email"]:focus,
.gnm-form input[type="tel"]:focus,
.gnm-form input[type="url"]:focus,
.gnm-form input[type="number"]:focus,
.gnm-form textarea:focus,
.gnm-form select:focus {
	border-bottom-color: #111;
	box-shadow: none;
}

.gnm-form .wpcf7-submit,
.gnm-form input[type="submit"].wpcf7-submit,
.gnm-form .rmxv-btn {
	width: 100%;
	min-height: 48px;
	margin-top: 18px;
	border: 0;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.gnm-form .wpcf7-submit:hover,
.gnm-form input[type="submit"].wpcf7-submit:hover,
.gnm-form .rmxv-btn:hover {
	background: #dd1f25;
	transform: translateY(-1px);
}

.gnm-form .wpcf7-spinner {
	position: absolute;
	margin: 14px 0 0 10px;
}

.gnm-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #dd1f25;
	font-size: 12px;
}

.gnm-form .wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 10px 12px !important;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1.35;
}

.gnm-privacy {
	margin-top: 12px;
	color: #777;
	font-size: 11px;
	line-height: 1.45;
}

.gnm-privacy a {
	color: #111;
	text-decoration: underline;
	text-underline-offset: 3px;
}

body.gnm-modal-open {
	overflow: hidden;
}

.glatam-newsletter-open {
	cursor: pointer;
}

/* Estado de éxito */
.gnm-success[hidden] {
	display: none !important;
}

.gnm-success {
	display: flex;
	min-height: 300px;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	animation: gnmSuccessIn 280ms ease both;
}

.gnm-modal.is-success .gnm-content {
	display: none;
}

.gnm-success-icon {
	width: 56px;
	height: 56px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 18px;
	border-radius: 999px;
	background: #000;
	color: #fff;
	font-size: 31px;
	line-height: 1;
	font-weight: 700;
}

.gnm-success-title {
	margin: 0 0 12px;
	color: #dd1f25;
	font-family: Georgia, "Times New Roman", serif;
	font-style: italic;
	font-weight: 700;
	font-size: clamp(28px, 3.5vw, 38px);
	line-height: 1;
	letter-spacing: -0.03em;
}

.gnm-success-message {
	color: #222;
	font-size: 15px;
	line-height: 1.55;
}

.gnm-success-message p {
	margin: 0 0 10px;
}

.gnm-success-btn {
	width: 100%;
	min-height: 48px;
	margin-top: 22px;
	border: 0;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.gnm-success-btn:hover,
.gnm-success-btn:focus {
	background: #dd1f25;
	transform: translateY(-1px);
	outline: none;
}

@keyframes gnmSuccessIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Compatibilidad con la estructura interna del formulario CF7 entregada */
.gnm-form .rmxv-card,
.gnm-form .rmxv-panel,
.gnm-form .rmxv-fields,
.gnm-form .rmxv-actions {
	display: block;
	width: 100%;
}

.gnm-form .rmxv-card .rmxv-media,
.gnm-form .rmxv-card .rmxv-head {
	display: none;
}

.gnm-form .rmxv-field {
	margin-bottom: 8px;
}

/* Mobile */
@media (max-width: 767px) {
	.gnm-modal {
		align-items: flex-end;
		padding: 16px;
	}

	.gnm-dialog {
		width: 100%;
		max-height: calc(100vh - 32px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.gnm-card {
		grid-template-columns: 1fr;
		gap: 18px;
		padding: 16px;
		border-radius: 18px;
	}

	.gnm-media {
		min-height: 230px;
		max-height: 300px;
	}

	.gnm-panel {
		padding: 0 2px 4px;
	}

	.gnm-title {
		margin-bottom: 18px;
		font-size: 32px;
	}

	.gnm-close {
		top: 7px;
		right: 7px;
		width: 34px;
		height: 34px;
		font-size: 28px;
	}

	.gnm-success {
		min-height: auto;
		padding: 18px 2px 8px;
		align-items: center;
		text-align: center;
	}

	.gnm-success-title {
		font-size: 30px;
	}

	.gnm-success-message {
		font-size: 14px;
	}
}

@media (max-width: 420px) {
	.gnm-modal {
		padding: 10px;
	}

	.gnm-card {
		padding: 13px;
	}

	.gnm-media {
		min-height: 200px;
	}

	.gnm-title {
		font-size: 29px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gnm-overlay,
	.gnm-dialog,
	.gnm-close,
	.gnm-form .wpcf7-submit,
	.gnm-success,
	.gnm-success-btn {
		transition: none;
		animation: none;
	}
}
