/* KwiatAnki – animacja „pakujemy bukiet” */
.ka-pack {
	position: fixed; inset: 0; z-index: 100000;
	display: grid; place-items: center; padding: 16px;
	background: rgba(8, 8, 8, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
	opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
	font-family: inherit;
}
.ka-pack.is-open { opacity: 1; visibility: visible; }
html.ka-pack-lock { overflow: hidden; }

.ka-pack__card {
	position: relative; width: 100%; max-width: 360px; padding: 30px 26px 24px; text-align: center;
	background: radial-gradient(120% 90% at 50% 0%, rgba(var(--ka-c1-rgb,224,72,95),.16), transparent 60%), var(--ka-s1,#141414);
	border: 1px solid rgba(var(--ka-ln-rgb,255,255,255),.09); border-radius: 26px; color: var(--ka-tx,#f3eee8);
	box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
	transform: translateY(16px) scale(.96); transition: transform .4s cubic-bezier(.2, .9, .3, 1.2);
}
.ka-pack.is-open .ka-pack__card { transform: none; }

.ka-pack__close {
	position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; padding: 0;
	border: 0; border-radius: 50%; background: rgba(var(--ka-ln-rgb,255,255,255),.06); color: var(--ka-tx,#f3eee8);
	font-size: 22px; line-height: 34px; cursor: pointer;
}
.ka-pack__close:hover { background: rgba(var(--ka-ln-rgb,255,255,255),.14); }

.ka-pack__stage { position: relative; width: 170px; height: 170px; margin: 0 auto 8px; }
.ka-pack__svg { width: 100%; height: 100%; overflow: visible; }
.ka-pack__svg * { transform-box: view-box; }

/* Initial (hidden) states */
.ka-pack__flowers, .ka-pack__paper, .ka-pack__ribbon, .ka-pack__spark { opacity: 0; }
.ka-pack__bloom { transform-origin: 100px 85px; }

/* Sequence */
.ka-pack.is-open .ka-pack__flowers { animation: kp-drop .6s cubic-bezier(.2, .9, .3, 1.3) .1s both; }
.ka-pack.is-open .ka-pack__bloom--1 { animation: kp-pop .45s ease .35s both; }
.ka-pack.is-open .ka-pack__bloom--2 { animation: kp-pop .45s ease .45s both; }
.ka-pack.is-open .ka-pack__bloom--3 { animation: kp-pop .45s ease .55s both; }
.ka-pack__paper { transform-origin: 100px 178px; }
.ka-pack.is-open .ka-pack__paper--l { animation: kp-wrap-l .55s cubic-bezier(.2, .9, .3, 1.1) .8s both; }
.ka-pack.is-open .ka-pack__paper--r { animation: kp-wrap-r .55s cubic-bezier(.2, .9, .3, 1.1) 1s both; }
.ka-pack__ribbon { transform-origin: 100px 150px; }
.ka-pack.is-open .ka-pack__ribbon { animation: kp-ribbon .5s cubic-bezier(.2, .9, .3, 1.6) 1.45s both; }
.ka-pack.is-open .ka-pack__spark { animation: kp-spark 1.2s ease 1.8s infinite both; }
.ka-pack.is-done .ka-pack__svg { animation: kp-wiggle .6s ease both; transform-origin: 50% 100%; }

@keyframes kp-drop { from { opacity: 0; transform: translateY(-46px); } to { opacity: 1; transform: none; } }
@keyframes kp-pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes kp-wrap-l { from { opacity: 0; transform: translateX(-34px) rotate(-28deg); } to { opacity: 1; transform: none; } }
@keyframes kp-wrap-r { from { opacity: 0; transform: translateX(34px) rotate(28deg); } to { opacity: 1; transform: none; } }
@keyframes kp-ribbon { from { opacity: 0; transform: scale(0) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes kp-spark { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes kp-wiggle { 25% { transform: rotate(-5deg); } 50% { transform: rotate(4deg); } 75% { transform: rotate(-2deg); } }

/* Check badge */
.ka-pack__check {
	position: absolute; right: 18px; bottom: 16px; display: grid; place-items: center;
	width: 42px; height: 42px; border-radius: 50%; background: var(--ka-c1,#e0485f);
	box-shadow: 0 0 0 5px var(--ka-s1,#141414), 0 10px 24px -6px rgba(var(--ka-c1-rgb,224,72,95),.8);
	transform: scale(0); transition: transform .45s cubic-bezier(.2, .9, .3, 1.6);
}
.ka-pack.is-done .ka-pack__check { transform: scale(1); }

.ka-pack__title { margin: 0 0 16px; font-size: 20px; line-height: 1.3; font-weight: 600; color: var(--ka-tx,#f3eee8); min-height: 26px; }

.ka-pack__bar { height: 4px; margin: 0 auto 6px; max-width: 220px; border-radius: 4px; background: rgba(var(--ka-ln-rgb,255,255,255),.1); overflow: hidden; transition: opacity .3s ease, height .3s ease, margin .3s ease; }
.ka-pack__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ka-c2,#f28ca0), var(--ka-c1,#e0485f)); }
.ka-pack.is-open .ka-pack__bar span { animation: kp-bar 2s ease-in-out .1s forwards; }
.ka-pack.is-done .ka-pack__bar { opacity: 0; height: 0; margin: 0; }
@keyframes kp-bar { to { width: 100%; } }

.ka-pack__actions {
	display: grid; gap: 10px; max-height: 0; opacity: 0; overflow: hidden;
	transition: max-height .45s ease, opacity .35s ease .1s;
}
.ka-pack.is-done .ka-pack__actions { max-height: 140px; opacity: 1; }
.ka-pack__btn {
	display: block; width: 100%; padding: 14px 18px; border-radius: 999px; cursor: pointer;
	font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; text-decoration: none !important;
	transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.ka-pack__btn--primary { background: var(--ka-c1,#e0485f); color: #fff !important; border: 1px solid var(--ka-c1,#e0485f); }
.ka-pack__btn--primary:hover { background: #c93a50; }
.ka-pack__btn--ghost { background: transparent; color: var(--ka-tx,#f3eee8); border: 1px solid rgba(255, 255, 255, .22); }
.ka-pack__btn--ghost:hover { border-color: var(--ka-tx,#f3eee8); }

@media (prefers-reduced-motion: reduce) {
	.ka-pack *, .ka-pack { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}

/* Gdy działa animacja pakowania, chowamy popup WoodMart „Produkt został dodany do koszyka” */
body.ka-pack-on .popup-added_to_cart,
body.ka-pack-on .wd-popup-added_to_cart { display: none !important; }
