/**
 * Module: Mobile Floating Bottom Navbar (Woodmart-style)
 * -----------------------------------------------------------------------------
 * 1. Pure CSS layout with zero inline styles.
 * 2. High performance (Hardware-accelerated CSS, 0 JS loops, 0 jQuery).
 * 3. Mobile safe area support for modern iOS & Android devices.
 * 4. Automatic floating chat button (WhatsApp) offset.
 * 5. Adaptive badge count with subtle bounce animation.
 * -----------------------------------------------------------------------------
 */

/* Main Bottom Navigation Bar */
.ast-child-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: calc(56px + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background-color: var(--ast-bottom-nav-bg, #ffffff);
	border-top: 1px solid var(--ast-bottom-nav-border, #e2e8f0);
	box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06);
	display: flex;
	align-items: center;
	justify-content: space-around;
	z-index: 999;
	box-sizing: border-box;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transform: translate3d(0, 0, 0);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

/* Individual Navigation Item */
.ast-bottom-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 0;
	height: 100%;
	padding: 4px 2px;
	color: var(--ast-bottom-nav-color, #475569);
	text-decoration: none !important;
	outline: none;
	position: relative;
	transition: color 0.2s ease, transform 0.15s ease;
	background: transparent;
	border: none;
	box-shadow: none;
	cursor: pointer;
	font-family: inherit;
	line-height: inherit;
}

.ast-bottom-nav-item:hover,
.ast-bottom-nav-item:focus-visible {
	color: var(--ast-bottom-nav-active-color, var(--ast-global-color-0, #8f2b8c));
}

.ast-bottom-nav-item:active {
	transform: scale(0.94);
}

/* Active Page Indicator */
.ast-bottom-nav-item.is-active {
	color: var(--ast-bottom-nav-active-color, var(--ast-global-color-0, #8f2b8c));
	font-weight: 600;
}

/* Icon Container */
.ast-bottom-nav-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	line-height: 1;
}

.ast-bottom-nav-icon svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke 0.2s ease;
}

/* Solid Fill for Active Icons if Applicable */
.ast-bottom-nav-item.is-active .ast-bottom-nav-icon svg.is-solid-fill {
	fill: currentColor;
}

/* Cart Badge Notification Count */
.ast-bottom-nav-badge {
	position: absolute;
	top: -4px;
	right: -8px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background-color: var(--ast-bottom-nav-badge-bg, var(--ast-global-color-0, #8f2b8c));
	color: var(--ast-bottom-nav-badge-color, #ffffff);
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	pointer-events: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Text Label */
.ast-bottom-nav-label {
	font-size: 11px;
	line-height: 1.2;
	margin-top: 3px;
	font-weight: 500;
	letter-spacing: -0.1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 90%;
}

/* Mobile & Tablet Only Visibility Filter */
@media (min-width: 769px) {
	.ast-child-bottom-nav.ast-bottom-nav-mobile-only {
		display: none !important;
	}
}

/* Body Offset & Floating Button Clearances */
@media (max-width: 768px) {
	body.ast-has-bottom-nav {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Lift WhatsApp chat button above the bottom navigation bar */
	body.ast-has-bottom-nav .wh-btn {
		bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
	}
}

/* If displayed on all devices */
body.ast-has-bottom-nav-all {
	padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}

body.ast-has-bottom-nav-all .wh-btn {
	bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Hide Bottom Nav when Slide-in Drawer or Fullscreen Modals are Open */
.ast-mobile-cart-active .ast-child-bottom-nav,
.ast-main-header-nav-open .ast-child-bottom-nav,
.ast-popup-nav-open .ast-child-bottom-nav,
.ast-mobile-popup-open .ast-child-bottom-nav,
body:has(#ast-mobile-popup.active) .ast-child-bottom-nav,
body:has(#ast-mobile-popup.show) .ast-child-bottom-nav {
	opacity: 0;
	pointer-events: none;
	transform: translate3d(0, 100%, 0);
}
