/* Vidas – Header
 * Design system (Figma): «Nav» en escritorio, «Nav móvil» + «Menú móvil» en tablet y móvil.
 * Escritorio: cápsula blanca con borde fino; enlaces centrados; idioma + botón a la derecha.
 * ≤1024px: barra y menú de cristal (glassmorphism) que desenfocan la página real de debajo.
 */
.vidas-header {
	--vh-black: var(--vp-black, #000000);
	--vh-white: var(--vp-white, #FFFFFF);
	--vh-violet: var(--vp-violet, #4E20E4);
	--vh-grey: var(--vp-grey-500, #6F6F6F);
	--vh-line: var(--vp-grey-100, #D9D9D9);
	--vh-cyan: var(--vp-cyan-soft, #AAEDFF);
	--vh-lavender: var(--vp-lavender, #A9A0FD);
	--vh-top: 20px;
	--vh-bar-h: 81px;
	font-family: "Soleil", sans-serif;
}
.admin-bar .vidas-header { --vh-top: 52px; }

/* ---------- Barra (escritorio) ---------- */
.vidas-header .vh-bar {
	position: fixed;
	z-index: 1000;
	top: var(--vh-top);
	left: 50%;
	transform: translateX(-50%);
	width: min(1392px, calc(100% - 120px));
	min-height: var(--vh-bar-h);
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 20px;
	padding: 12px 12px 12px 28px;
	background: rgba(255, 255, 255, 0.86);
	-webkit-backdrop-filter: blur(20px) saturate(160%);
	backdrop-filter: blur(20px) saturate(160%);
	border: 1px solid var(--vh-line);
	border-radius: 999px;
}

.vidas-header .vh-logo { justify-self: start; display: flex; line-height: 0; text-decoration: none; color: var(--vh-black); }
.vidas-header .vh-logo img { display: block; width: auto; height: 19px; max-width: none; }

.vidas-header .vh-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 36px;
}
.vidas-header .vh-list li { margin: 0; padding: 0; }
.vidas-header .vh-link {
	display: block;
	font-size: 18px;
	line-height: 1.5;
	font-weight: 300;
	letter-spacing: -0.5px;
	color: var(--vh-black);
	text-decoration: none;
	white-space: nowrap;
}
.vidas-header .vh-link:hover,
.vidas-header .vh-link:focus-visible {
	color: var(--vh-black);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}
.vidas-header .vh-link.is-active,
.vidas-header .vh-link.is-active:hover { font-weight: 600; color: var(--vh-violet); }

.vidas-header .vh-actions { justify-self: end; display: flex; align-items: center; gap: 20px; }
.vidas-header .vh-sep { display: block; width: 1px; height: 20px; background: var(--vh-line); }

.vidas-header .vh-cta,
.vidas-header .vh-cta:visited {
	display: inline-flex;
	align-items: center;
	padding: 14px 26px;
	border-radius: 999px;
	background: var(--vh-black);
	color: var(--vh-white);
	font-size: 18px;
	line-height: 27px;
	font-weight: 600;
	letter-spacing: -0.5px;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.25s ease;
}
.vidas-header .vh-cta:hover,
.vidas-header .vh-cta:focus-visible { background: var(--vh-violet); color: var(--vh-white); }

/* Selector de idioma (shortcode de PrimeLingo) con el estilo del sistema. */
.vidas-header .vh-lang { display: flex; align-items: center; }
.vidas-header .vh-lang .primelingo-switcher {
	position: static !important;
	inset: auto !important;
	transform: none !important;
	z-index: auto !important;
	display: flex !important;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}
.vidas-header .vh-lang .primelingo-lang,
.vidas-header .vh-lang .primelingo-sep {
	font-family: "Soleil", sans-serif !important;
	font-size: 18px !important;
	line-height: 1.5 !important;
	font-weight: 300 !important;
	letter-spacing: -0.5px;
	color: var(--vh-grey) !important;
	background: none !important;
	padding: 0 !important;
	margin: 0 !important;
	text-decoration: none !important;
}
.vidas-header .vh-lang .primelingo-lang:hover { color: var(--vh-black) !important; }
.vidas-header .vh-lang .primelingo-lang.is-active { font-weight: 600 !important; color: var(--vh-black) !important; }

/* Botón de menú: solo en tablet y móvil. */
.vidas-header button.vh-burger,
.vidas-header button.vh-burger:hover,
.vidas-header button.vh-burger:focus,
.vidas-header button.vh-burger:active {
	display: none;
	position: relative;
	width: 25px;
	height: 19px;
	min-width: 25px;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--vh-black) !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
.vidas-header button.vh-burger:focus-visible { outline: 2px solid var(--vh-black) !important; outline-offset: 6px; }
.vidas-header .vh-burger span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 1px;
	background: var(--vh-black);
	transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.25s ease;
}
.vidas-header .vh-burger span:nth-child(1) { top: 0; }
.vidas-header .vh-burger span:nth-child(2) { top: 9px; }
.vidas-header .vh-burger span:nth-child(3) { top: 18px; }
.vidas-header.is-open .vh-burger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.vidas-header.is-open .vh-burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.vidas-header.is-open .vh-burger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.vidas-header .vh-overlay { display: none; }

/* ---------- Tablet y móvil: cristal ---------- */
@media (max-width: 1024px) {
	.vidas-header { --vh-bar-h: 65px; }

	.vidas-header .vh-bar {
		z-index: 1001;
		width: calc(100% - 40px);
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 20px;
		border-radius: 50px;
		background:
			linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.18) 100%);
		-webkit-backdrop-filter: blur(18px) saturate(180%);
		backdrop-filter: blur(18px) saturate(180%);
		border: 1px solid rgba(255, 255, 255, 0.7);
		box-shadow:
			0 0 20px rgba(0, 0, 0, 0.08),
			inset 0 1px 0 rgba(255, 255, 255, 0.9),
			inset 0 -1px 0 rgba(255, 255, 255, 0.25);
	}
	.vidas-header .vh-logo { flex: 0 1 auto; min-width: 0; align-items: center; }
	.vidas-header .vh-logo img { height: 23px; }
	.vidas-header .vh-actions { flex: 0 0 auto; gap: 30px; }
	.vidas-header .vh-lang,
	.vidas-header .vh-lang .primelingo-switcher,
	.vidas-header button.vh-burger { align-self: center; }
	.vidas-header .vh-nav,
	.vidas-header .vh-sep,
	.vidas-header .vh-cta { display: none !important; }
	.vidas-header .vh-actions { gap: 20px; }
	.vidas-header .vh-lang .primelingo-lang,
	.vidas-header .vh-lang .primelingo-sep { font-size: 15px !important; }
	.vidas-header button.vh-burger,
	.vidas-header button.vh-burger:hover,
	.vidas-header button.vh-burger:focus,
	.vidas-header button.vh-burger:active { display: block; }

	/* Menú abierto: capa a pantalla completa de cristal sobre la página. */
	.vidas-header .vh-overlay {
		display: flex;
		position: fixed;
		inset: 0;
		z-index: 1000;
		flex-direction: column;
		justify-content: flex-end;
		box-sizing: border-box;
		padding: calc(var(--vh-top) + var(--vh-bar-h) + 40px) 40px max(40px, env(safe-area-inset-bottom)) 40px;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		background:
			linear-gradient(160deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.12) 55%, rgba(255, 255, 255, 0.28) 100%);
		-webkit-backdrop-filter: blur(34px) saturate(180%);
		backdrop-filter: blur(34px) saturate(180%);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.45s ease, visibility 0s linear 0.45s;
	}
	/* Luces de color dentro del cristal (orbes de la marca). */
	.vidas-header .vh-overlay::before,
	.vidas-header .vh-overlay::after {
		content: "";
		position: absolute;
		z-index: -1;
		border-radius: 50%;
		pointer-events: none;
		filter: blur(70px);
		opacity: 0;
		transition: opacity 0.8s ease, transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
	}
	.vidas-header .vh-overlay::before {
		width: 90vw;
		height: 90vw;
		left: -30vw;
		top: 30%;
		background: var(--vh-cyan);
		transform: translateY(40px) scale(0.9);
	}
	.vidas-header .vh-overlay::after {
		width: 70vw;
		height: 70vw;
		right: -20vw;
		bottom: -10vw;
		background: var(--vh-violet);
		transform: translateY(60px) scale(0.9);
	}
	.vidas-header.is-open .vh-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.45s ease;
	}
	.vidas-header.is-open .vh-overlay::before { opacity: 0.55; transform: none; }
	.vidas-header.is-open .vh-overlay::after { opacity: 0.38; transform: none; }

	.vidas-header .vh-mlist { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
	.vidas-header .vh-mlist li { margin: 0; padding: 0; }
	.vidas-header .vh-mlink,
	.vidas-header .vh-mlink:visited {
		display: inline-block;
		font-size: min(60px, 15vw, 8.4svh);
		line-height: 1;
		font-weight: 600;
		letter-spacing: -0.5px;
		color: var(--vh-black);
		text-decoration: none;
		opacity: 0;
		transform: translateY(28px);
		transition:
			transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) calc(var(--i, 0) * 50ms + 120ms),
			opacity 0.4s ease calc(var(--i, 0) * 50ms + 120ms);
	}
	.vidas-header .vh-mlink.is-active { color: var(--vh-violet); }
	.vidas-header .vh-mlink:focus-visible { outline: 2px solid var(--vh-black); outline-offset: 4px; }
	.vidas-header.is-open .vh-mlink { opacity: 1; transform: none; }
}

/* Tablet: los enlaces del menú crecen un poco. */
@media (min-width: 768px) and (max-width: 1024px) {
	.vidas-header .vh-mlink,
	.vidas-header .vh-mlink:visited { font-size: min(80px, 9svh); }
	.vidas-header .vh-mlist { gap: 18px; }
}

/* Móvil: barra más ancha (12px a cada lado) y logo algo menor para que todo quepa en una línea. */
@media (max-width: 767px) {
	.vidas-header .vh-bar { width: calc(100% - 24px); padding: 0 18px 0 20px; }
	.vidas-header .vh-logo img { height: 21px; }
	.vidas-header .vh-actions { gap: 30px; }
	.vidas-header .vh-overlay { padding-left: 32px; padding-right: 32px; }
}

/* Móviles muy estrechos (≤360px): logo un poco menor para que el selector no se pegue. */
@media (max-width: 360px) {
	.vidas-header .vh-logo img { height: 19px; }
	.vidas-header .vh-actions { gap: 24px; }
}

@media (max-width: 782px) {
	.admin-bar .vidas-header { --vh-top: 66px; }
}

/* Sin backdrop-filter (navegadores antiguos): cristal más opaco para que se lea. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	@media (max-width: 1024px) {
		.vidas-header .vh-bar { background: rgba(255, 255, 255, 0.92); }
		.vidas-header .vh-overlay { background: rgba(255, 255, 255, 0.94); }
	}
}

html.vh-locked,
html.vh-locked body { overflow: hidden !important; }

/* En el editor de Elementor la barra no flota, para poder seleccionarla. */
.elementor-editor-active .vidas-header .vh-bar {
	position: relative;
	top: auto;
	left: auto;
	transform: none;
	margin: 20px auto;
}
.elementor-editor-active .vidas-header .vh-overlay { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	.vidas-header .vh-overlay,
	.vidas-header .vh-overlay::before,
	.vidas-header .vh-overlay::after,
	.vidas-header .vh-mlink,
	.vidas-header .vh-burger span { transition: none !important; }
}
