/**
 * Estilos CSS del Megamenú Altamira.
 * Enfoque Mobile-First, accesible, animado y personalizable mediante variables CSS y variables en línea.
 */

.alt-mm {
	/* Variables CSS por defecto */
	--navy: #16395c;
	--navy-2: #0f2d49;
	--red: #d40b3b;
	--blue: #2f6cb0;
	--dark: #333a44;
	--ink: #373737;
	--line: #e2e6ea;
	--white: #ffffff;
	--gray-bg: #f9f9f9;

	/* Variables en línea dinámicas de WordPress */
	--menu-txt: var(--alt-mm-menu-text-color, #e5e5e5);
	--menu-txt-hover: var(--alt-mm-menu-text-hover-color, var(--white));
	--submenu-txt: var(--alt-mm-submenu-text-color, var(--ink));
	--submenu-txt-hover: var(--alt-mm-submenu-text-hover-color, var(--navy));
	--topbar-txt: var(--alt-mm-topbar-text-color, #cdd6e0);
	--menu-resp-txt: var(--alt-mm-menu-responsive-text-color, #e5e5e5);
	--menu-resp-txt-hover: var(--alt-mm-menu-responsive-text-hover-color, var(--white));

	/* Fondos personalizables (barra superior, cabecera, megamenú y menú responsive) */
	--topbar-bg: var(--alt-mm-topbar-bg-color, var(--navy-2));
	--header-bg: var(--alt-mm-header-bg-color, var(--navy));
	--megamenu-bg: var(--alt-mm-megamenu-bg-color, var(--white));
	--responsive-bg: var(--alt-mm-responsive-bg-color, var(--navy-2));

	font-family: "DM Sans", system-ui, -apple-system, sans-serif;
	position: relative;
	z-index: 9000;
	background: var(--header-bg);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	width: 100%;
	box-sizing: border-box;
}

.alt-mm *,
.alt-mm *::before,
.alt-mm *::after {
	box-sizing: border-box;
}

.alt-mm a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.alt-mm__container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 20px;
	display: flex;
	align-items: center;
	width: 100%;
}

/* ==========================================================================
   BARRA SUPERIOR (MÓVIL POR DEFECTO)
   ========================================================================== */
.alt-mm__top {
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	background: var(--topbar-bg);
}

.alt-mm__top .alt-mm__container {
	justify-content: space-between;
	min-height: 44px;
	flex-wrap: nowrap;
	padding-top: 5px;
	padding-bottom: 5px;
}

.alt-mm__contact {
	display: flex;
	align-items: center;
	gap: 12px;
}

.alt-mm__contact a {
	color: var(--topbar-txt);
	font-size: 13px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.alt-mm__contact a:hover {
	color: var(--white);
}

.alt-mm__contact svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

.alt-mm__util {
	display: flex;
	align-items: center;
	gap: 10px;
}

.alt-mm__lang,
.alt-mm__search {
	background: none;
	border: 0;
	color: var(--topbar-txt);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px;
}

.alt-mm__lang:hover,
.alt-mm__search:hover {
	color: var(--white);
}

.alt-mm__search svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Botones de acción generales */
.alt-btn {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 8px 12px;
	border-radius: 4px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	line-height: 1;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.alt-btn svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.alt-btn--primary {
	background: var(--blue);
	color: var(--white);
}

.alt-btn--primary:hover {
	background: #1c5290;
}

.alt-btn--dark {
	background: var(--dark);
	color: var(--white);
}

.alt-btn--dark:hover {
	background: #23282f;
}

.alt-btn--outline {
	background: transparent;
	color: #ff5c7a;
	border: 1px solid var(--red);
}

.alt-btn--outline:hover {
	background: var(--red);
	color: var(--white);
}

/* Botón de acción con imagen */
.alt-btn--image {
	padding: 0;
	border: 0;
	background: transparent;
	border-radius: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.alt-btn-img {
	max-height: 34px;
	width: auto;
	object-fit: contain;
	border-radius: 4px;
	transition: opacity 0.2s;
}

.alt-btn--image:hover .alt-btn-img {
	opacity: 0.85;
}

/* Ocultar botones e email en pantallas muy pequeñas */
@media (max-width: 576px) {
	.alt-mm__contact a:not(:first-child) {
		display: none;
	}
	.alt-mm__util .alt-btn {
		display: none;
	}
}

/* ==========================================================================
   BARRA PRINCIPAL (MÓVIL POR DEFECTO)
   ========================================================================== */
.alt-mm__main .alt-mm__container {
	min-height: 64px;
	justify-content: space-between;
}

/* Logotipo */
.alt-mm__logo {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--white);
}

.alt-mm__logo-img {
	max-height: 48px;
	width: auto;
}

.alt-mm__logo-mark {
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	display: grid;
	place-items: center;
	border: 2px solid var(--red);
	border-radius: 50%;
	color: var(--red);
	font-size: 18px;
	font-weight: 700;
}

.alt-mm__logo-text {
	display: flex;
	flex-direction: column;
	line-height: 1.1;
}

.alt-mm__logo-text b {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.alt-mm__logo-text span {
	font-size: 12px;
	font-weight: 400;
	color: #cdd6e0;
}

.alt-mm__logo-text small {
	font-size: 9px;
	font-weight: 500;
	color: #8ea3b8;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin-top: 2px;
}

/* Burger Button */
.alt-mm__burger {
	background: none;
	border: 0;
	width: 40px;
	height: 40px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 5px;
	justify-content: center;
	align-items: center;
	padding: 0;
	margin-left: auto;
}

.alt-mm__burger span {
	width: 22px;
	height: 2px;
	background: var(--white);
	transition: transform 0.25s, opacity 0.25s;
}

/* Transformaciones del burguer al abrir */
.alt-mm.mobile-open .alt-mm__burger span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.alt-mm.mobile-open .alt-mm__burger span:nth-child(2) {
	opacity: 0;
}

.alt-mm.mobile-open .alt-mm__burger span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   NAVEGACIÓN MÓVIL (DRAWER LATERAL) Y ASPA DE CIERRE
   ========================================================================== */
.alt-mm__nav {
	position: fixed;
	top: 0;
	right: -100%;
	bottom: 0;
	width: min(85vw, 340px);
	background: var(--responsive-bg);
	margin: 0;
	overflow-y: auto;
	transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	padding: 70px 0 40px;
	box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
	display: block;
}

.alt-mm.mobile-open .alt-mm__nav {
	right: 0;
}

/* El panel recibe el foco al abrirse para que teclado y lectores de pantalla
   entren en el menú. No debe dibujar contorno: no es un control. */
.alt-mm__nav:focus {
	outline: none;
}

/* Aspa de Cierre ("X") */
.alt-mm__close {
	display: block;
	position: absolute;
	right: 20px;
	top: 15px;
	background: none;
	border: 0;
	color: var(--white);
	font-size: 38px;
	cursor: pointer;
	line-height: 1;
	padding: 5px;
	transition: color 0.2s;
	z-index: 10;
}

/* El aspa nunca muestra fondo, ni en hover, focus o pulsación.
   Usamos !important para neutralizar los estilos de `button:hover` de cualquier tema. */
.alt-mm__close,
.alt-mm__close:hover,
.alt-mm__close:focus,
.alt-mm__close:focus-visible,
.alt-mm__close:active {
	background: none !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border: 0 !important;
	-webkit-tap-highlight-color: transparent;
}

.alt-mm__close:hover,
.alt-mm__close:active {
	color: var(--red);
	outline: none;
}

/* Se mantiene un indicador visible para navegación por teclado (accesibilidad). */
.alt-mm__close:focus-visible {
	color: var(--red);
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 4px;
}

.alt-mm__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.alt-mm__menu > li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	position: relative;
}

.alt-mm__menu > li > a,
.alt-mm__menu > li > .alt-mm__trigger {
	color: var(--menu-resp-txt);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: 0;
	text-align: left;
	cursor: pointer;
	transition: color 0.2s, background-color 0.2s;
}

.alt-mm__menu > li > a:focus-visible,
.alt-mm__menu > li > .alt-mm__trigger:focus-visible {
	outline: 2px solid var(--red);
	outline-offset: -2px;
}

.alt-mm__menu > li.open > .alt-mm__trigger,
.alt-mm__menu > li > a:hover,
.alt-mm__menu > li > .alt-mm__trigger:hover {
	color: var(--menu-resp-txt-hover);
	background: rgba(255, 255, 255, 0.03);
}

/* Caret/Flecha */
.alt-mm__menu > li .caret {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
	display: inline-block;
	margin-top: -4px;
}

.alt-mm__menu > li.open .caret {
	transform: rotate(225deg);
	margin-top: 2px;
}

/* ==========================================================================
   ACORDEÓN MÓVIL SMOOTH CON GRID (Mobile-First)
   ========================================================================== */
.alt-mm__panel {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
	background-color: var(--responsive-bg);
	background-image: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22));
	color: var(--menu-resp-txt);
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	padding: 0;
}

.alt-mm__menu > li.open .alt-mm__panel {
	max-height: 1200px;
	opacity: 1;
}

.alt-mm__panel-inner {
	display: flex;
	flex-direction: column;
	padding: 15px 20px 25px;
	gap: 15px;
}

.alt-mm__intro {
	width: 100%;
}

.alt-mm__intro h4 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	color: var(--menu-resp-txt-hover);
}

.alt-mm__intro p {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.5;
	color: #a0aec0;
}

.alt-mm__intro-link {
	color: var(--red);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.alt-mm__links {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	padding-top: 10px;
	width: 100%;
}

.alt-mm__links li {
	margin: 0;
}

.alt-mm__links a {
	display: block;
	padding: 8px 0;
	font-size: 13.5px;
	color: var(--menu-resp-txt);
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.alt-mm__links a:hover {
	color: var(--menu-resp-txt-hover);
	padding-left: 5px;
}

/* Ocultar banner destacado en móvil para mejorar velocidad y espacio */
.alt-mm__feature {
	display: none;
}

/* Cerradura de scroll del body mientras el menú móvil está abierto.
   `overflow: hidden` por sí solo NO detiene el scroll en Safari iOS: la página
   sigue desplazándose por detrás del menú. Fijando el body y compensando su
   desplazamiento con `top` (lo calcula el JS) el bloqueo sí es efectivo. */
body.alt-mm-lock {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
}

/* ==========================================================================
   DISEÑO DESKTOP (PANTALLAS > 1024px)
   ========================================================================== */
@media (min-width: 1025px) {
	.alt-mm {
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	}

	.alt-mm__top .alt-mm__container {
		justify-content: flex-end;
		gap: 20px;
		min-height: 48px;
	}

	.alt-mm__main .alt-mm__container {
		min-height: 80px;
		justify-content: flex-start;
		gap: 30px;
	}

	.alt-mm__burger,
	.alt-mm__close {
		display: none;
	}

	/* Barra principal de navegación */
	.alt-mm__nav {
		position: static;
		width: auto;
		background: transparent;
		box-shadow: none;
		padding: 0;
		margin-left: auto;
		overflow-y: visible;
	}

	.alt-mm__menu {
		flex-direction: row;
		align-items: center;
		gap: 6px;
	}

	.alt-mm__menu > li {
		border-bottom: 0;
		position: static;
	}

	.alt-mm__menu > li > a,
	.alt-mm__menu > li > .alt-mm__trigger {
		color: var(--menu-txt);
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		padding: 30px 14px;
		display: inline-flex;
		align-items: center;
		gap: 6px;
		position: relative;
		background: none;
		border: 0;
		height: 100%;
	}

	/* Línea indicadora activa en hover */
	.alt-mm__menu > li > a::after,
	.alt-mm__menu > li > .alt-mm__trigger::after {
		content: "";
		position: absolute;
		left: 14px;
		right: 14px;
		bottom: 22px;
		height: 2px;
		background: var(--red);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.22s ease;
	}

	.alt-mm__menu > li:hover > a,
	.alt-mm__menu > li:hover > .alt-mm__trigger,
	.alt-mm__menu > li.open > .alt-mm__trigger {
		color: var(--menu-txt-hover);
		background: transparent;
	}

	.alt-mm__menu > li:hover > a::after,
	.alt-mm__menu > li:hover > .alt-mm__trigger::after,
	.alt-mm__menu > li.open > .alt-mm__trigger::after {
		transform: scaleX(1);
	}

	/* Caret animada */
	.alt-mm__menu > li .caret {
		margin-top: -3px;
	}

	.alt-mm__menu > li:hover .caret,
	.alt-mm__menu > li.open .caret {
		transform: rotate(225deg);
		margin-top: 3px;
	}

	/* ==========================================================================
	   PANEL MEGAMENÚ DESKTOP (ANULACIÓN DE ACORDEÓN)
	   ========================================================================== */
	.alt-mm__panel {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		background-color: var(--megamenu-bg);
		background-image: none;
		color: var(--ink);
		box-shadow: 0 15px 35px rgba(15, 32, 55, 0.15);
		border-top: 1px solid #eef1f4;
		opacity: 0;
		visibility: hidden;
		transform: translateY(8px);
		transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
		
		/* Reseteamos el acordeón de la animación móvil */
		display: block !important;
		max-height: none;
		overflow: visible;
	}

	/* Mostrar panel en hover y en foco */
	.alt-mm__menu > li:hover .alt-mm__panel,
	.alt-mm__menu > li.open .alt-mm__panel {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.alt-mm__panel-inner {
		flex-direction: row;
		padding: 38px 20px;
		gap: 40px;
		align-items: stretch;
		min-height: auto;
	}

	.alt-mm__panel .caret-top {
		position: absolute;
		top: -8px;
		left: auto;
		width: 16px;
		height: 16px;
		background: var(--megamenu-bg);
		transform: rotate(45deg);
		box-shadow: -2px -2px 4px rgba(15, 32, 55, 0.05);
	}

	/* Posicionar caret superior dinámicamente debajo del disparador */
	.alt-mm__menu > li:nth-child(1) .caret-top { left: 8%; }
	.alt-mm__menu > li:nth-child(2) .caret-top { left: 22%; }
	.alt-mm__menu > li:nth-child(3) .caret-top { left: 36%; }
	.alt-mm__menu > li:nth-child(4) .caret-top { left: 50%; }
	.alt-mm__menu > li:nth-child(5) .caret-top { left: 64%; }

	/* Intro Column (1) */
	.alt-mm__intro {
		flex: 0 0 25%;
		max-width: 260px;
	}

	.alt-mm__intro h4 {
		font-size: 20px;
		color: var(--navy);
		margin-bottom: 12px;
	}

	.alt-mm__intro p {
		font-size: 14px;
		color: #5a6b7b;
		line-height: 1.6;
		margin-bottom: 18px;
	}

	.alt-mm__intro-link:hover {
		color: var(--navy);
	}

	.alt-mm__intro-link:hover svg {
		transform: translateX(3px);
	}

	.alt-mm__intro-link svg {
		transition: transform 0.2s;
	}

	/* Links Column (2) */
	.alt-mm__links {
		flex: 1;
		border-top: 0;
		border-left: 1px solid var(--line);
		padding: 0 20px;
		margin: 0;
		display: block;
		column-gap: 20px;
		align-self: center;
	}

	.alt-mm__links.two-col {
		columns: 2;
	}

	.alt-mm__links li {
		break-inside: avoid;
	}

	.alt-mm__links a {
		padding: 10px 8px;
		font-size: 14px;
		color: var(--submenu-txt);
		border-bottom: 1px solid #f1f4f7;
		position: relative;
	}

	.alt-mm__links a::before {
		content: "";
		position: absolute;
		left: -8px;
		top: 0;
		bottom: 0;
		width: 2px;
		background: var(--red);
		transform: scaleY(0);
		transition: transform 0.18s ease;
	}

	.alt-mm__links a:hover {
		color: var(--submenu-txt-hover);
		padding-left: 12px;
	}

	.alt-mm__links a:hover::before {
		transform: scaleY(0.7);
	}

	/* Feature Banner Column (3) */
	.alt-mm__feature {
		display: flex;
		flex: 0 0 34%;
		max-width: 400px;
		border-radius: 6px;
		overflow: hidden;
		min-height: 200px;
		position: relative;
		align-items: flex-end;
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
		/* Gradiente de fallback en caso de que no haya imagen */
		background-image: linear-gradient(135deg, var(--navy), var(--navy-2));
	}

	.alt-mm__feature::after {
		content: "";
		position: absolute;
		inset: 0;
		background: linear-gradient(180deg, rgba(15, 45, 73, 0) 35%, rgba(15, 45, 73, 0.85));
		transition: opacity 0.3s;
	}

	.alt-mm__feature:hover::after {
		background: linear-gradient(180deg, rgba(15, 45, 73, 0.1) 35%, rgba(15, 45, 73, 0.95));
	}

	.alt-mm__feature-cap {
		position: relative;
		z-index: 2;
		color: var(--white);
		padding: 20px;
	}

	.alt-mm__feature-cap span {
		display: inline-block;
		font-size: 10px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.1em;
		color: #ffb3c2;
		margin-bottom: 5px;
	}

	.alt-mm__feature-cap strong {
		display: block;
		font-size: 16px;
		font-weight: 700;
		line-height: 1.35;
	}
}

/* ==========================================================================
   MODAL DE BÚSQUEDA ACCESIBLE (HTML5 <dialog>)
   ========================================================================== */
.alt-mm-search-modal {
	border: none;
	border-radius: 8px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	padding: 24px;
	max-width: 550px;
	width: 90%;
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 10000;
	background: var(--white);
	margin: 0;
}

.alt-mm-search-modal::backdrop {
	background: rgba(15, 45, 73, 0.8);
	backdrop-filter: blur(4px);
}

.alt-mm-search-modal__inner {
	position: relative;
	width: 100%;
}

.alt-mm-search-form {
	display: flex;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
	width: 100%;
}

.alt-mm-search-form label {
	flex: 1;
}

.alt-mm-search-field {
	border: 0;
	padding: 12px 16px;
	font-size: 15px;
	width: 100%;
	outline: none;
	color: var(--ink);
	background: var(--white);
}

.alt-mm-search-submit {
	background: var(--blue);
	border: 0;
	color: var(--white);
	padding: 12px 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.alt-mm-search-submit:hover {
	background: #1c5290;
}

.alt-mm-search-submit svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.alt-mm-search-close {
	position: absolute;
	right: -10px;
	top: -42px;
	background: none;
	border: 0;
	color: var(--white);
	font-size: 32px;
	cursor: pointer;
	line-height: 1;
}

.alt-mm-search-close:hover {
	color: var(--red);
}

/* Ocultar texto invisible del lector de pantalla */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ==========================================================================
   FUNCIONALIDAD STICKY CON POSITION FIXED (ROBUSTA)
   ========================================================================== */

/* Sin animación de entrada. La cabecera se fija justo en el punto en el que
   saldría de pantalla, así que ya está en su sitio: animarla desde arriba
   la desplazaba hasta 111px durante 300 ms. En Safari iOS, que difiere el
   repintado de los elementos fijos durante el scroll por inercia, esa
   animación se congelaba a medias y dejaba la barra superior oculta y la
   barra principal recortada. El marcador de hueco ya hace la transición
   imperceptible sin necesidad de animar nada. */
.alt-mm.alt-mm--is-sticky {
	position: fixed !important;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 99999 !important;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);

	/* Safari iOS difiere el repintado de los elementos fijos mientras dura el
	   gesto de scroll y mientras se pliega la barra de direcciones: la cabecera
	   desaparece o se ve cortada hasta que el scroll se detiene. Promoverla a
	   una capa de composición propia hace que el compositor la mantenga
	   pintada. `will-change` crea bloque contenedor, neutralizado más abajo
	   cuando el menú móvil está abierto. */
	will-change: transform;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Mientras el menú móvil está abierto, la cabecera no puede crear un bloque
   contenedor para elementos fijos (transform/filter/perspective lo provocan).
   Las declaraciones `!important` del autor prevalecen sobre las animaciones CSS,
   así que esto también neutraliza efectos aplicados por el tema o por Elementor. */
.alt-mm.mobile-open {
	animation: none !important;
	transform: none !important;
	filter: none !important;
	perspective: none !important;
	will-change: auto !important;
	backface-visibility: visible !important;
}

/* Marcador que conserva el hueco de la cabecera al pasar a `position: fixed`.
   La altura la calcula el JS; sin él la página salta hacia arriba de golpe. */
.alt-mm__placeholder {
	display: none;
}

.alt-mm__placeholder.is-active {
	display: block;
}

/* Caso A: Ambos Fijos (Top Bar + Megamenú) */
.alt-mm--sticky-both.alt-mm--is-sticky {
	top: 0;
}

/* Caso B: Solo Megamenú Fijo (Barra Superior se desliza fuera).
   `--alt-mm-topbar-h` la mide el JS en cada resize, de modo que funciona con
   cualquier contenido, tipografía o número de líneas de la barra superior. */
.alt-mm--sticky-menu-only.alt-mm--is-sticky {
	top: calc(var(--alt-mm-topbar-h, 45px) * -1);
}

/* Caso C: Solo Barra Superior Fija (Megamenú principal se oculta en scroll) */
.alt-mm--sticky-topbar-only.alt-mm--is-sticky {
	top: 0;
}

/* Ocultar el menú principal al hacer scroll si solo la topbar es sticky.
   Solo en escritorio: en móvil la barra principal contiene el botón
   hamburguesa, único acceso a la navegación, y colapsarla dejaría al usuario
   sin menú durante todo el scroll. */
@media (min-width: 1025px) {
	.alt-mm--sticky-topbar-only.alt-mm--is-sticky .alt-mm__main {
		max-height: 0 !important;
		min-height: 0 !important;
		overflow: hidden !important;
		opacity: 0 !important;
		padding: 0 !important;
		border: 0 !important;
	}

	/* Transición suave para colapsar barra principal en caso C */
	.alt-mm--sticky-topbar-only .alt-mm__main {
		transition: max-height 0.3s ease, opacity 0.25s ease;
		max-height: 100px;
		opacity: 1;
	}
}



