/**
 * Custom Mobile Navigation Styles
 * Appears when window width is under 920px
 */

/* Mobile Navigation Bar - Fixed to top */
#mobile-nav-bar {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	background: #fff;
	z-index: 9999;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	border-bottom: 1px solid #e0e0e0;
}

/* Ensure mobile nav is visible on small screens - override any conflicting styles */
@media screen and (max-width: 919px) {
	#mobile-nav-bar {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
}

/* Mobile Nav Bar Container */
.mobile-nav-container {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 12px 20px 11px 20px;
	max-width: 100%;
}

/* Hamburger Menu Toggle Button */
#mobile-menu-toggle {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 40px;
	height: 40px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	position: relative;
	z-index: 10000;
}

#mobile-menu-toggle:focus {
	outline: 2px solid #333;
	outline-offset: 2px;
}

/* Hamburger and Close Icons */
#mobile-menu-toggle .hamburger-icon,
#mobile-menu-toggle .close-icon {
	font-size: 24px;
	color: #333;
	line-height: 1;
}

#mobile-menu-toggle.is-active .hamburger-icon {
	display: none;
}

#mobile-menu-toggle.is-active .close-icon {
	display: block !important;
}

/* Mobile Menu Overlay */
#mobile-menu {
	display: block;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-menu.is-open {
	opacity: 1;
	visibility: visible;
}

/* Mobile Menu Panel */
#mobile-menu-panel {
	position: fixed;
	top: 64px; /* Height of mobile nav bar */
	left: 0;
	right: 0;
	bottom: 0;
	background: #fff;
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	z-index: 9999;
	max-width: 100%;
	width: 100%;
}

#mobile-menu.is-open #mobile-menu-panel {
	transform: translateX(0);
}

/* Mobile Menu List */
#mobile-menu-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: block;
}

#mobile-menu-panel ul.mobile-menu {
	padding: 20px 0;
	display: block;
}

#mobile-menu-panel ul.mobile-menu li {
	display: block;
}

#mobile-menu-panel li {
	border-bottom: 1px solid #e0e0e0;
	display: block;
	width: 100%;
}

#mobile-menu-panel li:last-child {
	border-bottom: none;
}

/* Mobile Menu Links */
#mobile-menu-panel a {
	display: block;
	padding: 15px 20px;
	color: #333;
	text-decoration: none;
	font-size: 16px;
	line-height: 1.5;
	transition: background-color 0.2s ease, color 0.2s ease;
}

#mobile-menu-panel a:hover,
#mobile-menu-panel a:focus {
	background-color: #f5f5f5;
	color: #000;
}

/* Active/Current Menu Item */
#mobile-menu-panel .current-menu-item > a,
#mobile-menu-panel .current-page-item > a {
	background-color: #f5f5f5;
	color: #000;
	font-weight: 600;
}

/* Submenu Styles */
#mobile-menu-panel .sub-menu,
#mobile-menu-panel .children {
	display: none;
	background-color: #f9f9f9;
	padding-left: 0;
}

#mobile-menu-panel .sub-menu.is-open,
#mobile-menu-panel .children.is-open {
	display: block;
}

#mobile-menu-panel .sub-menu li,
#mobile-menu-panel .children li {
	border-bottom: 1px solid #e8e8e8;
}

#mobile-menu-panel .sub-menu a,
#mobile-menu-panel .children a {
	padding-left: 40px;
	font-size: 15px;
}

#mobile-menu-panel .sub-menu .sub-menu a,
#mobile-menu-panel .children .children a {
	padding-left: 60px;
}

/* Submenu Toggle (for parent items) */
.menu-item-has-children > a {
	position: relative;
	padding-right: 50px;
}

.menu-item-has-children > a::after {
	content: '+';
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	font-weight: 300;
	transition: transform 0.3s ease;
}

.menu-item-has-children.menu-item-open > a::after {
	content: '−';
	transform: translateY(-50%) rotate(0deg);
}

/* Body scroll lock when menu is open */
body.mobile-menu-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
}

/* Show mobile nav bar below 920px */
@media only screen and (max-width: 919px) {
	#mobile-nav-bar {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
	}
	
	/* Hide desktop navigation on mobile */
	#header nav {
		display: none;
	}
	
	/* Add padding to body to account for fixed mobile nav bar */
	body {
		padding-top: 64px;
	}
	
	/* Remove padding when menu is open (body is fixed) */
	body.mobile-menu-open {
		padding-top: 0;
	}
}

/* Hide mobile nav bar above 920px */
@media only screen and (min-width: 920px) {
	#mobile-nav-bar {
		display: none !important;
	}
	
	#mobile-menu {
		display: none !important;
	}
	
	/* Ensure desktop navigation is visible */
	#header nav {
		display: block !important;
	}
	
	/* Remove mobile padding on desktop */
	body {
		padding-top: 0 !important;
	}
	
	body.mobile-menu-open {
		overflow: auto;
		position: static;
		width: auto;
	}
}

/* Adjustments for admin bar */
.admin-bar #mobile-nav-bar {
	top: 32px;
}

.admin-bar #mobile-menu-panel {
	top: 96px; /* 64px nav bar + 32px admin bar */
}

@media screen and (max-width: 782px) {
	.admin-bar #mobile-nav-bar {
		top: 46px;
	}
	
	.admin-bar #mobile-menu-panel {
		top: 110px; /* 64px nav bar + 46px admin bar */
	}
}

