/**
 * Mobile Bottom Navigation Styles
 *
 * Sticky bottom navigation bar for mobile devices with app-like design.
 *
 * @package Astra
 * @since 1.0.0
 */

/* Mobile Bottom Navigation Container */
/* Note: Critical styles are inlined in head via PHP for instant rendering */
#astra-mobile-bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9999;
	background-color: #ffffff;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	padding-bottom: env(safe-area-inset-bottom);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Container for nav items */
.astra-mobile-bottom-nav-container {
	display: flex;
	justify-content: space-around;
	align-items: center;
	width: 100%;
	max-width: 100%;
	padding: 8px 0;
	margin: 0;
	list-style: none;
}

/* Individual nav item */
.astra-mobile-bottom-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 8px 4px;
	text-decoration: none;
	color: #666666;
	transition: color 0.3s ease, transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	cursor: pointer;
	min-width: 0;
	position: relative;
}

.astra-mobile-bottom-nav-item:active {
	transform: scale(0.95);
}

/* Icon container */
.astra-mobile-bottom-nav-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin-bottom: 4px;
	color: inherit;
	transition: color 0.3s ease;
}

.astra-mobile-bottom-nav-icon svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.astra-mobile-bottom-nav-icon .ast-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.astra-mobile-bottom-nav-icon .ast-icon svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
	stroke: none;
}

/* Cart badge */
.astra-mobile-bottom-nav-icon {
	position: relative;
}

.astra-mobile-bottom-nav-badge {
	position: absolute;
	top: -6px;
	right: -6px;
	background-color: #dc3232;
	color: #ffffff;
	border-radius: 10px;
	min-width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	padding: 2px 5px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	z-index: 1;
}

/* Label */
.astra-mobile-bottom-nav-label {
	font-size: 11px;
	line-height: 1.2;
	font-weight: 500;
	text-align: center;
	color: inherit;
	transition: color 0.3s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Active state */
.astra-mobile-bottom-nav-item.active {
	color: #2271b1;
}

.astra-mobile-bottom-nav-item.active .astra-mobile-bottom-nav-icon {
	color: #2271b1;
}

.astra-mobile-bottom-nav-item.active .astra-mobile-bottom-nav-label {
	color: #2271b1;
	font-weight: 600;
}

/* Hover state (for devices that support it) */
@media (hover: hover) {
	.astra-mobile-bottom-nav-item:hover {
		color: #2271b1;
	}

	.astra-mobile-bottom-nav-item:hover .astra-mobile-bottom-nav-icon {
		color: #2271b1;
	}

	.astra-mobile-bottom-nav-item:hover .astra-mobile-bottom-nav-label {
		color: #2271b1;
	}
}

/* Focus state for accessibility */
.astra-mobile-bottom-nav-item:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Show only on mobile devices */
@media screen and (max-width: 768px) {
	#astra-mobile-bottom-nav {
		display: block;
	}

	/* Add padding to body/content to prevent content from being hidden behind nav */
	body {
		padding-bottom: 70px;
	}

	/* Adjust for safe area on devices with notches */
	@supports (padding-bottom: env(safe-area-inset-bottom)) {
		body {
			padding-bottom: calc(70px + env(safe-area-inset-bottom));
		}
	}
}

/* Hide on desktop */
@media screen and (min-width: 769px) {
	#astra-mobile-bottom-nav {
		display: none !important;
	}
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
	#astra-mobile-bottom-nav {
		background-color: #1a1a1a;
		border-top-color: rgba(255, 255, 255, 0.1);
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
	}

	.astra-mobile-bottom-nav-item {
		color: #cccccc;
	}

	.astra-mobile-bottom-nav-item.active {
		color: #4a9eff;
	}

	.astra-mobile-bottom-nav-item.active .astra-mobile-bottom-nav-icon {
		color: #4a9eff;
	}

	.astra-mobile-bottom-nav-item.active .astra-mobile-bottom-nav-label {
		color: #4a9eff;
	}
}

/* RTL support */
.rtl .astra-mobile-bottom-nav-container {
	direction: rtl;
}

/* Ensure nav stays above other content */
#astra-mobile-bottom-nav {
	transform: translateZ(0);
	-webkit-transform: translateZ(0);
}
