/*
 * AUTOBOSS Mobile Bottom Nav — app-style tab bar (after Taobao / JD / Temu):
 * compact 50px bar, outline icons that turn solid when current, red count badge,
 * press/hover feedback, raised centre button for the featured item (customer service).
 * Hidden by default; per-device display rules are printed inline, and the tablet,
 * phone-landscape and desktop side-toolbar layouts live in layout-*.css loaded with media attributes.
 */
.abmbn {
	display: none;
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	/* Above page content and Blocksy's sticky header (50), below its off-canvas panels (99999+). */
	z-index: 9990;
	/* Home indicator below; notch/rounded corners at the sides in phone landscape. */
	padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
	background: var(--abmbn-bg);
	border-top: 0.5px solid var(--abmbn-border);
	box-shadow: 0 -2px 12px rgba(33, 37, 41, 0.05);
	-webkit-user-select: none;
	user-select: none;
	transition: transform 0.25s ease;
}

/* Optional "hide while scrolling down". */
.abmbn.is-hidden {
	/* Includes the raised centre button. */
	transform: translateY(calc(100% + 32px));
}

.abmbn-list {
	display: flex;
	align-items: stretch;
	/* On tablets keep items grouped instead of spreading across the full width. */
	max-width: 640px;
	/* --abmbn-h is set per device range on body (see the inline media queries). */
	height: var(--abmbn-h, 50px);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

.abmbn-item {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
}

.abmbn-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	height: 100%;
	padding: 0 2px;
	color: var(--abmbn-text);
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: 0.01em;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	transition: color 0.15s ease;
}

.abmbn-link:hover,
.abmbn-link:focus {
	text-decoration: none;
}

.abmbn-link:focus-visible {
	outline: 2px solid var(--abmbn-active);
	outline-offset: -3px;
	border-radius: 8px;
}

.abmbn-icon-wrap {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.abmbn-icon {
	display: block;
	width: 24px;
	height: 24px;
	overflow: visible;
}

.abmbn-icon .f {
	fill: transparent;
	transition: fill 0.2s ease;
}

/* Labels stay on one line and are never split inside a word; overlong ones end in "…". */
.abmbn-label {
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	word-break: keep-all;
}

/* Current item: solid brand-colour icon with dark outline, bold dark label. */
.is-current > .abmbn-link {
	color: var(--abmbn-active);
	font-weight: 700;
}

.is-current .abmbn-icon .f {
	fill: var(--abmbn-active-bg);
}

.is-current .abmbn-icon .h {
	fill: var(--abmbn-bg);
}

.is-current .abmbn-icon-wrap {
	animation: abmbn-pop 0.36s cubic-bezier(0.3, 1.6, 0.5, 1) backwards;
}

/* Press feedback (touch and mouse). */
.abmbn-link:active .abmbn-icon-wrap {
	transform: scale(0.86);
	animation: none;
}

/* Hover only where a real pointer exists, so taps don't leave a stuck hover state. */
@media (hover: hover) and (pointer: fine) {
	.abmbn-link:hover {
		color: var(--abmbn-active);
	}

	/* :not(:active) so the press feedback above still wins while the button is held. */
	.abmbn-link:hover:not(:active) .abmbn-icon-wrap {
		transform: translateY(-2px);
	}

	.abmbn-item:not(.is-current) .abmbn-link:hover .abmbn-icon .f {
		fill: color-mix(in srgb, var(--abmbn-active-bg) 30%, transparent);
	}
}

.abmbn-no-labels .abmbn-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.abmbn-no-labels .abmbn-icon-wrap,
.abmbn-no-labels .abmbn-icon {
	width: 27px;
	height: 27px;
}

/* Featured item (default: customer service chat): raised round button in the middle of the bar. */
.abmbn-featured .abmbn-icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin-top: -22px;
	border-radius: 50%;
	background: var(--abmbn-active-bg);
	color: var(--abmbn-active);
	box-shadow: 0 0 0 4px var(--abmbn-bg), 0 6px 14px rgba(33, 37, 41, 0.18);
}

.abmbn-featured .abmbn-icon {
	width: 26px;
	height: 26px;
}

.abmbn-featured .abmbn-icon .f {
	fill: rgba(255, 255, 255, 0.55);
}

.abmbn-featured > .abmbn-link {
	color: var(--abmbn-active);
	font-weight: 600;
}

/* Back-to-top exists only in the desktop side toolbar (layout-side.css). */
.abmbn-top-item {
	display: none;
}

/* Red pill badge at the icon's top-right; re-animates when a cart fragment replaces it. */
.abmbn-badge {
	position: absolute;
	top: -5px;
	left: 14px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	box-sizing: border-box;
	border: 1.5px solid var(--abmbn-bg);
	border-radius: 9px;
	background: var(--abmbn-badge-bg);
	color: var(--abmbn-badge-text);
	font-size: 10px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 14px;
	text-align: center;
	letter-spacing: 0;
	animation: abmbn-bump 0.3s ease-out both;
}

.abmbn-badge[data-count="0"] {
	display: none;
}

@keyframes abmbn-pop {
	0% {
		transform: scale(0.78);
	}

	100% {
		transform: scale(1);
	}
}

@keyframes abmbn-bump {
	0% {
		transform: scale(0.4);
	}

	70% {
		transform: scale(1.15);
	}

	100% {
		transform: scale(1);
	}
}

/* !important so state selectors (e.g. .is-current) cannot re-enable motion. */
@media (prefers-reduced-motion: reduce) {
	.abmbn,
	.abmbn * {
		transition: none !important;
		animation: none !important;
	}
}

@media print {
	.abmbn {
		display: none !important;
	}
}
