/* Little Journal Club — cart motivators. Themed to the shop (pink, papercraft). */

.ljc-cg {
	--ljc-cg-accent: #cc3366;
	--ljc-cg-ink: #2b2b33;
	--ljc-cg-paper: #fffdf9;
	--ljc-cg-track: #f0e7ea;
	--ljc-cg-ok: #3aa76d;
	margin: 0 0 20px;
	display: grid;
	gap: 12px;
}

.ljc-cg:not(.is-active) {
	display: none;
}

.ljc-cg__goal {
	position: relative;
	background: var(--ljc-cg-paper);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 14px;
	padding: 14px 16px 16px;
	box-shadow: 0 6px 18px rgba(204, 51, 102, 0.08);
	overflow: visible;
}

/* "tape" variant — a washi strip pinning the card like a scrapbook note. */
.ljc-cg--tape .ljc-cg__goal {
	transform: rotate(-0.4deg);
}

.ljc-cg--tape .ljc-cg__goal::before {
	content: "";
	position: absolute;
	top: -9px;
	left: 24px;
	width: 74px;
	height: 20px;
	background: var(--ljc-cg-accent);
	opacity: 0.55;
	transform: rotate(-4deg);
	border-radius: 2px;
	-webkit-mask-image: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px);
	mask-image: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px);
}

.ljc-cg__row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.ljc-cg__icon {
	font-size: 20px;
	line-height: 1;
	flex: 0 0 auto;
}

.ljc-cg__msg {
	font-size: 15px;
	font-weight: 600;
	color: var(--ljc-cg-ink);
	letter-spacing: 0.1px;
}

.ljc-cg__track {
	position: relative;
	height: 12px;
	border-radius: 999px;
	background: var(--ljc-cg-track);
	overflow: hidden;
}

.ljc-cg__fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, color-mix(in srgb, var(--ljc-cg-accent) 70%, #fff), var(--ljc-cg-accent));
	background-size: 200% 100%;
	transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
	animation: ljc-cg-shift 2.4s linear infinite;
}

/* Barber-pole shimmer so the bar feels alive while below goal. */
.ljc-cg__fill::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.22) 0 10px, transparent 10px 20px);
	animation: ljc-cg-stripe 0.9s linear infinite;
}

@keyframes ljc-cg-shift {
	0% { background-position: 0 0; }
	100% { background-position: 200% 0; }
}

@keyframes ljc-cg-stripe {
	0% { background-position: 0 0; }
	100% { background-position: 28px 0; }
}

/* Unlocked: fill turns celebratory, stripes stop, message pops. */
.ljc-cg__goal.is-unlocked .ljc-cg__fill {
	background: linear-gradient(90deg, color-mix(in srgb, var(--ljc-cg-ok) 65%, #fff), var(--ljc-cg-ok));
	animation: none;
}

.ljc-cg__goal.is-unlocked .ljc-cg__fill::after {
	animation: none;
	opacity: 0.35;
}

.ljc-cg__goal.is-unlocked .ljc-cg__msg {
	color: var(--ljc-cg-ok);
}

.ljc-cg__goal.just-unlocked {
	animation: ljc-cg-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ljc-cg-pop {
	0% { transform: scale(1); }
	45% { transform: scale(1.035) rotate(-0.4deg); }
	100% { transform: scale(1); }
}

/* Confetti burst injected on unlock. */
.ljc-cg__confetti {
	position: absolute;
	top: 6px;
	left: 50%;
	width: 0;
	height: 0;
	pointer-events: none;
}

.ljc-cg__confetti span {
	position: absolute;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--ljc-cg-accent);
	opacity: 0;
	animation: ljc-cg-confetti 1.1s ease-out forwards;
	animation-delay: calc(var(--i) * 12ms);
	transform-origin: center;
}

.ljc-cg__confetti span:nth-child(3n) { background: var(--ljc-cg-ok); }
.ljc-cg__confetti span:nth-child(3n+1) { background: #f4b400; }

@keyframes ljc-cg-confetti {
	0% { opacity: 1; transform: translate(0, 0) rotate(0); }
	100% {
		opacity: 0;
		transform: translate(calc((var(--i) - 7) * 16px), -46px) rotate(320deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ljc-cg__fill,
	.ljc-cg__fill::after,
	.ljc-cg__goal.just-unlocked,
	.ljc-cg__confetti span {
		animation: none !important;
		transition: none !important;
	}
}
