/* Mobile Bottom Navigation V5 — full-width segmented ledger strip */

.mobile-bottom-nav.mbnav-v5 {
	display: none;
	position: fixed;
	inset-inline: 0;
	bottom: 0;
	z-index: 1000;
	padding: 0;
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-bg, transparent);
	box-shadow: none;
	border: none;
}

.mbnav-v5__ledger {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: stretch;
	width: 100%;
	min-height: calc(54px + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-ledger-bg, var(--primary-background-color));
	border-top: 1px solid var(--sc-mobile-bottom-nav-v5-mbnav-v5-ledger-border-top, color-mix(in srgb, var(--primary-text-color) 12%, transparent));
	box-shadow:
		0 -1px 0 color-mix(in srgb, var(--primary-brand-color) 28%, transparent),
		inset 0 8px 16px rgba(0, 0, 0, 0.04);
}

.mbnav-v5__seg {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 8px 4px;
	text-decoration: none;
	color: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-text, color-mix(in srgb, var(--primary-text-color) 58%, transparent));
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-bg, transparent);
	border-inline-end: 1px solid var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-border-inline-end, color-mix(in srgb, var(--primary-text-color) 10%, transparent));
	transition: color 0.2s ease, background 0.2s ease;
}

.mbnav-v5__seg:last-child {
	border-inline-end: none;
}

.mbnav-v5__seg::before {
	content: '';
	position: absolute;
	top: 0;
	inset-inline: 0;
	height: 3px;
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-before-bg, var(--primary-brand-color));
	opacity: 0;
	transform: scaleX(0.35);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mbnav-v5__seg-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 18px;
	line-height: 1;
	transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mbnav-v5__seg:hover,
.mbnav-v5__seg:active {
	color: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-hover-text, var(--primary-brand-color));
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-hover-bg, color-mix(in srgb, var(--primary-brand-color) 6%, transparent));
}

.mbnav-v5__seg.is-active {
	color: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-is-active-text, var(--primary-brand-color));
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-is-active-bg, color-mix(in srgb, var(--primary-brand-color) 10%, var(--primary-background-color)));
}

.mbnav-v5__seg.is-active::before {
	opacity: 1;
	transform: scaleX(1);
}

.mbnav-v5__seg.is-active .mbnav-v5__seg-icon {
	background: var(--sc-mobile-bottom-nav-v5-mbnav-v5-seg-icon-bg, color-mix(in srgb, var(--primary-brand-color) 14%, transparent));
	transform: translateY(-1px);
}

.mbnav-v5__seg .mobile-cart-count,
.mbnav-v5__seg .mobile-favorite-count {
	position: absolute;
	top: 6px;
	inset-inline-end: calc(50% - 22px);
	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-v5-mobile-cart-count-border, var(--primary-background-color));
	z-index: 2;
	width: auto;
}

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

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

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

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

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

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

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

@media (max-width: 380px) {
	.mbnav-v5__seg-icon {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}

	.mbnav-v5__seg .mobile-cart-count,
	.mbnav-v5__seg .mobile-favorite-count {
		inset-inline-end: calc(50% - 18px);
	}
}

[dir='rtl'] .mbnav-v5__seg .mobile-cart-count,
[dir='rtl'] .mbnav-v5__seg .mobile-favorite-count {
	inset-inline-end: auto;
	inset-inline-start: calc(50% - 22px);
}

@media (max-width: 380px) {
	[dir='rtl'] .mbnav-v5__seg .mobile-cart-count,
	[dir='rtl'] .mbnav-v5__seg .mobile-favorite-count {
		inset-inline-start: calc(50% - 18px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.mbnav-v5__seg,
	.mbnav-v5__seg::before,
	.mbnav-v5__seg-icon {
		transition: none;
	}
}
