/*
 * Native header (replaces Elementor document #63). Values below are the
 * computed styles measured against production (educacion.euroinnova.com,
 * page /cursos which uses this header) at 1600px and 390px, not read off a
 * single static CSS rule — Elementor emits per-widget inline overrides that
 * only show up in getComputedStyle.
 *
 * Breakpoint: Elementor's own "hidden-mobile"/"hidden-tablet" utility
 * classes on document #63 hide the desktop variant below 1025px, so the
 * mobile/tablet variant here is the base (mobile-first) and 1025px is the
 * single switch-over point to the desktop variant.
 */

.cabecera {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 5000;
	background-color: #ffffff;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	padding: 0 10px;
	box-sizing: border-box;
}

.cabecera__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	padding: 10px 0;
	max-width: 100%;
	margin: 0 auto;
	position: relative;
}

.cabecera__logo {
	display: block;
	line-height: 0;
}

.cabecera__logo img {
	width: 117px;
	height: 34px;
	display: block;
}

/* Burger toggle — mobile/tablet only */
.cabecera__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #202020;
	color: #ffffff;
	border: 0;
	border-radius: 3px;
	padding: 5.5px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
}

.cabecera__toggle svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
	display: block;
}

.cabecera__toggle .cabecera__icono-cerrar {
	display: none;
}

.cabecera__toggle[aria-expanded="true"] .cabecera__icono-abrir {
	display: none;
}

.cabecera__toggle[aria-expanded="true"] .cabecera__icono-cerrar {
	display: block;
}

/* CTA buttons — two elements (desktop/mobile) kept on purpose: Popup Maker's
   click-trigger is configured against two distinct selectors
   (.modal-desk-cursos / .modal-mobile-cursos); merging them into one link
   would fire both popups on a single click. */
.cabecera__cta {
	display: inline-block;
	background-color: #fabb00;
	color: #ffffff;
	font-family: Roboto, sans-serif;
	font-weight: 500;
	border-radius: 3px;
	text-decoration: none;
	text-align: center;
	white-space: nowrap;
	flex-shrink: 0;
	cursor: pointer;
}

.cabecera__cta:hover,
.cabecera__cta:focus {
	background-color: #e32652;
	color: #ffffff;
}

.cabecera__cta--movil {
	font-size: 18px;
	padding: 9px 18px;
}

.cabecera__cta--escritorio {
	display: none;
}

/* Menus share the same markup (wp_nav_menu core classes: menu-item,
   menu-item-has-children, current-menu-item, sub-menu) for both variants;
   only presentation differs per breakpoint. */
.cabecera__menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cabecera__submenu-toggle {
	background: none;
	border: 0;
	padding: 0.5em;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cabecera__flecha {
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	display: block;
	transition: transform 0.2s ease;
}

.menu-item-has-children.is-open > .cabecera__submenu-toggle .cabecera__flecha {
	transform: rotate(180deg);
}

/* Desktop nav/menu is hidden below 1025px; only the mobile flyout nav is used */
.cabecera__nav--escritorio {
	display: none;
}

.cabecera__nav--movil {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background-color: #ffffff;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.cabecera__nav--movil.is-open {
	max-height: 80vh;
	overflow-y: auto;
}

.cabecera__nav--movil .menu-item {
	border-bottom: 0.8px solid #eceded;
	position: relative;
}

.cabecera__nav--movil .menu-item > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: #202020;
	font-family: Lato, sans-serif;
	font-size: 18px;
	font-weight: 400;
	padding: 16px 20px;
	text-decoration: none;
}

.cabecera__nav--movil .current-menu-item > a {
	background-color: #b0263e;
	color: #ffffff;
}

.cabecera__nav--movil .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
	background-color: #f7f7f8;
}

.cabecera__nav--movil .menu-item-has-children.is-open > .sub-menu {
	max-height: 500px;
}

.cabecera__nav--movil .sub-menu a {
	display: block;
	padding: 13px 20px 13px 40px;
	font-family: Ubuntu, sans-serif;
	font-size: 16px;
	color: #33373d;
	text-decoration: none;
}

@media (min-width: 1025px) {
	.cabecera__inner {
		max-width: 90%;
		justify-content: space-between;
		gap: 20px;
	}

	.cabecera__logo img {
		width: 195px;
		height: 57px;
	}

	.cabecera__toggle,
	.cabecera__cta--movil,
	.cabecera__nav--movil {
		display: none;
	}

	.cabecera__cta--escritorio {
		display: inline-block;
		font-size: 18px;
		padding: 10px 40px;
	}

	.cabecera__nav--escritorio {
		display: block;
	}

	.cabecera__nav--escritorio .cabecera__menu {
		display: flex;
		align-items: center;
	}

	.cabecera__nav--escritorio .menu-item {
		position: relative;
		display: flex;
		align-items: center;
	}

	.cabecera__nav--escritorio .menu-item > a {
		font-family: Ubuntu, sans-serif;
		font-size: 21px;
		font-weight: 500;
		line-height: 20px;
		color: #202020;
		padding: 13px 20px;
		text-decoration: none;
		position: relative;
	}

	/* Underline pointer on hover/current — matches Elementor's
	   e--pointer-underline skin (::after, 3px, full width, bottom:0). */
	.cabecera__nav--escritorio .menu-item > a::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
		height: 3px;
		background-color: #3f444b;
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	.cabecera__nav--escritorio .menu-item > a:hover::after,
	.cabecera__nav--escritorio .menu-item.current-menu-item > a::after {
		opacity: 1;
	}

	.cabecera__nav--escritorio .cabecera__submenu-toggle {
		color: #202020;
		padding: 0 8px 0 0;
	}

	.cabecera__nav--escritorio .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		min-width: 180px;
		background-color: #ffffff;
		list-style: none;
		margin: 0;
		padding: 0;
		z-index: 9999;
		display: none;
	}

	.cabecera__nav--escritorio .menu-item:hover > .sub-menu,
	.cabecera__nav--escritorio .menu-item:focus-within > .sub-menu,
	.cabecera__nav--escritorio .menu-item.is-open > .sub-menu {
		display: block;
	}

	.cabecera__nav--escritorio .sub-menu a {
		display: block;
		white-space: nowrap;
		font-family: Ubuntu, sans-serif;
		font-size: 16px;
		color: #33373d;
		padding: 13px 20px;
		text-decoration: none;
	}

	.cabecera__nav--escritorio .sub-menu a:hover {
		background-color: #3f444b;
		color: #ffffff;
	}
}
