/**
 * Fechas Festivas Perú — estilos del front-end.
 *
 * Los colores llegan desde PHP en las variables --fpe-band, --fpe-accent
 * y --fpe-cta, distintas en cada temporada.
 *
 * @package ModulaSoft\Festivo
 */

:root {
	--fpe-band: #0e4d2a;
	--fpe-accent: #f5b301;
	--fpe-cta: #c8102e;
}

/* ---------------------------------------------------------------
   1. Franja superior
   --------------------------------------------------------------- */

#fpe-band {
	position: relative;
	width: 100%;
	height: 70px;
	overflow: visible;
	z-index: 5;
	background-color: var(--fpe-band);
	background-image: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.55) 0%,
		rgba(0, 0, 0, 0.18) 38%,
		rgba(0, 0, 0, 0) 60%
	);
}

/* Las fechas solemnes llevan una franja baja y sin adornos colgantes. */
#fpe-band.is-solemn {
	height: 8px;
	background-image: none;
	border-bottom: 2px solid var(--fpe-accent);
}

/* Temporadas sin adornos colgantes (Black Friday): cinta baja con filo de acento. */
#fpe-band.is-minimal {
	height: 34px;
	background-image: repeating-linear-gradient(
		-45deg,
		rgba(255, 255, 255, 0.05) 0 14px,
		rgba(255, 255, 255, 0) 14px 28px
	);
	border-bottom: 2px solid var(--fpe-accent);
}

#fpe-band .fpe-layer {
	position: absolute;
	pointer-events: none;
}

/* Guirnalda de luces (Navidad) ----------------------------------- */

#fpe-band .fpe-garland {
	left: 0;
	right: 0;
	top: 0;
	height: 30px;
}

#fpe-band .fpe-garland svg {
	display: block;
	width: 100%;
	height: 26px;
}

#fpe-band .fpe-bulb {
	position: absolute;
	z-index: 4;
	width: 10px;
	height: 14px;
	border-radius: 50% 50% 55% 55% / 40% 40% 60% 60%;
	transform: translateX(-50%);
	background: currentColor;
	box-shadow: 0 0 8px 2px currentColor, inset -2px -2px 3px rgba(0, 0, 0, 0.25);
	animation: fpe-glow 2.6s ease-in-out infinite;
}

#fpe-band .fpe-bulb::before {
	content: "";
	position: absolute;
	top: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 4px;
	height: 4px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 1px;
}

@keyframes fpe-glow {
	0%,
	100% {
		opacity: 1;
		filter: brightness(1.15);
	}
	50% {
		opacity: 0.4;
		filter: brightness(0.62);
	}
}

/* Colgantes genéricos: esferas, corazones, flores, estrellas ----- */

#fpe-band .fpe-hang {
	position: absolute;
	z-index: 4;
	top: 12px;
	transform-origin: 50% -12px;
	animation: fpe-swing-soft 4.2s ease-in-out infinite;
}

@keyframes fpe-swing-soft {
	0%,
	100% {
		transform: rotate(-6deg);
	}
	50% {
		transform: rotate(6deg);
	}
}

/* Banderines ------------------------------------------------------ */

#fpe-band .fpe-bunting {
	left: 0;
	right: 0;
	top: 0;
	height: 44px;
}

#fpe-band .fpe-bunting svg {
	display: block;
	width: 100%;
	height: 44px;
}

/* Campanas (solo Navidad) ---------------------------------------- */

#fpe-band .fpe-bell {
	position: absolute;
	z-index: 5;
	top: 3px;
	transform-origin: 50% 10%;
	cursor: pointer;
	pointer-events: auto;
	animation: fpe-swing 3.6s ease-in-out infinite;
}

#fpe-band .fpe-bell-left {
	left: 10px;
	width: 92px;
}

#fpe-band .fpe-bell-right {
	right: 12px;
	width: 78px;
	animation-delay: 0.6s;
}

@keyframes fpe-swing {
	0%,
	100% {
		transform: rotate(-7deg);
	}
	50% {
		transform: rotate(7deg);
	}
}

/* Nieve acumulada (solo Navidad) --------------------------------- */

#fpe-band .fpe-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 30px;
	z-index: 3;
	pointer-events: none;
}

#fpe-band .fpe-cap svg {
	display: block;
	width: 100%;
	height: 30px;
}

/* ---------------------------------------------------------------
   2. Partículas
   --------------------------------------------------------------- */

#fpe-particles {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 9988;
	pointer-events: none;
}

/* ---------------------------------------------------------------
   3. Gorro sobre el logo (Navidad)
   --------------------------------------------------------------- */

.fpe-logo-host {
	position: relative;
}

#fpe-hat {
	position: absolute;
	width: 44px;
	left: -15px;
	top: -24px;
	transform: rotate(-16deg);
	z-index: 30;
	pointer-events: none;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

/* ---------------------------------------------------------------
   4. Imagen de temporada que cruza la pantalla
   --------------------------------------------------------------- */

#fpe-float {
	position: fixed;
	left: 0;
	top: 210px;
	z-index: 9989;
	opacity: 0;
	pointer-events: none;
	will-change: transform;
}

#fpe-float img,
#fpe-float2 img,
#fpe-fixed img {
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 7px 16px rgba(0, 0, 0, 0.3));
}

#fpe-float2 {
	position: fixed;
	left: 0;
	top: 380px;
	z-index: 9989;
	opacity: 0;
	pointer-events: none;
	will-change: transform;
}

/* Adorno fijo anclado a una esquina */
#fpe-fixed {
	position: fixed;
	z-index: 9986;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.8s ease;
}

#fpe-fixed.is-in {
	opacity: 1;
}

#fpe-fixed.pos-bottom-left {
	left: 10px;
	bottom: 0;
}

#fpe-fixed.pos-bottom-right {
	right: 10px;
	bottom: 0;
}

#fpe-fixed.pos-top-left {
	left: 10px;
	top: 90px;
}

#fpe-fixed.pos-top-right {
	right: 10px;
	top: 90px;
}

/* Si la barra de campaña está visible, el adorno de abajo sube para no taparla. */
.fpe-has-bar #fpe-fixed.pos-bottom-left,
.fpe-has-bar #fpe-fixed.pos-bottom-right {
	bottom: 56px;
}

/* ---------------------------------------------------------------
   5. Barra de campaña
   --------------------------------------------------------------- */

#fpe-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9995;
	color: #fff;
	background-color: var(--fpe-band);
	background-image: linear-gradient(
		100deg,
		rgba(0, 0, 0, 0.12) 0%,
		rgba(0, 0, 0, 0.32) 45%,
		var(--fpe-cta) 100%
	);
	font: 600 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.28);
	border-top: 2px solid var(--fpe-accent);
}

#fpe-bar .fpe-bar-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 11px 54px 11px 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	justify-content: center;
}

#fpe-bar b {
	color: var(--fpe-accent);
	letter-spacing: 0.3px;
}

/* En fechas solemnes la barra es plana y discreta. */
.fpe-solemn #fpe-bar {
	background-image: none;
	border-top-width: 1px;
}

.fpe-solemn #fpe-bar .fpe-bar-inner {
	justify-content: center;
	font-weight: 500;
}

#fpe-countdown {
	display: inline-flex;
	gap: 6px;
}

#fpe-countdown i {
	font-style: normal;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 7px;
	padding: 3px 7px;
	min-width: 44px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

#fpe-countdown i s {
	display: block;
	text-decoration: none;
	font-size: 9px;
	opacity: 0.75;
	font-weight: 500;
	letter-spacing: 0.6px;
}

#fpe-bar .fpe-cta {
	background: var(--fpe-accent);
	color: #241a06;
	padding: 8px 16px;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 800;
	white-space: nowrap;
}

#fpe-bar .fpe-cta:hover,
#fpe-bar .fpe-cta:focus {
	filter: brightness(1.12);
	color: #241a06;
}

#fpe-bar .fpe-close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.25);
	border: 0;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
}

#fpe-sound {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.45);
	color: #fff;
	border-radius: 999px;
	padding: 6px 13px 6px 10px;
	font: 700 12.5px system-ui, sans-serif;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

#fpe-sound.is-on {
	background: var(--fpe-accent);
	color: #241a06;
}

/* ---------------------------------------------------------------
   6. Etiquetas de producto
   --------------------------------------------------------------- */

.fpe-badges .product-labels .onsale,
.fpe-badges .wd-product-label.onsale,
.fpe-badges span.onsale {
	background: var(--fpe-cta) !important;
	color: #fff !important;
	border: 1px solid var(--fpe-accent) !important;
}

.fpe-badges .wd-product-label.new,
.fpe-badges .product-labels .new {
	background: var(--fpe-band) !important;
	color: #fff !important;
	border: 1px solid var(--fpe-accent) !important;
}

/* Las fechas solemnes no tiñen las etiquetas. */
.fpe-solemn.fpe-badges .product-labels .onsale,
.fpe-solemn.fpe-badges .wd-product-label.onsale,
.fpe-solemn.fpe-badges span.onsale,
.fpe-solemn.fpe-badges .wd-product-label.new,
.fpe-solemn.fpe-badges .product-labels .new {
	background: none !important;
	border: 0 !important;
}

/* ---------------------------------------------------------------
   7. Detalles
   --------------------------------------------------------------- */

.fpe-spin {
	color: var(--fpe-accent);
	margin-right: 9px;
	display: inline-block;
	animation: fpe-spin 14s linear infinite;
}

@keyframes fpe-spin {
	to {
		transform: rotate(360deg);
	}
}

.fpe-solemn .fpe-spin {
	animation: none;
}

/* ---------------------------------------------------------------
   8. Responsive
   --------------------------------------------------------------- */

@media (max-width: 768px) {
	#fpe-band {
		height: 52px;
	}

	#fpe-band.is-solemn {
		height: 6px;
	}

	#fpe-band .fpe-cap,
	#fpe-band .fpe-cap svg {
		height: 20px;
	}

	#fpe-band .fpe-bell-left {
		width: 62px;
		left: 6px;
	}

	#fpe-band .fpe-bell-right {
		display: none;
	}

	#fpe-band .fpe-hang:nth-of-type(n + 4) {
		display: none;
	}

	#fpe-bar .fpe-bar-inner {
		padding: 9px 46px 9px 12px;
		font-size: 12.5px;
	}

	#fpe-float,
	#fpe-float2 {
		width: 190px !important;
	}

	#fpe-fixed {
		max-width: 34vw;
	}
}

/* ---------------------------------------------------------------
   9. Accesibilidad
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	#fpe-band .fpe-bulb,
	#fpe-band .fpe-hang,
	#fpe-band .fpe-bell,
	.fpe-spin {
		animation: none !important;
	}

	#fpe-particles,
	#fpe-float {
		display: none !important;
	}
}
