/*
 * Floating cart FAB — bottom-right corner sticky cart with badge.
 *
 * IMMUTABLE — wydzielony plik per user mandate 2026-05-28:
 * "wydziel te style do pliku jak ten header icons css zeby go nic nie dotykalo".
 *
 * Markup w site-header.php (linia ~189) + page-strona-glowna.php (parytet inline).
 * Inline SVG (NIE Material Symbols / Font Awesome) per memory feedback_no_emoji_icons_use_bg_images.
 *
 * Scope: globalny. Specyficzność wystarczająco wysoka żeby przejść home.css / shop-archive.css
 * cascade bez zewnętrznych override.
 */

.gk-floating-cart {
	position: fixed !important;
	bottom: 24px;
	right: 24px;
	z-index: 100 !important;
	width: 60px !important;
	height: 60px !important;
	background: #1F3D14 !important;
	color: #fff !important;
	border-radius: 9999px !important;
	display: inline-flex; /* NIE !important — żeby inline style="display:none" wygrał gdy cart pusty */
	align-items: center !important;
	justify-content: center !important;
	text-decoration: none !important;
	cursor: pointer !important;
	border: 0 !important;
	/* Layered shadow — visible na ciemnym i jasnym tle */
	box-shadow:
		0 0 15px 0 rgba(190, 190, 190, 0.55),
		0 0 32px 4px rgba(190, 190, 190, 0.35),
		0 8px 24px rgba(0, 0, 0, 0.22),
		0 16px 40px rgba(0, 0, 0, 0.16) !important;
	transition:
		transform .25s cubic-bezier(.16,1,.3,1),
		box-shadow .25s ease,
		background .25s ease !important;
	will-change: transform;
	animation: gk-floating-cart-enter .45s cubic-bezier(.16,1,.3,1);
}

@keyframes gk-floating-cart-enter {
	from { transform: translateY(20px) scale(0.85); opacity: 0; }
	to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Radar wave — soft pulse co 5s, GPU-friendly (tylko transform + opacity) */
.gk-floating-cart::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 9999px;
	border: 2px solid rgba(93, 169, 53, 0.50);
	pointer-events: none;
	opacity: 0;
	will-change: transform, opacity;
	animation: gk-floating-cart-radar 3.6s ease-out 2s infinite;
}

@keyframes gk-floating-cart-radar {
	0%   { transform: scale(1);   opacity: 0; }
	15%  { opacity: 0.6; }
	60%  { transform: scale(1.5); opacity: 0; }
	100% { transform: scale(1.5); opacity: 0; }
}

.gk-floating-cart:hover {
	background: #5DA935 !important;
	transform: translateY(-2px) scale(1.04);
	box-shadow:
		0 0 18px 2px rgba(190, 190, 190, 0.70),
		0 0 40px 6px rgba(190, 190, 190, 0.45),
		0 10px 28px rgba(0, 0, 0, 0.28),
		0 20px 48px rgba(0, 0, 0, 0.22) !important;
}
.gk-floating-cart:hover::before {
	animation-play-state: paused;
	opacity: 0;
}

.gk-floating-cart:active {
	transform: scale(0.96);
}

.gk-floating-cart:focus-visible {
	outline: 2px solid #5DA935;
	outline-offset: 4px;
}

/* SVG icon — inline, immutable size */
.gk-floating-cart__icon-svg {
	width: 26px !important;
	height: 26px !important;
	display: block !important;
	flex-shrink: 0 !important;
	color: #fff !important;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2 !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
	pointer-events: none !important;
}

/* Badge counter — accent green w prawym górnym rogu FAB.
   Solidne kolory (zero rgba na text) per memory feedback_no_transparent_font_colors. */
.gk-floating-cart .gk-floating-cart__badge {
	position: absolute !important;
	top: -2px !important;
	right: -2px !important;
	min-width: 22px !important;
	height: 22px !important;
	padding: 0 6px !important;
	background: #5DA935 !important;
	color: #ffffff !important;
	font-family: 'Inter', 'Open Sans', system-ui, -apple-system, sans-serif !important;
	font-size: 12px !important;
	font-weight: 800 !important;
	border-radius: 9999px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow:
		0 2px 8px rgba(93, 169, 53, 0.40),
		0 0 0 2px #ffffff !important;
	line-height: 1 !important;
	transition: transform .25s cubic-bezier(.16,1,.3,1);
	border: 0 !important;
}

/* Bump animation gdy cart count updates (added_to_cart event w main.js) */
.gk-floating-cart.is-bumped .gk-floating-cart__badge {
	animation: gk-floating-cart-badge-bump .6s cubic-bezier(.16,1,.3,1);
}

@keyframes gk-floating-cart-badge-bump {
	0%   { transform: scale(1); }
	35%  { transform: scale(1.35); }
	60%  { transform: scale(0.92); }
	100% { transform: scale(1); }
}

/* Reduced motion — wyłącz wszystkie idle animacje */
@media (prefers-reduced-motion: reduce) {
	.gk-floating-cart,
	.gk-floating-cart::before,
	.gk-floating-cart__badge {
		animation: none !important;
	}
}

/* Mobile — smaller + bliżej krawędzi */
@media (max-width: 640px) {
	.gk-floating-cart {
		width: 54px !important;
		height: 54px !important;
		bottom: 16px;
		right: 16px;
	}
	.gk-floating-cart__icon-svg {
		width: 24px !important;
		height: 24px !important;
	}
	.gk-floating-cart .gk-floating-cart__badge {
		min-width: 20px !important;
		height: 20px !important;
		font-size: 11px !important;
		top: -3px !important;
		right: -3px !important;
	}
}
