/* PDF FlipBook Black Friday Banner — front end
 * Follows the pdfflipbook.com theme: navy "dark" #0D1B26, brand teal #09637E buttons with white Inter 500 and a
 * chevron, "Most Popular"-style amber #F59E0B badges with 4px corners, 6px button corners, the hero's square grid,
 * white at 80% for secondary text on dark. Colours come from inline custom properties on .pffb (settings page). */

.pffb {
	--pffb-bg: #0D1B26;
	--pffb-text: #FFFFFF;
	--pffb-brand: #09637E;
	--pffb-hl: #F59E0B;
	--pffb-on-brand: #FFFFFF;
	--pffb-on-hl: #0A1A2F;
	--pffb-muted: color-mix(in srgb, var(--pffb-text) 80%, transparent);
	--pffb-line: color-mix(in srgb, var(--pffb-text) 12%, transparent);
	--pffb-ease: cubic-bezier(.22, 1, .36, 1);
	--pffb-out: cubic-bezier(.16, 1, .3, 1); /* exponential ease-out, no overshoot */
	/* One shared beat for the ambient loops: the page turns, then a shine crosses the button.
	   Four rounds after the entrance, then everything rests. */
	--pffb-beat: 8s;
	--pffb-beat-delay: 1.6s;
	--pffb-beats: 4;
	--pffb-font: var(--wp--preset--font-family--body, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);

	position: relative;
	z-index: 99990;
	isolation: isolate;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	background: var(--pffb-bg);
	color: var(--pffb-text);
	font-family: var(--pffb-font);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	box-shadow: inset 0 -1px 0 var(--pffb-line); /* hairline, like the site header's bottom border */
	container: pffb / inline-size;
}
.pffb *, .pffb *::before, .pffb *::after { box-sizing: border-box; }
.pffb [hidden] { display: none !important; }
.pffb ::selection { background: var(--pffb-hl); color: var(--pffb-on-hl); }

/* ---------- Positions ---------- */
.pffb--sticky { position: sticky; top: 0; }

.pffb--bottom {
	position: fixed;
	left: 50%;
	bottom: 16px;
	width: min(1180px, calc(100% - 32px));
	border-radius: 10px;
	box-shadow: 0 20px 50px rgba(10, 26, 47, .28), inset 0 0 0 1px var(--pffb-line);
	transform: translateX(-50%);
}
.pffb--bottom .pffb__fx { border-radius: inherit; }

@media (max-width: 600px) {
	.pffb--bottom { bottom: 8px; width: calc(100% - 16px); border-radius: 8px; }
}
@media (max-width: 767px) {
	.pffb--hide-mobile { display: none !important; }
}

/* ---------- Background effects ---------- */
.pffb__fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.pffb__grid, .pffb__aurora, .pffb__sparkles, .pffb__edge { display: none; }

.pffb--fx-grid .pffb__grid,
.pffb--fx-aurora .pffb__aurora,
.pffb--fx-aurora .pffb__edge,
.pffb--fx-sparkle .pffb__sparkles,
.pffb--fx-sparkle .pffb__edge { display: block; }

.pffb__aurora::before,
.pffb__aurora::after {
	content: "";
	position: absolute;
	top: -180%;
	width: 42%;
	height: 460%;
	border-radius: 50%;
	opacity: .55;
	animation: pffb-drift 16s ease-in-out infinite alternate;
}
.pffb__aurora::before {
	left: -12%;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--pffb-brand) 70%, transparent), transparent);
}
.pffb__aurora::after {
	right: -12%;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--pffb-hl) 32%, transparent), transparent);
	animation-duration: 21s;
	animation-direction: alternate-reverse;
}
@keyframes pffb-drift {
	from { transform: translateX(0) scale(1); }
	to   { transform: translateX(150%) scale(1.15); }
}

.pffb__sparkles i {
	position: absolute;
	left: var(--x);
	top: var(--y);
	width: var(--s);
	height: var(--s);
	background: var(--pffb-hl);
	clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
	opacity: 0;
	animation: pffb-twinkle 3.6s ease-in-out var(--d) infinite;
}
.pffb__sparkles i:nth-child(even) { background: var(--pffb-text); }
@keyframes pffb-twinkle {
	0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
	50%      { opacity: .85; transform: scale(1) rotate(90deg); }
}

/* The site's hero grid (1px lines, a few tinted cells) at bar scale, drawn in the text colour so it suits any
   preset, faded at both ends and drifting slowly sideways. */
.pffb__grid {
	position: absolute;
	inset: 0;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.pffb__grid::before {
	content: "";
	position: absolute;
	inset: 0 -300px 0 0;
	background: var(--pffb-text);
	opacity: .07;
	--pffb-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60'%3E%3Cpath d='M.5 0v60M30.5 0v60M60.5 0v60M90.5 0v60M120.5 0v60M150.5 0v60M180.5 0v60M210.5 0v60M240.5 0v60M270.5 0v60M0 .5h300M0 30.5h300' stroke='%23000'/%3E%3Cpath d='M61 1h29v29H61zM181 31h29v29h-29zM241 1h29v29h-29z' fill-opacity='.45'/%3E%3C/svg%3E");
	-webkit-mask: var(--pffb-tile) 0 -3px / 300px 60px repeat;
	mask: var(--pffb-tile) 0 -3px / 300px 60px repeat;
	animation: pffb-grid 60s linear infinite;
}
@keyframes pffb-grid { to { transform: translateX(-300px); } }

/* Thin animated brand line along the bottom edge (aurora and sparkle effects) */
.pffb__edge {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--pffb-brand), var(--pffb-hl), var(--pffb-brand), transparent) 0 0 / 50% 100% repeat-x;
	opacity: .9;
	animation: pffb-edge 6s linear infinite;
}
.pffb--bottom .pffb__edge { display: none; }
@keyframes pffb-edge { to { background-position: 200% 0; } }

/* ---------- Layout ---------- */
.pffb__inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px 32px;
	max-width: 1320px;
	min-height: 56px;
	margin: 0 auto;
	padding: 9px 56px 9px 24px;
}
.pffb__lead,
.pffb__deal { display: flex; align-items: center; min-width: 0; }
.pffb__lead { gap: 12px; }
.pffb__deal { gap: 14px; flex: none; }

/* ---------- Flipbook icon (a page turning, on brand for a flipbook product) ---------- */
.pffb__book {
	position: relative;
	flex: none;
	width: 30px;
	height: 21px;
	perspective: 140px;
}
.pffb__page {
	position: absolute;
	top: 0;
	width: 50%;
	height: 100%;
	background:
		repeating-linear-gradient(to bottom, transparent 0 4px, rgba(10, 26, 47, .16) 4px 5px) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat,
		#FFFFFF;
	/* Edge tinted from the text colour: invisible on dark bars, keeps the white pages visible on light ones */
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pffb-text) 16%, rgba(10, 26, 47, .1));
}
.pffb__page--l { left: 0; border-radius: 3px 0 0 3px; }
.pffb__page--r,
.pffb__page--flip { left: 50%; border-radius: 0 3px 3px 0; }
.pffb__page--l::after {
	content: "";
	position: absolute;
	inset: 0 0 0 auto;
	width: 4px;
	background: linear-gradient(90deg, transparent, rgba(10, 26, 47, .18));
}
.pffb__page--flip {
	transform-origin: left center;
	transform-style: preserve-3d;
	background:
		repeating-linear-gradient(to bottom, transparent 0 4px, color-mix(in srgb, var(--pffb-brand) 40%, transparent) 4px 5px) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat,
		color-mix(in srgb, var(--pffb-brand) 12%, #FFFFFF);
	animation: pffb-flip var(--pffb-beat) var(--pffb-ease) var(--pffb-beat-delay) var(--pffb-beats);
}
@keyframes pffb-flip {
	0%, 4%    { transform: rotateY(0deg); opacity: 1; filter: brightness(1); }
	10%       { filter: brightness(.7); }
	16%, 60%  { transform: rotateY(-180deg); opacity: 1; filter: brightness(1); }
	64%       { transform: rotateY(-180deg); opacity: 0; }
	65%       { transform: rotateY(0deg); opacity: 0; }
	70%, 100% { transform: rotateY(0deg); opacity: 1; }
}

/* ---------- Badge ---------- */
.pffb__badge {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	flex: none;
	align-items: center;
	padding: 5px 9px;
	border-radius: 4px;
	background: var(--pffb-hl);
	color: var(--pffb-on-hl);
	font: 600 13px/1.2 var(--pffb-font);
	letter-spacing: -.01em;
	white-space: nowrap;
}
@keyframes pffb-sweep-cta {
	0%, 20%   { transform: translateX(-130%); }
	34%, 100% { transform: translateX(130%); }
}

/* ---------- Headline ---------- */
.pffb .pffb__headline {
	margin: 0;
	padding: 0;
	min-width: 0;
	overflow: hidden;
	color: var(--pffb-text);
	font: 500 15px/1.35 var(--pffb-font);
	letter-spacing: -.02em;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.pffb__headline-m { display: none; }
.pffb .pffb__hl {
	position: relative;
	display: inline-block;
	color: var(--pffb-hl);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.pffb .pffb__hl::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1.5px;
	border-radius: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	animation: pffb-draw .6s var(--pffb-ease) 1.05s forwards;
}
@keyframes pffb-draw { to { transform: scaleX(1); } }

/* The highlighted number rolls up into place as the headline settles (wrapped by the script).
   It never shows a wrong value on the way, unlike a count from 0. */
.pffb__roll { display: inline-block; }
.pffb__roll.is-rolling { animation: pffb-roll .55s var(--pffb-out) .3s backwards; }
@keyframes pffb-roll {
	from { transform: translateY(75%) scale(.7); opacity: 0; filter: blur(3px); }
}

/* ---------- Coupon ---------- */
.pffb .pffb__code {
	all: unset;
	position: relative;
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	color: var(--pffb-muted);
	font: 500 13px/1 var(--pffb-font);
	white-space: nowrap;
}
.pffb__chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-width: 92px;
	justify-content: center;
	padding: 7px 10px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--pffb-hl) 10%, transparent);
	color: var(--pffb-text);
	font: 700 13px/1 var(--pffb-font);
	font-variant-numeric: tabular-nums;
	letter-spacing: .08em;
	transition: background .25s ease, transform .25s var(--pffb-out);
}
.pffb__ants {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}
.pffb__ants rect {
	width: calc(100% - 1px);
	height: calc(100% - 1px);
	fill: none;
	stroke: color-mix(in srgb, var(--pffb-hl) 75%, transparent);
	stroke-width: 1;
	stroke-dasharray: 4 3;
	animation: pffb-ants 1.6s linear infinite paused;
}
@keyframes pffb-ants { to { stroke-dashoffset: -14; } }
.pffb__chip-icon { display: inline-flex; color: var(--pffb-hl); }
.pffb__chip-icon--check { display: none; }

.pffb .pffb__code:hover .pffb__chip,
.pffb .pffb__code:focus-visible .pffb__chip { background: color-mix(in srgb, var(--pffb-hl) 20%, transparent); transform: translateY(-1px); }
.pffb .pffb__code:hover .pffb__ants rect,
.pffb .pffb__code:focus-visible .pffb__ants rect { animation-play-state: running; }
.pffb .pffb__code:active .pffb__chip { transform: scale(.96); }
.pffb .pffb__code:focus-visible .pffb__chip { outline: 2px solid var(--pffb-hl); outline-offset: 2px; }

.pffb__code.is-copied .pffb__chip { background: var(--pffb-hl); color: var(--pffb-on-hl); letter-spacing: -.01em; }
.pffb__code.is-copied .pffb__chip-icon { color: var(--pffb-on-hl); }
.pffb__code.is-copied .pffb__chip-icon--copy { display: none; }
.pffb__code.is-copied .pffb__chip-icon--check { display: inline-flex; animation: pffb-pop .4s var(--pffb-out); }
.pffb__code.is-copied .pffb__ants rect { stroke: transparent; }
@keyframes pffb-pop { from { transform: scale(0); } }

/* Particle burst on copy (added by the script) */
.pffb__burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.pffb__burst i {
	position: absolute;
	left: -3px;
	top: -3px;
	width: 6px;
	height: 6px;
	border-radius: 2px;
	background: var(--c);
	animation: pffb-burst .7s var(--pffb-ease) forwards;
}
@keyframes pffb-burst {
	from { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; }
	to   { transform: rotate(var(--a)) translateY(-34px) scale(.3); opacity: 0; }
}

.pffb__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Countdown ---------- */
.pffb__cd {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	color: var(--pffb-muted);
	font-size: 13px;
	white-space: nowrap;
}
.pffb__units { display: inline-flex; gap: 4px; }
.pffb__unit {
	display: inline-flex;
	align-items: baseline;
	gap: 1px;
	overflow: hidden;
	padding: 5px 6px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--pffb-text) 7%, transparent);
	box-shadow: inset 0 0 0 1px var(--pffb-line);
	color: var(--pffb-text);
	line-height: 1;
}
.pffb__unit b {
	display: inline-block;
	min-width: 2ch;
	font: 600 13px/1 var(--pffb-font);
	font-variant-numeric: tabular-nums;
	text-align: center;
}
.pffb__unit--d b { min-width: 1ch; }
.pffb__unit small { color: var(--pffb-muted); font-size: 11px; font-weight: 500; }
.pffb__unit b.is-tick { animation: pffb-tick .35s var(--pffb-ease); }
@keyframes pffb-tick {
	from { transform: translateY(-80%); opacity: 0; filter: blur(2px); }
	to   { transform: none; opacity: 1; filter: none; }
}
.pffb__cd.is-over { display: none; }

/* ---------- Button: the site's primary button (brand teal, white Inter 500, 6px, chevron that nudges 4px) ---------- */
.pffb a.pffb__cta {
	position: relative;
	overflow: hidden;
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 4px;
	padding: 8px 10px 8px 16px;
	border: 1px solid color-mix(in srgb, var(--pffb-brand), #FFFFFF 25%);
	border-radius: 6px;
	background: var(--pffb-brand);
	box-shadow: 0 4px 2px rgba(0, 0, 0, .12);
	color: var(--pffb-on-brand);
	font: 500 14px/20px var(--pffb-font);
	letter-spacing: -.02em;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .25s ease, border-color .25s ease, transform .25s var(--pffb-ease);
}
.pffb a.pffb__cta:hover,
.pffb a.pffb__cta:focus-visible {
	color: var(--pffb-on-brand);
	text-decoration: none;
	background: color-mix(in srgb, var(--pffb-brand), #FFFFFF 12%);
}
.pffb a.pffb__cta:focus-visible { outline: 2px solid var(--pffb-text); outline-offset: 2px; }
.pffb a.pffb__cta:active { transform: translateY(1px); }
.pffb__cta svg { flex: none; transition: transform .25s var(--pffb-ease); }
.pffb__cta:hover svg,
.pffb__cta:focus-visible svg { transform: translateX(4px); }
.pffb--shine .pffb__cta::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
	transform: translateX(-130%);
	animation: pffb-sweep-cta var(--pffb-beat) var(--pffb-ease) var(--pffb-beat-delay) var(--pffb-beats);
}

/* ---------- Close ---------- */
.pffb .pffb__close {
	all: unset;
	position: absolute;
	z-index: 2;
	top: 50%;
	right: 12px;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	border-radius: 6px;
	color: var(--pffb-muted);
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.pffb .pffb__close::before { content: ""; position: absolute; inset: -7px; }
.pffb .pffb__close:hover,
.pffb .pffb__close:focus-visible { background: var(--pffb-line); color: var(--pffb-text); }
.pffb .pffb__close:focus-visible { outline: 2px solid var(--pffb-text); outline-offset: 1px; }

/* ---------- Entrance ---------- */
/* "backwards" fill: once done, nothing is held, so the copy burst isn't clipped and closing can animate */
.pffb--enter-drop:not(.pffb--bottom) { animation: pffb-reveal .75s var(--pffb-ease) backwards; }
.pffb--enter-drop.pffb--bottom { animation: pffb-rise-up .8s var(--pffb-out) backwards; }
.pffb--enter-fade { animation: pffb-fade .6s ease backwards; }
.pffb--enter-drop .pffb-rise { animation: pffb-in .6s var(--pffb-ease) both; animation-delay: calc(var(--i, 0) * 70ms + 180ms); }
.pffb--enter-fade .pffb-rise { animation: pffb-fade .6s ease both; animation-delay: calc(var(--i, 0) * 60ms + 100ms); }

@keyframes pffb-reveal {
	from { clip-path: inset(0 0 100% 0); }
	to   { clip-path: inset(0 0 0 0); }
}
@keyframes pffb-rise-up {
	from { transform: translate(-50%, 160%); }
	to   { transform: translate(-50%, 0); }
}
@keyframes pffb-in {
	from { opacity: 0; transform: translateY(-12px); }
	to   { opacity: 1; transform: none; }
}
@keyframes pffb-fade { from { opacity: 0; } }

/* Settings-page "Replay": drop every animation for one frame so they all restart */
.pffb.is-replay, .pffb.is-replay * { animation: none !important; }

/* ---------- Close animation (height is set by the script) ---------- */
.pffb.is-leaving { animation: none; overflow: hidden; transition: height .45s var(--pffb-ease), opacity .3s ease; opacity: 0; }
.pffb--bottom.is-leaving { transition: transform .45s var(--pffb-ease), opacity .35s ease; transform: translate(-50%, 160%); }

/* ---------- Responsive (container queries, so the settings-page preview matches too) ---------- */
@container pffb (max-width: 1140px) {
	.pffb__code-label { display: none; }
	.pffb__inner { gap: 10px 22px; }
	.pffb__deal { gap: 12px; }
}
@container pffb (max-width: 1060px) {
	.pffb__headline-d { display: none; }
	.pffb__headline-m { display: inline; }
}
@container pffb (max-width: 980px) {
	.pffb__cd-label,
	.pffb__unit--s { display: none; }
}
/* Tablets and phones stay on one line: the pieces a visitor needs to act (offer, code, button, close) stay,
   the rest drops out as the bar narrows. */
@container pffb (max-width: 860px) {
	.pffb__inner { min-height: 52px; padding: 8px 46px 8px 16px; gap: 12px; flex-wrap: nowrap; }
	.pffb__lead { flex: 0 1 auto; gap: 10px; }
	.pffb__deal { gap: 10px; }
	.pffb__book { display: none; }
	.pffb a.pffb__cta { padding: 7px 6px 7px 12px; font-size: 13px; line-height: 18px; }
	.pffb__cta svg { width: 18px; height: 18px; }
	.pffb__chip { min-width: 0; padding: 7px 9px; font-size: 12px; }
	.pffb__unit { padding: 5px; }
	.pffb__unit b { font-size: 12px; }
}
@container pffb (max-width: 700px) {
	.pffb__cd { display: none; }
}
@container pffb (max-width: 600px) {
	.pffb__badge,
	.pffb__chip-icon--copy { display: none; }
	.pffb__inner { justify-content: space-between; min-height: 48px; padding: 6px 42px 6px 12px; gap: 8px; }
	.pffb__lead { flex: 1 1 auto; }
	.pffb .pffb__headline { font-size: 14px; letter-spacing: -.02em; }
	.pffb__deal { gap: 8px; }
	.pffb .pffb__close { right: 6px; }
}
@container pffb (max-width: 400px) {
	.pffb__inner { padding-left: 10px; gap: 6px; }
	.pffb .pffb__headline { font-size: 13px; }
	.pffb__deal { gap: 6px; }
	.pffb a.pffb__cta { padding: 7px 10px; }
	.pffb__cta svg { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.pffb, .pffb *, .pffb *::before, .pffb *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: .01ms !important;
	}
	.pffb__aurora, .pffb__sparkles, .pffb__edge, .pffb--shine .pffb__cta::after { display: none !important; }
	.pffb .pffb__hl::after { transform: scaleX(1); }
}
