/**
 * Persistent Cart Bar
 * A single, unmistakable path to the cart + checkout so it is never lost
 * among the chat / rewards launchers. Bottom bar on mobile, top-right pill
 * on desktop. Dark rave glass with a rainbow edge and a bright checkout CTA.
 */

.rcc-cartbar {
	--rcc-cb-rainbow: linear-gradient(90deg, #7c3aed 0%, #ec4899 45%, #06b6d4 100%);
	position: fixed;
	z-index: 999993; /* above chat (…992) + rewards, below the cart sidebar overlay (…994) */
	display: none;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.rcc-cartbar *,
.rcc-cartbar *::before,
.rcc-cartbar *::after {
	box-sizing: border-box;
}

.rcc-cartbar--visible {
	display: flex;
}

/* ── Left region: view cart (icon + count + total) ─────────────── */

.rcc-cartbar__view {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	margin: 0;
	background: transparent;
	color: #ffffff;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
	text-align: left;
}

/* Make the view region read as tappable (it opens the sidebar cart). */
.rcc-cartbar__view:hover .rcc-cartbar__icon {
	transform: scale(1.06);
	filter: brightness(1.12);
}
.rcc-cartbar__view:active {
	transform: scale(0.98);
}

.rcc-cartbar__body {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.rcc-cartbar__icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	flex-shrink: 0;
	border-radius: 50%;
	color: #ffffff;
	background: linear-gradient(135deg, rgba(124, 58, 237, 0.55), rgba(6, 182, 212, 0.45));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.rcc-cartbar__badge {
	position: absolute;
	top: -5px;
	right: -6px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--rcc-cb-rainbow);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 20px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
}

.rcc-cartbar__meta {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
	min-width: 0;
}

.rcc-cartbar__count {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: rgba(255, 255, 255, 0.72);
	text-transform: uppercase;
}

.rcc-cartbar__total {
	font-size: 17px;
	font-weight: 800;
	color: #ffffff;
	white-space: nowrap;
}

.rcc-cartbar__total .woocommerce-Price-amount { color: #ffffff; }

/* ── Right region: checkout CTA ────────────────────────────────── */

.rcc-cartbar__checkout {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	padding: 12px 20px;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	background: linear-gradient(135deg, #a21cff 0%, #ec4899 55%, #06b6d4 100%);
	background-size: 180% 180%;
	border: 1px solid rgba(0, 0, 0, 0.35);
	box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
	transition: transform 0.15s ease, box-shadow 0.2s ease, background-position 0.4s ease;
	white-space: nowrap;
}

.rcc-cartbar__checkout:hover {
	color: #fff;
	transform: translateY(-1px);
	background-position: 100% 0;
	box-shadow: 0 9px 26px rgba(168, 85, 247, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.rcc-cartbar__checkout svg { flex-shrink: 0; }

/* ── Entrance + add-to-cart pop ────────────────────────────────── */

@keyframes rccCartBarPop {
	0%   { transform: scale(1); }
	35%  { transform: scale(1.05); }
	100% { transform: scale(1); }
}

.rcc-cartbar--pop .rcc-cartbar__icon {
	animation: rccCartBarPop 0.5s ease;
}

.rcc-cartbar--pop .rcc-cartbar__badge {
	animation: rccCartBarPop 0.5s ease;
}

/* ── MOBILE: full-width sticky bottom bar (default) ────────────── */

.rcc-cartbar {
	left: 12px;
	right: 12px;
	bottom: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	padding: 10px 12px 10px 14px;
	border-radius: 18px;
	background:
		linear-gradient(165deg, rgba(25, 10, 48, 0.96) 0%, rgba(15, 3, 38, 0.97) 100%);
	border: 1px solid rgba(255, 255, 255, 0.10);
	box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	overflow: hidden;
	transform: translateY(140%);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

/* Rainbow top edge. */
.rcc-cartbar::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--rcc-cb-rainbow);
	opacity: 0.9;
	pointer-events: none; /* decorative — must never intercept clicks */
}

.rcc-cartbar--visible {
	transform: translateY(0);
	opacity: 1;
}

/* Lift the chat + rewards launchers clear of the bottom bar. */
@media (max-width: 900px) {
	body.rcc-cartbar-active {
		--sai-sticky-offset: 86px;
		--rcrr-sticky-offset: 86px;
	}
}

/* ── DESKTOP: compact pill, top-right where the eye expects a cart ─ */

@media (min-width: 901px) {
	.rcc-cartbar {
		left: auto;
		right: 22px;
		bottom: auto;
		top: 92px;
		width: auto;
		max-width: 380px;
		gap: 14px;
		padding: 10px 12px 10px 16px;
		border-radius: 999px;
		background:
			linear-gradient(135deg, rgba(25, 10, 48, 0.95) 0%, rgba(15, 3, 38, 0.96) 100%);
		border: 1px solid rgba(255, 255, 255, 0.12);
		box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 229, 255, 0.06);
		backdrop-filter: blur(14px);
		-webkit-backdrop-filter: blur(14px);
		overflow: visible;
		transform: translateX(140%);
		opacity: 0;
		transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
	}

	/* Rainbow ring instead of a top edge on the pill. */
	.rcc-cartbar::before {
		content: "";
		position: absolute;
		inset: -1px;
		border-radius: 999px;
		padding: 1px;
		background: var(--rcc-cb-rainbow);
		-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
		-webkit-mask-composite: xor;
		mask-composite: exclude;
		opacity: 0.55;
		height: auto;
		pointer-events: none; /* decorative ring — must never intercept clicks */
	}

	.rcc-cartbar--visible {
		transform: translateX(0);
		opacity: 1;
	}

	.rcc-cartbar__total { font-size: 16px; }
	.rcc-cartbar__checkout { padding: 11px 18px; font-size: 14px; }
}

/* When the bar is showing, the small floating cart icon is redundant —
   let the bar be the one clear cart element. */
body.rcc-cartbar-active .rcc-cart-icon {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.rcc-cartbar { transition: opacity 0.2s ease; transform: none; }
	.rcc-cartbar--pop .rcc-cartbar__icon,
	.rcc-cartbar--pop .rcc-cartbar__badge { animation: none; }
}
