/**
 * Barra cromática de Empowerdraw.
 *
 * El color de cada sección llega como variable en línea desde el walker
 * (--edm-fondo y --edm-texto), así que aquí no hay ningún hex de sección:
 * cambiar un color se hace en Apariencia → Menús, no tocando este archivo.
 */

.edm-barra {
	--edm-navy: #0f162a;
	--edm-alto: 56px;

	position: var( --edm-posicion, sticky );
	top: 0;
	z-index: 9999;

	/* Flex y no grid: la barra tiene tres hijos —usuario, hamburguesa y
	   panel— y con dos columnas de retícula el tercero se iba a una segunda
	   fila. Con flex da igual cuántos haya y cuáles estén ocultos. */
	display: flex;
	align-items: stretch;
	width: 100%;
	background: var( --edm-navy );
	font-family: "Red Hat Display", -apple-system, "Segoe UI", sans-serif;
}

/* ---------- celda del logo ---------- */

.edm-logo {
	flex: 0 0 auto;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	min-height: var( --edm-alto );
	padding: 0.35rem 1rem;
	background: var( --edm-navy );
	color: #fff;
	text-decoration: none;
}

.edm-logo:hover,
.edm-logo:focus-visible {
	filter: brightness( 1.25 );
	color: #fff;
}

/* El alto manda y el ancho se ajusta solo: así un logo apaisado y uno casi
   cuadrado ocupan lo mismo de alto y la barra no cambia de altura.
   26 sobre los 56 de la barra es algo menos de la mitad: deja aire arriba y
   abajo, que es lo que hace que el logo se lea como marca y no como un banner
   metido a presión. */
.edm-logo__img {
	display: block;
	width: auto;
	height: var( --edm-logo-alto, 26px );
	max-width: 180px;
	object-fit: contain;
}

/* Lo que se ve mientras no haya logo cargado en el Personalizador. */
.edm-logo__texto {
	font-size: 1rem;
	font-weight: 700;
	white-space: nowrap;
}

/* ---------- celda de usuario ---------- */

.edm-usuario {
	flex: 0 0 auto;
	min-width: 180px;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-height: var( --edm-alto );
	padding: 0.35rem 0.9rem;
	background: var( --edm-fondo );
	color: var( --edm-texto );
	font-size: 0.9375rem;
	text-decoration: none;
	line-height: 1.2;
}

.edm-usuario:hover,
.edm-usuario:focus-visible {
	filter: brightness( 1.06 );
	color: var( --edm-texto );
}

.edm-usuario .edm-avatar {
	width: 30px;
	height: 30px;
	border-radius: 999px;
	flex: 0 0 auto;
}

/* ---------- la lista ---------- */

.edm-panel {
	flex: 1 1 auto;
	min-width: 0;
}

.edm-lista {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	margin: 0;
	padding: 0;
	list-style: none;
	height: 100%;
}

.edm-item--raiz {
	position: relative;
	display: flex;
	align-items: stretch;
	background: var( --edm-fondo, var( --edm-navy ) );
}

.edm-enlace {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: var( --edm-alto );
	padding: 0.4rem 0.6rem;
	color: var( --edm-texto, #fff );
	font-size: 0.9375rem;
	text-align: center;
	text-decoration: none;
	line-height: 1.15;
	transition: filter 0.15s ease;
}

.edm-item--raiz:hover,
.edm-item--raiz:focus-within,
.edm-item--raiz.edm-activo {
	filter: brightness( 1.13 );
}

.edm-enlace:hover,
.edm-enlace:focus-visible {
	color: var( --edm-texto, #fff );
}

/* El botón del desplegable solo se ve donde hace falta: en móvil y con
   teclado. En escritorio basta el hover, y el triángulo ensucia la barra. */
.edm-barra .edm-abrir {
	/* Elementor pinta un borde rosa en los botones; se anula aquí con un
	   selector que le gane en especificidad. */
	border: 0;
	background: none;
	position: absolute;
	right: 0.35rem;
	top: 50%;
	transform: translateY( -50% );
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	background: none;
	color: var( --edm-texto, #fff );
	font-size: 0.75rem;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
}

.edm-barra .edm-abrir:focus-visible {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- submenús ---------- */

.edm-sub {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	display: none;
}

.edm-item--raiz:hover > .edm-sub,
.edm-item--raiz:focus-within > .edm-sub,
.edm-item--raiz.edm-abierto > .edm-sub {
	display: block;
}

.edm-sub .edm-enlace {
	justify-content: flex-start;
	min-height: 0;
	padding: 0.6rem 1.25rem;
	background: var( --edm-fondo, var( --edm-navy ) );
	border-top: 1px solid rgba( 255, 255, 255, 0.32 );
	white-space: nowrap;
	text-align: left;
}

.edm-sub .edm-item:hover .edm-enlace,
.edm-sub .edm-enlace:focus-visible {
	filter: brightness( 1.13 );
}

/* ---------- hamburguesa ---------- */

.edm-barra .edm-hamburguesa {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex-direction: column;
	min-height: var( --edm-alto );
	padding: 0 1rem;
	border: 0;
	background: var( --edm-navy );
	cursor: pointer;
}

.edm-hamburguesa span {
	display: block;
	width: 22px;
	height: 2px;
	background: #fff;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.edm-hamburguesa[aria-expanded="true"] span:nth-child( 1 ) {
	transform: translateY( 6px ) rotate( 45deg );
}

.edm-hamburguesa[aria-expanded="true"] span:nth-child( 2 ) {
	opacity: 0;
}

.edm-hamburguesa[aria-expanded="true"] span:nth-child( 3 ) {
	transform: translateY( -6px ) rotate( -45deg );
}

/* ---------- móvil ---------- */

@media ( max-width: 1024px ) {
	.edm-barra {
		flex-wrap: wrap;
		position: static;
	}

	.edm-barra .edm-hamburguesa {
		display: flex;
	}

	/* En el marcado la cuenta va la última, detrás del panel. En escritorio eso
	   la deja a la derecha, que es donde se quiere; en móvil el panel ocupa una
	   fila entera, así que sin esto la cuenta caería a una tercera fila ella
	   sola. Con order vuelve a la primera, junto al logo y la hamburguesa. */
	.edm-logo        { order: 1; }
	.edm-usuario     { order: 2; }
	.edm-hamburguesa { order: 3; }
	.edm-panel       { order: 4; }

	.edm-usuario {
		flex: 1 1 auto;
		min-width: 0;
	}

	/* En el teléfono comparten fila logo, usuario y hamburguesa: el logo
	   encoge un poco y el nombre de reserva se recorta antes que empujar la
	   hamburguesa fuera de la pantalla. */
	.edm-logo {
		padding-inline: 0.75rem;
	}

	.edm-logo__img {
		height: var( --edm-logo-alto-movil, 22px );
		max-width: 110px;
	}

	.edm-logo__texto {
		display: block;
		max-width: 40vw;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: 0.9375rem;
	}

	.edm-panel {
		display: none;
		flex-basis: 100%;
	}

	.edm-panel.edm-visible {
		display: block;
	}

	.edm-lista {
		grid-auto-flow: row;
		grid-auto-columns: auto;
	}

	.edm-item--raiz {
		flex-wrap: wrap;
	}

	.edm-enlace {
		justify-content: flex-start;
		padding-left: 1rem;
		text-align: left;
	}

	/* En táctil el hover no existe: el botón es la única forma de abrir el
	   submenú, así que aquí sí se ve siempre. */
	.edm-barra .edm-abrir {
		position: static;
		transform: none;
		width: 46px;
		height: auto;
		align-self: stretch;
		opacity: 1;
		pointer-events: auto;
		font-size: 1rem;
	}

	.edm-sub {
		position: static;
		width: 100%;
		flex-basis: 100%;
	}

	.edm-sub .edm-enlace {
		padding-left: 2rem;
	}
}

/* ---------- accesibilidad ---------- */

.edm-barra :focus-visible {
	outline: 3px solid #fff;
	outline-offset: -4px;
}

@media ( prefers-reduced-motion: reduce ) {
	.edm-barra *,
	.edm-hamburguesa span {
		transition: none !important;
	}
}

@media print {
	.edm-barra {
		display: none;
	}
}
