/* Navidad – Animaciones
 * Compatibilidad: se evitan `inset` y `gap` en flex (no existen en Safari < 14.1,
 * macOS anterior a 2021); se usan top/right/bottom/left y márgenes. */

.nav-root {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	pointer-events: none;
	z-index: 99990;
	overflow: hidden;
}

/* ---------- Guirnalda ---------- */

.nav-guirnalda {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 52px;
	pointer-events: none;
	z-index: 99991;
	overflow: hidden;
}

.admin-bar .nav-guirnalda {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .nav-guirnalda {
		top: 46px;
	}
}

/* Franja en el flujo del documento: empuja el sitio hacia abajo en vez de taparlo. */
.nav-guirnalda.nav-en-flujo,
.admin-bar .nav-guirnalda.nav-en-flujo {
	position: relative;
	top: 0;
	z-index: 1;
}

/* SVG oculto que solo contiene el dibujo compartido de los tramos (no usar
   display:none, porque algunos navegadores dejan de dibujar los <use>). */
.nav-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/* Si se desactivó "Mostrar en celulares", la franja (ya impresa en el HTML) se oculta. */
@media (max-width: 768px) {
	.nav-sin-movil {
		display: none;
	}
}

.nav-tramos {
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	white-space: nowrap;
}

.nav-tramo {
	position: relative;
	flex: 0 0 80px;
	width: 80px;
	height: 48px;
	margin-right: 0;
}

.nav-tramo svg {
	display: block;
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.25));
}

/* Foquitos: el color se define con `color` y el brillo usa currentColor. */
.nav-foco {
	position: absolute;
	top: 52%;
	width: 9px;
	height: 14px;
	margin-left: -4.5px;
	border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
	background: currentColor;
	box-shadow: 0 0 7px 2px currentColor, inset -2px -3px 4px rgba(0, 0, 0, 0.22), inset 2px 2px 3px rgba(255, 255, 255, 0.55);
	transform-origin: 50% 0;
	-webkit-transform-origin: 50% 0;
	animation: nav-parpadeo 1.6s ease-in-out infinite alternate;
}

/* Socket del foco */
.nav-foco::before {
	content: "";
	position: absolute;
	top: -4px;
	left: 50%;
	width: 6px;
	height: 5px;
	margin-left: -3px;
	background: #24352a;
	border-radius: 1px 1px 2px 2px;
}

.nav-foco-izq {
	left: 26%;
	transform: rotate(10deg);
}

.nav-foco-der {
	left: 74%;
	transform: rotate(-10deg);
}

.nav-foco-rojo {
	color: #ff2d3d;
}

.nav-foco-verde {
	color: #22c55e;
}

.nav-foco-dorado {
	color: #ffc83d;
}

.nav-foco-azul {
	color: #3b8bff;
}

.nav-foco-blanco {
	color: #fff4cc;
}

@keyframes nav-parpadeo {
	from {
		opacity: 1;
	}
	to {
		opacity: 0.28;
	}
}

/* Brillo suave para equipos con "reducir movimiento" */
@keyframes nav-brillo {
	from {
		opacity: 1;
	}
	to {
		opacity: 0.7;
	}
}

/* ---------- Nieve ---------- */

.nav-nieve {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* ---------- Esferas y piñatas colgando ---------- */

.nav-colgante {
	position: absolute;
	top: 0;
	transform-origin: 50% 0;
	-webkit-transform-origin: 50% 0;
	transform: translateY(-120vh);
	will-change: transform;
}

.nav-hilo {
	width: 2px;
	margin: 0 auto;
	background: linear-gradient(90deg, #b8932a, #f3d77a, #b8932a);
}

.nav-adorno {
	filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.28));
}

.nav-adorno svg {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Estrellas ---------- */

.nav-destello {
	position: absolute;
	opacity: 0;
	will-change: transform, opacity;
	filter: drop-shadow(0 0 4px rgba(255, 200, 60, 0.85));
}

.nav-destello svg {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Nochebuenas ---------- */

.nav-nochebuenas {
	position: absolute;
	right: 12px;
	bottom: 0;
	width: 170px;
	transform-origin: 50% 100%;
	-webkit-transform-origin: 50% 100%;
	animation: nav-mecerse 5s ease-in-out infinite alternate;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-nochebuenas svg {
	display: block;
	width: 100%;
	height: auto;
}

@keyframes nav-mecerse {
	from {
		transform: rotate(-1.5deg);
	}
	to {
		transform: rotate(1.5deg);
	}
}

/* ---------- Botón ocultar / mostrar ---------- */

.nav-toggle {
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 99995;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 2px solid #d4af37;
	border-radius: 50%;
	background: rgba(0, 80, 43, 0.9);
	color: #fff;
	font: 16px/1 system-ui, sans-serif;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
	transform: scale(1.1);
}

.nav-toggle:focus-visible {
	outline: 3px solid #ffc83d;
	outline-offset: 2px;
}

/* ---------- Celulares ---------- */

@media (max-width: 768px) {
	.nav-guirnalda,
	.nav-guirnalda.nav-en-flujo,
	.admin-bar .nav-guirnalda.nav-en-flujo {
		height: 42px;
	}

	.nav-tramo {
		flex-basis: 64px;
		width: 64px;
		height: 38.4px;
	}

	.nav-foco {
		width: 7px;
		height: 11px;
		margin-left: -3.5px;
		box-shadow: 0 0 5px 1.5px currentColor, inset -1.5px -2px 3px rgba(0, 0, 0, 0.22), inset 1.5px 1.5px 2px rgba(255, 255, 255, 0.55);
	}

	.nav-foco::before {
		top: -3px;
		width: 5px;
		height: 4px;
		margin-left: -2.5px;
	}

	.nav-nochebuenas {
		right: 6px;
		width: 112px;
	}
}

/* ---------- Movimiento reducido ---------- */

/* Si el sitio eligió "ignorar", el JS agrega .nav-movimiento al <html>.
   En la versión suave los foquitos siguen encendidos con un brillo lento;
   en la versión estática (.nav-estatico) quedan fijos. */
@media (prefers-reduced-motion: reduce) {
	html:not(.nav-movimiento) .nav-foco {
		animation-name: nav-brillo;
		animation-duration: 3.2s !important;
	}

	html:not(.nav-movimiento) .nav-nochebuenas {
		animation: none;
	}
}

html.nav-estatico .nav-foco {
	animation: none;
}

/* No imprimir las animaciones */
@media print {
	.nav-root,
	.nav-guirnalda,
	.nav-toggle {
		display: none !important;
	}
}
