/* Efectos de campaña (inc/seasonal-effects.php). */

/* ---------- Navidad: nieve ---------- */

.cp-fx-snow {
	position: fixed;
	inset: 0;
	z-index: 1001; /* Por encima del contenido; la interfaz fija mantiene prioridad. */
	pointer-events: none;
}

/* ---------- Black Friday: barra ---------- */

.cp-fx-bfbar {
	background: #0b0b0b;
	color: #fff;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.8125rem;
}

.cp-fx-bfbar[hidden] {
	display: none;
}

.cp-fx-bfbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 18px;
	min-height: 40px;
	padding-block: 6px;
}

.cp-fx-bfbar__title {
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cp-accent, #a9ab86);
}

.cp-fx-bfbar__offer {
	font-weight: 600;
}

.cp-fx-bfbar__code {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 6px 4px 10px;
	border: 1px dashed rgba(255, 255, 255, 0.55);
	border-radius: 5px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-weight: 800;
	letter-spacing: 0.1em;
	cursor: pointer;
}

.cp-fx-bfbar__code span {
	padding: 2px 6px;
	border-radius: 3px;
	background: #fff;
	color: #111;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0;
}

.cp-fx-bfbar__code:hover,
.cp-fx-bfbar__code:focus-visible {
	border-color: #fff;
}

.cp-fx-bfbar__timer {
	font-variant-numeric: tabular-nums;
	color: rgba(255, 255, 255, 0.8);
}

.cp-fx-bfbar__timer [data-cp-countdown-text] {
	font-weight: 700;
	color: #fff;
}

.cp-fx-bfbar__link {
	color: var(--cp-accent, #a9ab86);
	font-weight: 700;
	text-decoration: none;
}

.cp-fx-bfbar__link:hover,
.cp-fx-bfbar__link:focus-visible {
	color: #fff;
}

@media (max-width: 760px) {
	.cp-fx-bfbar__hide-sm {
		display: none;
	}

	.cp-fx-bfbar__inner {
		gap: 6px 10px;
		min-height: 36px;
		font-size: 0.75rem;
	}
}

/* =====================================================================
 * Navidad en toda la web (body.cp-fx-xmas / body.cp-fx-xmas-accent)
 * ================================================================== */

/* Color de acento dorado (botones, enlaces destacados, precios…) */
body.cp-fx-xmas-accent {
	--cp-accent: #92723c;
	--cp-accent-dark: #765a2e;
	--cp-accent-soft: #f5efe3;
}

/* Cabecera de temporada: verde pino y detalles de latón cálido. */
body.cp-fx-xmas,
body.cp-fx-xmas .site-header {
	overflow-anchor: none;
}

body.cp-fx-xmas .site-header {
	box-shadow: 0 2px 0 rgba(146, 114, 60, 0.42), 0 10px 28px rgba(21, 39, 32, 0.1);
	height: auto !important;
	transform: none !important;
}

body.cp-fx-xmas .site-header > .cp-topbar,
body.cp-fx-xmas .site-header > .cp-mainbar,
body.cp-fx-xmas .site-header > .cp-catbar {
	flex: 0 0 auto !important;
}

body.cp-fx-xmas .cp-topbar {
	position: relative;
	max-height: clamp(80px, 4.8vw, 94px);
	overflow: hidden;
	background: transparent;
	transition: max-height 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, visibility 240ms ease;
}

body.cp-fx-xmas .cp-mainbar__inner,
body.cp-fx-xmas .cp-catbar__inner,
body.cp-fx-xmas .cp-logo,
body.cp-fx-xmas .cp-logo img,
body.cp-fx-xmas .cp-search,
body.cp-fx-xmas .cp-search input,
body.cp-fx-xmas .cp-action,
body.cp-fx-xmas .cp-menu > li > a,
body.cp-fx-xmas .cp-nav ul > li > a,
body.cp-fx-xmas .cp-categories__button {
	transition: min-height 220ms cubic-bezier(0.22, 1, 0.36, 1), height 220ms cubic-bezier(0.22, 1, 0.36, 1), width 220ms cubic-bezier(0.22, 1, 0.36, 1), padding 220ms cubic-bezier(0.22, 1, 0.36, 1), margin 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Al hacer scroll hacia abajo: se oculta la barra superior y se contrae el resto de la cabecera */
body.cp-fx-xmas.is-xmas-scrolled {
	--cp-header-main-height: 64px;
	--cp-header-nav-height: 42px;
	--cp-header-logo-width: 150px;
	--cp-header-grid-logo: 164px;
	--cp-header-search-height: 36px;
	--cp-header-action-height: 36px;
	--cp-header-link-height: 36px;
	--cp-header-category-button-height: 34px;
}

body.cp-fx-xmas.is-xmas-scrolled .cp-topbar {
	max-height: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

body.cp-fx-xmas.is-xmas-scrolled .cp-search input {
	height: 34px;
}

body.cp-fx-xmas .cp-topbar__inner {
	position: absolute;
	top: 34px;
	right: 0;
	left: 0;
	min-height: 26px;
	margin: 0 auto;
	z-index: 3;
}

body.cp-fx-xmas .cp-topbar a,
body.cp-fx-xmas .cp-topbar {
	color: #f5ecdc;
}

body.cp-fx-xmas .cp-topbar__promise {
	text-shadow: 0 1px 3px rgba(12, 19, 16, 0.72);
}

body.cp-fx-xmas .cp-social__link {
	filter: drop-shadow(0 1px 2px rgba(12, 19, 16, 0.68));
}

body.cp-fx-xmas .cp-catbar {
	border-bottom: 1px solid rgba(146, 114, 60, 0.32);
}

body.cp-fx-xmas .cp-menu > li > a::after {
	background: var(--cp-accent);
}

/* Nieve acumulada + guirnalda bajo la cabecera (cuelga sobre el contenido) */
.cp-fx-xmas-edge {
	position: relative;
	width: 100%;
	height: clamp(80px, 4.8vw, 94px);
	flex: 0 0 auto;
	margin: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 2;
	background: transparent;
}

.cp-fx-xmas-edge__roof {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	z-index: 2;
}

/* Destellos desfasados para que cada bombilla parezca encenderse por separado. */
@keyframes cp-fx-xmas-lamp-glow {
	0%, 100% { opacity: 0.08; }
	34% { opacity: 0.72; }
	48% { opacity: 0.28; }
	62% { opacity: 1; }
}

@keyframes cp-fx-xmas-lamp-light {
	0%, 100% { filter: brightness(0.72); }
	42% { filter: brightness(1.45); }
	58% { filter: brightness(1.08); }
}

.cp-lamp-halo {
	opacity: 0.2;
	animation: cp-fx-xmas-lamp-glow var(--period, 3.8s) ease-in-out infinite;
	animation-delay: var(--delay, 0s);
}

.cp-lamp-glass {
	animation: cp-fx-xmas-lamp-light var(--period, 3.8s) ease-in-out infinite;
	animation-delay: var(--delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
	@keyframes cp-fx-xmas-lamp-glow-soft {
		0%, 100% { opacity: 0.34; }
		50% { opacity: 0.58; }
	}

	.cp-lamp-halo {
		animation-name: cp-fx-xmas-lamp-glow-soft;
		animation-duration: 8s;
	}

	.cp-lamp-glass {
		animation: none;
	}
}

.cp-fx-lights {
	position: absolute;
	top: 4px;
	left: 0;
	display: flex;
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
	/* Cable ondulado entre bombillas */
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='12' viewBox='0 0 64 12'%3E%3Cpath d='M0 1 Q32 15 64 1' fill='none' stroke='%231b2c24' stroke-opacity='.78' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x 0 0 / 64px 12px;
}

.cp-fx-lights li {
	position: relative;
	flex: none;
	width: 64px;
	height: 22px;
}

/* Casquillo */
.cp-fx-lights li::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 30px;
	width: 4px;
	height: 4px;
	border-radius: 1px;
	background: #27382e;
}

/* Bombilla */
.cp-fx-lights li::after {
	content: "";
	position: absolute;
	top: 10px;
	left: 28px;
	width: 9px;
	height: 12px;
	border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
	background: var(--cp-bulb, #f3c969);
	box-shadow: 0 0 7px 2px rgba(239, 198, 119, 0.42), 0 0 16px 4px rgba(239, 198, 119, 0.14);
	animation: cp-fx-twinkle 4.8s ease-in-out infinite;
}

.cp-fx-lights li:nth-child(4n + 1) { --cp-bulb: #f4d99e; }
.cp-fx-lights li:nth-child(4n + 2) { --cp-bulb: #e9bd72; }
.cp-fx-lights li:nth-child(4n + 3) { --cp-bulb: #fff2d2; }
.cp-fx-lights li:nth-child(4n) { --cp-bulb: #c98a70; }

.cp-fx-lights li:nth-child(2n)::after { animation-duration: 5.2s; animation-delay: -1.8s; }
.cp-fx-lights li:nth-child(5n)::after { animation-duration: 4.4s; animation-delay: -0.9s; }
.cp-fx-lights li:nth-child(7n)::after { animation-duration: 5.8s; animation-delay: -2.6s; }

@keyframes cp-fx-twinkle {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.68; box-shadow: 0 0 4px 1px rgba(239, 198, 119, 0.3); }
}

@media (prefers-reduced-motion: reduce) {
	.cp-fx-lights li::after {
		animation: none;
	}
}

/* En móvil conserva el mismo espacio propio dentro de la cabecera. */
@media (max-width: 900px) {
	body.cp-fx-xmas .cp-topbar {
		background: transparent;
	}

	body.cp-fx-xmas.is-xmas-scrolled .cp-mainbar__inner {
		padding-block: 7px;
		gap: 8px;
	}

	body.cp-fx-xmas.is-xmas-scrolled .cp-logo,
	body.cp-fx-xmas.is-xmas-scrolled .cp-logo img {
		width: 124px;
	}

	body.cp-fx-xmas.is-xmas-scrolled .cp-search--header {
		margin-top: 0;
	}

	body.cp-fx-xmas.is-xmas-scrolled .cp-mobile-toggle,
	body.cp-fx-xmas.is-xmas-scrolled .cp-action {
		min-height: 36px;
		height: 36px;
	}
}

@media (max-width: 760px) {
	body.cp-fx-xmas .cp-topbar {
		max-height: 80px;
	}

	body.cp-fx-xmas.is-xmas-scrolled .cp-topbar {
		max-height: 0;
	}

	.cp-fx-xmas-edge {
		height: 80px;
	}

	.cp-fx-xmas-edge__roof {
		left: 50%;
		width: 278%;
		height: 100%;
		transform: translateX(-50%);
	}

	body.cp-fx-xmas .cp-topbar__inner {
		padding-inline: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cp-fx-lights li::after {
		box-shadow: 0 0 6px 2px rgba(239, 198, 119, 0.35);
	}

	body.cp-fx-xmas .cp-topbar,
	body.cp-fx-xmas .cp-mainbar__inner,
	body.cp-fx-xmas .cp-catbar__inner,
	body.cp-fx-xmas .cp-logo,
	body.cp-fx-xmas .cp-logo img,
	body.cp-fx-xmas .cp-search,
	body.cp-fx-xmas .cp-search input,
	body.cp-fx-xmas .cp-action,
	body.cp-fx-xmas .cp-menu > li > a,
	body.cp-fx-xmas .cp-nav ul > li > a,
	body.cp-fx-xmas .cp-categories__button {
		transition: none;
	}
}



/* =====================================================================
 * Navidad: velo burdeos sobre las fotos de heros y banners
 * (mismo granate que el banner de Navidad, #74091a; ese banner no lo lleva)
 * ================================================================== */

body.cp-fx-xmas-overlay {
	/* Negro neutro (como el tema) + vino solo en el lado del texto: sobre zonas
	   claras un rojo translúcido se ve rosa, así que no llega a la mitad derecha. */
	--cp-xmas-veil:
		linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.14) 75%, rgba(0, 0, 0, 0.06) 100%),
		linear-gradient(90deg, rgba(116, 9, 26, 0.72) 0%, rgba(116, 9, 26, 0.52) 30%, rgba(116, 9, 26, 0) 58%),
		linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.22) 100%);
}

/* Slider de portada (diapositivas normales) */
body.cp-fx-xmas-overlay .cp-front-slide__media::after {
	background: var(--cp-xmas-veil);
}

body.cp-fx-xmas-overlay .cp-front-slide__shade {
	background: none;
}

/* Heros de páginas interiores */
body.cp-fx-xmas-overlay .cp-merch-hero::after,
body.cp-fx-xmas-overlay .cp-interior-hero::before,
body.cp-fx-xmas-overlay .cp-projects-archive-hero::before,
body.cp-fx-xmas-overlay .cp-project-single-hero__media::after,
body.cp-fx-xmas-overlay .cp-process-hero__media::after,
body.cp-fx-xmas-overlay .cp-files-hero__media::after,
body.cp-fx-xmas-overlay .cp-about-hero::before,
body.cp-fx-xmas-overlay .cp-sustain-banner__overlay {
	background: var(--cp-xmas-veil);
}

/* Tienda/categorías: el velo va en el style del propio hero (archive-product.php). */
body.cp-fx-xmas-overlay .cp-commerce-page--account .cp-commerce-hero {
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3)),
		linear-gradient(90deg, rgba(116, 9, 26, 0.72), rgba(116, 9, 26, 0) 70%),
		url("https://createprint.es/wp-content/uploads/2026/07/eventos_especiales.png") center / cover;
}

@media (max-width: 900px) {
	body.cp-fx-xmas-overlay .cp-front-slide__media::after {
		background:
			linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.36) 100%),
			linear-gradient(90deg, rgba(116, 9, 26, 0.6) 0%, rgba(116, 9, 26, 0.3) 60%, rgba(116, 9, 26, 0.12) 100%);
	}
}
