/**
 * IdeaPlugins — Free Shipping Bar
 * Public (storefront) stylesheet. Mobile-first, premium effects.
 */

.ideap-fsb-bar-wrapper {
	--ideap-fsb-bg: #eef0f4;
	--ideap-fsb-fill-start: #6C5CE7;
	--ideap-fsb-fill-end: #00CEC9;
	--ideap-fsb-text: #1d1d1f;
	--ideap-fsb-success: #00b894;
	--ideap-fsb-radius: 12px;
	--ideap-fsb-height: 14px;

	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 0 20px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: calc(var(--ideap-fsb-radius) + 6px);
	box-shadow: 0 2px 10px rgba(20, 20, 43, 0.05);
	font-family: inherit;
	position: relative;
	overflow: hidden;
}

/* Constrain the embedded bar on the cart & checkout pages to the site's
   normal content width — some themes render the "before cart" / "before
   checkout form" hooks outside the page's boxed container, making the bar
   stretch edge-to-edge otherwise. The mini-cart and shortcode contexts are
   intentionally excluded (mini-cart should always fill its widget; the
   shortcode is placed by hand inside already-constrained page content),
   and the floating bar already has its own fixed, centered width below.
   Override --ideap-fsb-content-max-width in your theme/child-theme CSS if
   your site's container uses a different width. */
.ideap-fsb-context-cart,
.ideap-fsb-context-checkout {
	--ideap-fsb-content-max-width: 1200px;
	--ideap-fsb-content-side-gutter: 20px;

	width: calc(100% - (var(--ideap-fsb-content-side-gutter) * 2));
	max-width: var(--ideap-fsb-content-max-width);
	margin-left: auto;
	margin-right: auto;
}

.ideap-fsb-bar-wrapper * {
	box-sizing: border-box;
}

.ideap-fsb-bar-message {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ideap-fsb-text);
	margin-bottom: 10px;
	line-height: 1.4;
}

.ideap-fsb-icon {
	font-size: 18px;
	flex-shrink: 0;
	display: inline-block;
}

.ideap-fsb-bar-wrapper.is-reached .ideap-fsb-icon {
	animation: ideapFsbBounce 0.6s ease;
}

.ideap-fsb-message-text {
	flex: 1;
	min-width: 0;
}

.ideap-fsb-message-text .woocommerce-Price-amount {
	font-weight: 700;
}

.ideap-fsb-bar-track {
	position: relative;
	width: 100%;
	height: var(--ideap-fsb-height);
	background: var(--ideap-fsb-bg);
	border-radius: var(--ideap-fsb-radius);
	overflow: hidden;
}

.ideap-fsb-bar-fill {
	position: relative;
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--ideap-fsb-fill-start), var(--ideap-fsb-fill-end));
	border-radius: var(--ideap-fsb-radius);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}

.ideap-fsb-no-animation .ideap-fsb-bar-fill {
	transition: none;
}

.ideap-fsb-style-solid .ideap-fsb-bar-fill {
	background: var(--ideap-fsb-fill-start);
}

.ideap-fsb-style-striped .ideap-fsb-bar-fill {
	background-image: repeating-linear-gradient(
		45deg,
		var(--ideap-fsb-fill-start),
		var(--ideap-fsb-fill-start) 10px,
		var(--ideap-fsb-fill-end) 10px,
		var(--ideap-fsb-fill-end) 20px
	);
	background-size: 200% 200%;
	animation: ideapFsbStripeMove 1.2s linear infinite;
}

@keyframes ideapFsbStripeMove {
	from { background-position: 0 0; }
	to   { background-position: 40px 0; }
}

/* Shine sweep effect on the fill */
.ideap-fsb-bar-fill::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		transparent 20%,
		rgba(255, 255, 255, 0.35) 40%,
		transparent 60%
	);
	background-size: 200% 100%;
	animation: ideapFsbShine 2.6s ease-in-out infinite;
}

@keyframes ideapFsbShine {
	0%   { background-position: 150% 0; }
	100% { background-position: -50% 0; }
}

.ideap-fsb-bar-percent {
	font-size: 10px;
	font-weight: 700;
	color: #fff;
	padding-right: 8px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	white-space: nowrap;
}

/* Reached state */
.ideap-fsb-bar-wrapper.is-reached .ideap-fsb-bar-fill {
	background: var(--ideap-fsb-success) !important;
	animation: none;
}

.ideap-fsb-bar-wrapper.is-reached .ideap-fsb-message-text {
	color: var(--ideap-fsb-success);
}

/* Pulse glow when nearing the goal */
.ideap-fsb-bar-wrapper.is-near-goal .ideap-fsb-bar-track {
	animation: ideapFsbPulseGlow 1.4s ease-in-out infinite;
}

@keyframes ideapFsbPulseGlow {
	0%, 100% { box-shadow: 0 0 0 rgba(108, 92, 231, 0); }
	50%      { box-shadow: 0 0 14px rgba(108, 92, 231, 0.55); }
}

@keyframes ideapFsbBounce {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.35); }
	100% { transform: scale(1); }
}

/* Mini-cart context: tighter spacing */
.ideap-fsb-context-mini_cart {
	margin: 0 0 14px;
	padding: 10px 12px;
	box-shadow: none;
	border-radius: 10px;
}

.ideap-fsb-context-mini_cart .ideap-fsb-bar-message {
	font-size: 12.5px;
	margin-bottom: 7px;
}

/* Close button (floating bar) */
.ideap-fsb-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: var(--ideap-fsb-text);
	opacity: 0.5;
	cursor: pointer;
	padding: 4px;
}

.ideap-fsb-close:hover {
	opacity: 1;
}

/* Floating site-wide bar */
.ideap-fsb-floating {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	width: min(560px, calc(100% - 24px));
	margin: 0;
	box-shadow: 0 10px 30px rgba(20, 20, 43, 0.18);
	animation: ideapFsbSlideIn 0.4s ease;
}

.ideap-fsb-floating--bottom {
	bottom: 16px;
}

.ideap-fsb-floating--top {
	top: 16px;
}

@keyframes ideapFsbSlideIn {
	from { opacity: 0; transform: translate(-50%, 12px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.ideap-fsb-floating.ideap-fsb-hidden {
	display: none;
}

/* Confetti canvas layer, injected by JS on success */
.ideap-fsb-confetti-canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 999999;
}

/* --- Mobile-first responsive rules --- */

@media (max-width: 480px) {
	.ideap-fsb-bar-wrapper {
		padding: 12px 14px;
		border-radius: 14px;
	}

	.ideap-fsb-bar-message {
		font-size: 12.5px;
		gap: 6px;
	}

	.ideap-fsb-icon {
		font-size: 16px;
	}

	.ideap-fsb-bar-track {
		height: max(10px, var(--ideap-fsb-height, 14px));
	}

	.ideap-fsb-floating {
		width: calc(100% - 16px);
	}

	.ideap-fsb-floating--bottom {
		bottom: 8px;
	}

	.ideap-fsb-floating--top {
		top: 8px;
	}

	.ideap-fsb-bar-percent {
		font-size: 9px;
	}
}

@media (min-width: 481px) and (max-width: 782px) {
	.ideap-fsb-bar-wrapper {
		padding: 13px 15px;
	}
	.ideap-fsb-bar-message {
		font-size: 13.5px;
	}
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ideap-fsb-bar-fill,
	.ideap-fsb-bar-track,
	.ideap-fsb-icon,
	.ideap-fsb-floating {
		animation: none !important;
		transition: none !important;
	}
	.ideap-fsb-bar-fill::after {
		display: none;
	}
}
