/* =========================================================
   Academia EBAB — Header
   Diseño idéntico a Figma (nodes 19:123 desktop / 19:126 mobile)
   Mobile-first; desktop a partir de 1025px.
   ========================================================= */

.aebab-header,
.aebab-header * {
	box-sizing: border-box;
}

.aebab-header {
	font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	width: 100%;
	line-height: 1.2;
	position: relative;
}

/* ---------- Top bar ---------- */
.aebab-topbar {
	background: #0d50c1;
	color: #fffbeb;
}

/* Espaciador que reserva el alto de la barra principal cuando se vuelve fija */
.aebab-header__spacer {
	display: none;
}

/* La barra principal: animación suave de sombra */
.aebab-main {
	transition: box-shadow 0.3s ease;
}

/* Al hacer scroll: la barra superior se va y la principal queda FIJA arriba */
.aebab-header.aebab--stuck .aebab-main {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
	animation: aebab-drop-in 0.22s ease-out;
}

@keyframes aebab-drop-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.aebab-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 7px 16px;
	max-width: 1440px;
	margin: 0 auto;
}

.aebab-topbar__item {
	display: inline-flex;
	align-items: center;
	font-size: 14px;
	font-weight: 500;
	color: #fffbeb;
}

.aebab-topbar__item a {
	color: #fffbeb;
	text-decoration: none;
}

.aebab-topbar__icon {
	display: inline-flex;
	align-items: center;
	color: #f9bb1c;
	margin-right: 5px;
}

.aebab-topbar__icon svg {
	display: block;
}

/* En mobile solo se muestra la promo, centrada */
.aebab-topbar__address,
.aebab-topbar__phone {
	display: none;
}

/* ---------- Header principal ---------- */
.aebab-main {
	background: #13161c;
}

.aebab-main__inner {
	display: flex;
	align-items: center;
	min-height: 60px;
	padding: 7px 16px;
	max-width: 1440px;
	margin: 0 auto;
	gap: 12px;
}

.aebab-logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
}

.aebab-logo img {
	height: 46px;
	width: auto;
	display: block;
}

/* ---------- Buscador (FiboSearch) ---------- */
.aebab-search {
	flex: 1 1 auto;
	min-width: 0;
	display: none; /* oculto en mobile hasta abrir */
}

/* Botón cerrar (X) del overlay de búsqueda: oculto por defecto */
.aebab-header .aebab-search-close {
	display: none;
	flex: 0 0 auto;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	color: #ffffff !important;
	cursor: pointer;
	padding: 8px;
	margin-left: 4px;
	min-width: 0;
	width: auto;
	height: auto;
}

/* Neutraliza el estilo de botón del tema (gana por especificidad con el id) */
#aebab-search .aebab-search-close,
#aebab-search .aebab-search-close:hover,
#aebab-search .aebab-search-close:focus,
#aebab-search .aebab-search-close:active {
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
}

.aebab-header .aebab-search-close:hover {
	opacity: 0.8;
}

/* ===== Overlay de búsqueda en MOBILE: cubre TODO el header ===== */
@media (max-width: 1024px) {
	/* Ancla el overlay sobre la barra principal */
	.aebab-main {
		position: relative;
	}

	/* Barra principal más compacta en mobile */
	.aebab-main__inner {
		min-height: 56px;
		gap: 6px;
	}

	.aebab-logo img {
		height: 40px;
	}

	/* Iconos (lupa / hamburguesa) más pequeños */
	.aebab-icon-btn {
		padding: 6px;
	}

	.aebab-search-toggle svg {
		width: 20px;
		height: 20px;
	}

	.aebab-search-toggle::after {
		height: 20px;
		margin-left: 8px;
	}

	.aebab-menu-toggle {
		width: 34px;
		height: 34px;
		gap: 4px;
	}

	.aebab-menu-toggle span {
		width: 20px;
	}

	/* Input del overlay: alto estricto 40px en mobile */
	.aebab-header.aebab--search-open .aebab-search .dgwt-wcas-sf-wrapp {
		height: 40px !important;
		box-sizing: border-box !important;
		border-radius: 8px !important;
	}

	.aebab-header.aebab--search-open .aebab-search .dgwt-wcas-search-input[type="search"],
	.aebab-header.aebab--search-open .aebab-search input.dgwt-wcas-search-input {
		height: 38px !important;
		line-height: 38px !important;
		border-radius: 8px !important;
		font-size: 14px !important;
	}

	.aebab-header.aebab--search-open .aebab-search .dgwt-wcas-search-input[type="search"],
	.aebab-header.aebab--search-open .aebab-search input.dgwt-wcas-search-input {
		padding: 0 12px 0 40px !important;
	}

	/* Botón cerrar (X) compacto */
	#aebab-search .aebab-search-close {
		padding: 6px;
	}

	.aebab-search-close svg {
		width: 20px;
		height: 20px;
	}

	/* Al abrir: oculta logo y lupa; la hamburguesa SIGUE visible */
	.aebab-header.aebab--search-open .aebab-logo,
	.aebab-header.aebab--search-open .aebab-search-toggle {
		display: none !important;
	}

	/* El buscador ocupa el espacio del logo/lupa (la hamburguesa queda a la derecha) */
	.aebab-header.aebab--search-open .aebab-search {
		display: flex;
		align-items: center;
		gap: 6px;
		flex: 1 1 auto;
		min-width: 0;
		margin: 0;
		animation: aebab-search-reveal 0.32s cubic-bezier( 0.22, 1, 0.36, 1 );
	}

	.aebab-header.aebab--search-open .aebab-search .dgwt-wcas-search-wrapp {
		flex: 1 1 auto;
	}

	.aebab-header.aebab--search-open .aebab-search-close {
		display: flex;
	}

	/* Separador de la hamburguesa: cuando el search está abierto lo da el close */
	.aebab-header.aebab--search-open .aebab-menu-toggle {
		margin-left: 2px;
	}
}

@keyframes aebab-search-reveal {
	from {
		clip-path: inset( 0 0 0 100% );
		opacity: 0.4;
	}
	to {
		clip-path: inset( 0 0 0 0 );
		opacity: 1;
	}
}

/* Contenedores: transparentes, sin bordes ni sombras (eliminan líneas blancas) */
.aebab-search .dgwt-wcas-search-wrapp,
.aebab-search .dgwt-wcas-search-form {
	width: 100%;
	max-width: 100%;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Caja contenedora: NEGRO puro, borde 1px #2d323a, radio 8px, alto 42px (Figma) */
.aebab-search .dgwt-wcas-sf-wrapp {
	position: relative;
	background: #000000 !important;
	border: 1px solid #2d323a !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	overflow: hidden;
	height: 42px !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	display: flex !important;
	align-items: center !important;
}

.aebab-search .dgwt-wcas-search-input[type="search"],
.aebab-search input.dgwt-wcas-search-input {
	height: 40px !important;
	flex: 1 1 auto !important;
	width: 100% !important;
	background: transparent !important;
	border: none !important;
	border-radius: 8px !important;
	color: #ffffff !important;
	font-family: inherit;
	font-size: 13.6px;
	font-weight: 500;
	line-height: 40px !important;
	padding: 0 12px 0 48px !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.aebab-search .dgwt-wcas-search-input::placeholder {
	color: #c4c8ce !important;
	opacity: 1;
}

/* Botón submit (lupa): transparente, sin línea separadora */
.aebab-search .dgwt-wcas-search-submit,
.aebab-search button.dgwt-wcas-search-submit,
.aebab-search .dgwt-wcas-search-submit:hover,
.aebab-search .dgwt-wcas-search-submit:focus {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Quitar separadores/líneas claras del botón, preloader y voice-search */
.aebab-search .dgwt-wcas-search-submit::before,
.aebab-search .dgwt-wcas-search-submit::after,
.aebab-search .dgwt-wcas-preloader,
.aebab-search .dgwt-wcas-voice-search,
.aebab-search .dgwt-wcas-voice-search::before,
.aebab-search .dgwt-wcas-voice-search::after {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

/* Icono lupa: pegado a la izquierda, separado del texto (Figma) */
.aebab-search .dgwt-wcas-search-submit {
	width: auto !important;
	opacity: 1 !important;
	left: 0 !important;
	right: auto !important;
	top: 0 !important;
	bottom: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 0 0 16px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
}

.aebab-search .dgwt-wcas-ico-magnifier {
	fill: #becde3 !important;
	color: #becde3 !important;
	width: 16px !important;
	height: 16px !important;
	opacity: 1;
	left: 0 !important;
	margin-left: 14px !important;
}

/* El path interno del icono tiene fill oscuro propio de FiboSearch: forzarlo a #becde3 (Figma) */
.aebab-search .dgwt-wcas-ico-magnifier path,
.aebab-search .dgwt-wcas-ico-magnifier circle,
.aebab-search .dgwt-wcas-ico-magnifier line {
	fill: #becde3 !important;
	stroke: none !important;
}

.aebab-search .dgwt-wcas-sf-wrapp:focus-within .dgwt-wcas-ico-magnifier {
	fill: #5b8def !important;
}

/* Botón limpiar (x) oscuro */
.aebab-search .dgwt-wcas-search-icon-arrow,
.aebab-search .dgwt-wcas-close {
	background: transparent !important;
	border: none !important;
	color: #becde3 !important;
}

/* ---------- Navegación ---------- */
.aebab-nav {
	display: none; /* oculto en mobile */
	flex: 0 0 auto;
}

/* Botón cerrar del drawer: solo visible dentro del drawer móvil */
.aebab-nav-close {
	display: none;
}

/* Backdrop: nunca en desktop */
.aebab-nav-backdrop {
	display: none;
}

.aebab-nav__list {
	display: flex;
	align-items: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.aebab-nav__list li {
	margin: 0;
}

.aebab-nav__list a {
	display: block;
	padding: 12px;
	color: #ffffff;
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 500;
	white-space: nowrap;
	transition: opacity 0.15s ease;
}

.aebab-nav__list a:hover {
	color: #0d50c1;
	opacity: 1;
}

/* ---------- Botones de icono (mobile) ---------- */
.aebab-header .aebab-icon-btn,
.aebab-header .aebab-icon-btn:hover,
.aebab-header .aebab-icon-btn:focus,
.aebab-header .aebab-icon-btn:active {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	color: #ffffff !important;
	cursor: pointer;
	padding: 8px;
	flex: 0 0 auto;
}

.aebab-search-toggle {
	margin-left: auto;
}

/* Hamburguesa */
.aebab-menu-toggle {
	position: relative;
	width: 40px;
	height: 40px;
	flex-direction: column;
	gap: 5px;
}

.aebab-menu-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: #ffffff;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.aebab-header.aebab--menu-open .aebab-menu-toggle span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.aebab-header.aebab--menu-open .aebab-menu-toggle span:nth-child(2) {
	opacity: 0;
}
.aebab-header.aebab--menu-open .aebab-menu-toggle span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Separador entre lupa y hamburguesa (como en Figma) */
.aebab-search-toggle::after {
	content: "";
	display: block;
	width: 1px;
	height: 24px;
	background: rgba(255, 255, 255, 0.25);
	margin-left: 12px;
}

/* ===== Menú móvil: drawer deslizante desde la derecha ===== */
@media (max-width: 1024px) {
	/* Backdrop oscuro */
	.aebab-nav-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(8, 10, 14, 0.55);
		backdrop-filter: blur(2px);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s ease;
		z-index: 9998;
	}

	.aebab-header.aebab--menu-open .aebab-nav-backdrop {
		opacity: 1;
		visibility: visible;
	}

	/* Panel del menú: fijo a la derecha, fuera de pantalla por defecto */
	.aebab-nav {
		display: block;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(82vw, 320px);
		background: #13161c;
		box-shadow: -16px 0 40px rgba(0, 0, 0, 0.45);
		padding: 72px 20px 28px;
		transform: translateX(100%);
		transition: transform 0.34s cubic-bezier( 0.22, 1, 0.36, 1 );
		z-index: 9999;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.aebab-header.aebab--menu-open .aebab-nav {
		transform: translateX(0);
	}

	/* Botón cerrar (X) dentro del drawer */
	.aebab-nav-close {
		position: absolute;
		top: 16px;
		right: 16px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		color: #ffffff !important;
		cursor: pointer;
	}

	.aebab-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.aebab-nav__list a {
		padding: 16px 6px;
		font-size: 15px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.08);
		transition: color 0.18s ease, padding-left 0.18s ease;
	}

	.aebab-nav__list a:hover,
	.aebab-nav__list a:active {
		color: #0d50c1;
		padding-left: 12px;
	}
}

/* =========================================================
   DESKTOP ≥ 1025px
   ========================================================= */
@media (min-width: 1025px) {
	.aebab-topbar__inner {
		justify-content: space-between;
		min-height: 30px;
		padding: 7px 48px;
	}

	.aebab-topbar__item {
		font-size: 15px;
	}

	.aebab-topbar__address,
	.aebab-topbar__phone {
		display: inline-flex;
	}

	.aebab-main__inner {
		min-height: 80px;
		padding: 8px 48px;
		gap: 24px;
	}

	.aebab-logo img {
		height: 64px;
	}

	.aebab-search {
		display: block;
		max-width: 520px;
		margin: 0 12px;
		transition: max-width 0.35s ease;
	}

	/* Al hacer scroll el buscador se agranda */
	.aebab-header.aebab--stuck .aebab-search {
		max-width: 720px;
	}

	.aebab-nav {
		display: block;
		margin-left: auto;
	}

	/* Ocultar controles mobile en desktop (gana al estilo base de .aebab-icon-btn) */
	.aebab-header .aebab-search-toggle,
	.aebab-header .aebab-menu-toggle {
		display: none !important;
	}
}
