/* Mobile Bottom Navigation V4 — wave-staggered floating bubbles */

.mobile-bottom-nav.mbnav-v4 {
	display: none;
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 1000;
	padding: 0 10px calc(6px + env(safe-area-inset-bottom, 0px));
	background: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bg, transparent);
	box-shadow: none;
	border: none;
	pointer-events: none;
	color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-text, color-mix(in srgb, var(--primary-background-color) 94%, var(--primary-brand-color)));
}

.mbnav-v4__arc {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	width: 100%;
	height: 28px;
	opacity: 0.55;
	pointer-events: none;
}

.mbnav-v4__wave {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 4px;
	max-width: 420px;
	margin: 0 auto;
	padding: 0 4px 2px;
	pointer-events: auto;
}

.mbnav-v4__bubble {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	margin-bottom: 6px;
	text-decoration: none;
	color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-text, color-mix(in srgb, var(--primary-text-color) 70%, var(--primary-brand-color)));
	transition: transform 0.24s ease, color 0.24s ease, margin-bottom 0.24s ease;
}

.mbnav-v4__bubble:nth-child(2) {
	margin-bottom: 12px;
}

.mbnav-v4__bubble:nth-child(3),
.mbnav-v4__bubble--peak {
	margin-bottom: 20px;
}

.mbnav-v4__bubble:nth-child(4) {
	margin-bottom: 12px;
}

.mbnav-v4__bubble:nth-child(5) {
	margin-bottom: 6px;
}

.mbnav-v4__bubble-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	font-size: 18px;
	line-height: 1;
	background: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-inner-bg, color-mix(in srgb, var(--primary-background-color) 92%, transparent));
	border: 1px solid var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-inner-border, color-mix(in srgb, var(--primary-brand-color) 18%, transparent));
	box-shadow:
		0 8px 20px rgba(0, 0, 0, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.5);
	transition: background 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.mbnav-v4__bubble--peak .mbnav-v4__bubble-inner {
	width: 54px;
	height: 54px;
	font-size: 20px;
	border-width: 2px;
	border-color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-inner-border-2, color-mix(in srgb, var(--primary-brand-color) 35%, transparent));
	box-shadow:
		0 12px 26px color-mix(in srgb, var(--primary-brand-color) 24%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.mbnav-v4__bubble:hover .mbnav-v4__bubble-inner,
.mbnav-v4__bubble:active .mbnav-v4__bubble-inner {
	transform: translateY(-2px);
	border-color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-inner-hover-border, color-mix(in srgb, var(--primary-brand-color) 40%, transparent));
}

.mbnav-v4__bubble.is-active {
	color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-is-active-text, var(--primary-brand-color));
}

.mbnav-v4__bubble.is-active .mbnav-v4__bubble-inner {
	background: linear-gradient(
		160deg,
		color-mix(in srgb, var(--primary-brand-color) 88%, #fff 12%),
		color-mix(in srgb, var(--secondary-brand-color) 82%, #000 18%)
	);
	border-color: transparent;
	color: var(--sc-mobile-bottom-nav-v4-mbnav-v4-bubble-inner-text, var(--primary-button-text-color));
	box-shadow:
		0 10px 24px color-mix(in srgb, var(--primary-brand-color) 36%, transparent),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mbnav-v4__bubble .mobile-cart-count,
.mbnav-v4__bubble .mobile-favorite-count {
	position: absolute;
	top: -2px;
	inset-inline-end: -2px;
	inset-inline-start: auto;
	right: auto;
	left: auto;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 700;
	line-height: 1;
	border: 2px solid var(--sc-mobile-bottom-nav-v4-mobile-cart-count-border, var(--primary-background-color));
	z-index: 2;
	width: auto;
}

.mbnav-v4__bubble .mobile-cart-count {
	background: var(--sc-mobile-bottom-nav-v4-mobile-cart-count-bg, var(--primary-brand-color));
	color: var(--sc-mobile-bottom-nav-v4-mobile-cart-count-text, var(--primary-button-text-color));
}

.mbnav-v4__bubble .mobile-favorite-count {
	background: var(--sc-mobile-bottom-nav-v4-mobile-favorite-count-bg, var(--heart-icon-filled-color));
	color: var(--sc-mobile-bottom-nav-v4-mobile-favorite-count-text, var(--primary-button-text-color));
}

.mobile-bottom-nav.mbnav-v4.hide-when-fixed-bar-hidden {
	display: none;
}

.mobile-bottom-nav.mbnav-v4.show-with-fixed-bar {
	display: block;
}

@media (max-width: 768px) {
	.mobile-bottom-nav.mbnav-v4 {
		display: block;
	}

	.mobile-bottom-nav.mbnav-v4.hide-when-fixed-bar-hidden {
		display: none;
	}

	.mobile-bottom-nav.mbnav-v4.show-with-fixed-bar {
		display: block;
	}
}

@media (max-width: 380px) {
	.mbnav-v4__wave {
		max-width: 100%;
		gap: 2px;
		padding-inline: 0;
	}

	.mbnav-v4__bubble {
		width: 42px;
		height: 42px;
	}

	.mbnav-v4__bubble--peak .mbnav-v4__bubble-inner {
		width: 48px;
		height: 48px;
		font-size: 18px;
	}

	.mbnav-v4__bubble-inner {
		font-size: 16px;
	}
}

[dir='rtl'] .mbnav-v4__bubble .mobile-cart-count,
[dir='rtl'] .mbnav-v4__bubble .mobile-favorite-count {
	inset-inline-end: auto;
	inset-inline-start: -2px;
}

@media (prefers-reduced-motion: reduce) {
	.mbnav-v4__bubble,
	.mbnav-v4__bubble-inner {
		transition: none;
	}
}
