/**
 * Fullscreen Mobile Menu Styles
 * Version: 1.0.0
 */

/* ============================================
   Hamburger Toggle Button
   ============================================ */

.fsmm-toggle {
	display: none;
	position: fixed;
	top: 15px;
	right: 15px;
	z-index: 10001;
	width: 50px;
	height: 50px;
	background: rgba(51, 51, 51, 0.9);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	cursor: pointer;
	padding: 0;
	margin: 0;
	transition: all 0.3s ease;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* When menu is open, keep hamburger visible above overlay */
.fsmm-overlay.active ~ .fsmm-toggle,
body.fsmm-menu-open .fsmm-toggle {
	z-index: 10001;
	background: rgba(255, 224, 50, 0.2);
	border-color: #ffe032;
}

.fsmm-toggle:hover {
	background: rgba(51, 51, 51, 1);
	border-color: rgba(255, 255, 255, 0.4);
	transform: scale(1.05);
}

.fsmm-toggle:focus {
	outline: 2px solid #ffe032;
	outline-offset: 2px;
}

.fsmm-hamburger {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	width: 100%;
	height: 100%;
	position: relative;
}

.fsmm-line {
	display: block;
	width: 24px;
	height: 2px;
	background: #fff;
	margin: 4px 0;
	border-radius: 2px;
	transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
	transform-origin: center;
	position: relative;
}

/* Hamburger Animation - Active State */
.fsmm-toggle.active .fsmm-line:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.fsmm-toggle.active .fsmm-line:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
	width: 0;
}

.fsmm-toggle.active .fsmm-line:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* ============================================
   Overlay Container
   ============================================ */

.fsmm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.fsmm-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Keep header/navbar visible above overlay */
@media only screen and (max-width: 991px) {
	/* Ensure navbar stays fixed at top above overlay */
	#wrapper-navbar {
		position: fixed !important;
		top: 0 !important;
		left: 0;
		right: 0;
		width: 100%;
		z-index: 10000 !important;
	}
	
	/* When menu is open, ensure navbar stays on top */
	body.fsmm-menu-open #wrapper-navbar {
		position: fixed !important;
		top: 0 !important;
		z-index: 10000 !important;
	}
	
	/* Overlay will be positioned below navbar via JavaScript */
	.fsmm-overlay {
		/* Top and height will be set dynamically by JS */
		z-index: 9998;
	}
	
	/* Add some top padding to content */
	.fsmm-overlay-content {
		padding-top: 20px;
	}
	
	/* Add padding to body to account for fixed navbar */
	body.fsmm-menu-open {
		padding-top: 0;
	}
}

/* ============================================
   Overlay Content
   ============================================ */

.fsmm-overlay-content {
	position: relative;
	width: 100%;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 20px 40px;
	transform: translateY(30px);
	transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fsmm-overlay.active .fsmm-overlay-content {
	transform: translateY(0);
}

/* ============================================
   Close Button (Hidden - using hamburger toggle instead)
   ============================================ */

.fsmm-close {
	display: none; /* Hide separate close button - hamburger transforms to X */
}

/* ============================================
   Menu Wrapper
   ============================================ */

.fsmm-menu-wrapper {
	width: 100%;
	max-width: 600px;
	margin: 0 auto;
}

.fsmm-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

/* ============================================
   Menu Items
   ============================================ */

.fsmm-menu-item {
	margin: 0;
	padding: 0;
	opacity: 0;
	transform: translateX(-20px);
	transition: opacity 0.4s ease, transform 0.4s ease;
	position: relative;
	z-index: 1;
}

.fsmm-menu-item.menu-item-has-children.submenu-active {
	z-index: 200;
	position: relative;
}

.fsmm-overlay.active .fsmm-menu-item {
	opacity: 1;
	transform: translateX(0);
}

/* Stagger animation for menu items */
.fsmm-overlay.active .fsmm-menu-item:nth-child(1) {
	transition-delay: 0.1s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(2) {
	transition-delay: 0.15s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(3) {
	transition-delay: 0.2s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(4) {
	transition-delay: 0.25s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(5) {
	transition-delay: 0.3s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(6) {
	transition-delay: 0.35s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(7) {
	transition-delay: 0.4s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(8) {
	transition-delay: 0.45s;
}

.fsmm-overlay.active .fsmm-menu-item:nth-child(n+9) {
	transition-delay: 0.5s;
}

.fsmm-menu-link {
	display: block;
	padding: 18px 20px;
	color: #fff;
	text-decoration: none;
	font-size: 24px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	transition: all 0.3s ease;
	position: relative;
	font-family: "Sofia Sans Semi Condensed", sans-serif;
	-webkit-tap-highlight-color: rgba(255, 224, 50, 0.3);
	touch-action: manipulation;
	cursor: pointer;
}

.fsmm-menu-link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: 4px;
	height: 100%;
	background: #ffe032;
	transform: scaleY(0);
	transition: transform 0.3s ease;
}

.fsmm-menu-link:hover,
.fsmm-menu-link:focus {
	color: #ffe032;
	padding-left: 30px;
	background: rgba(255, 255, 255, 0.05);
}

.fsmm-menu-link:hover::before,
.fsmm-menu-link:focus::before {
	transform: scaleY(1);
}

.fsmm-menu-link:focus {
	outline: 2px solid #ffe032;
	outline-offset: -2px;
}

/* Current menu item - ONLY highlight items with data-current-page attribute */
.fsmm-menu-item[data-current-page="true"] .fsmm-menu-link {
	color: #ffe032;
	padding-left: 30px;
}

.fsmm-menu-item[data-current-page="true"] .fsmm-menu-link::before {
	transform: scaleY(1);
}

/* Parent menu item with active child */
.fsmm-menu-item[data-has-current-child="true"] .fsmm-menu-link {
	color: #ffe032;
	padding-left: 30px;
}

.fsmm-menu-item[data-has-current-child="true"] .fsmm-menu-link::before {
	transform: scaleY(1);
}

/* Remove highlighting from submenu items that don't have data-current-page */
.fsmm-submenu-item:not([data-current-page="true"]) .fsmm-menu-link {
	color: #fff;
}

.fsmm-submenu-item:not([data-current-page="true"]) .fsmm-menu-link::before {
	transform: scaleY(0);
}

/* ============================================
   Submenu
   ============================================ */

.fsmm-submenu {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
	background: rgba(0, 0, 0, 0.3);
	position: relative;
}

.fsmm-submenu.active {
	max-height: 5000px;
	overflow: auto;
	position: relative;
	z-index: 100;
	-webkit-overflow-scrolling: touch;
}

/* Ensure parent menu item contains the submenu properly and appears above next items */
.fsmm-menu-item.menu-item-has-children.submenu-active {
	position: relative;
	z-index: 200;
	overflow: visible;
}

.fsmm-submenu-item {
	opacity: 0;
	transform: translateX(-10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	position: relative;
	z-index: 1;
}

.fsmm-submenu.active .fsmm-submenu-item {
	opacity: 1;
	transform: translateX(0);
}

.fsmm-submenu-item .fsmm-menu-link {
	font-size: 18px;
	padding: 14px 20px 14px 40px;
	text-transform: none;
	letter-spacing: 0.5px;
	font-weight: 400;
}

.fsmm-submenu-item .fsmm-menu-link::before {
	width: 3px;
}

/* Sub-submenu (third level) */
.fsmm-submenu .fsmm-submenu {
	margin-left: 20px;
}

.fsmm-submenu .fsmm-submenu-item .fsmm-menu-link {
	font-size: 16px;
	padding: 12px 20px 12px 50px;
}

/* ============================================
   Submenu Toggle Button
   ============================================ */

/* Position toggle relative to menu item, but align with link */
.fsmm-menu-item.menu-item-has-children {
	position: relative;
	z-index: 1;
}

/* When submenu is active, ensure parent item and submenu appear above subsequent items */
.fsmm-menu-item.menu-item-has-children.submenu-active .fsmm-submenu.active {
	position: relative;
	z-index: 100;
}

/* Ensure submenu items are above everything */
.fsmm-menu-item.menu-item-has-children.submenu-active .fsmm-submenu-item {
	position: relative;
	z-index: 1;
}

.fsmm-menu-item.menu-item-has-children .fsmm-menu-link {
	padding-right: 70px;
	position: relative;
	display: block;
}

.fsmm-submenu-toggle {
	position: absolute;
	right: 20px;
	top: 11px;
	margin-top: 0;
	width: 40px;
	height: 40px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease, transform 0.3s ease;
	padding: 0;
	z-index: 10; /* Ensure it stays above submenu */
	-webkit-tap-highlight-color: rgba(255, 224, 50, 0.3);
	touch-action: manipulation;
	-webkit-user-select: none;
	user-select: none;
}

.fsmm-submenu-toggle:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.1);
}

.fsmm-submenu-toggle:focus {
	outline: 2px solid #ffe032;
	outline-offset: 2px;
}

.fsmm-submenu-icon {
	color: #fff;
	font-size: 24px;
	font-weight: 300;
	line-height: 1;
	transition: transform 0.3s ease;
	display: block;
}

.fsmm-submenu-toggle[aria-expanded="true"] .fsmm-submenu-icon {
	transform: rotate(45deg);
}

/* ============================================
   Menu Item with Submenu
   ============================================ */

.fsmm-menu-item.menu-item-has-children {
	position: relative;
}

.fsmm-menu-item.menu-item-has-children .fsmm-menu-link {
	padding-right: 70px;
	position: relative; /* Make link the positioning context for toggle */
	display: block; /* Make link a block element for proper positioning */
}

/* ============================================
   Responsive Design
   ============================================ */

/* Show toggle button only on mobile */
@media only screen and (max-width: 991px) {
	.fsmm-toggle {
		display: block;
	}
	
	/* Hide default Bootstrap navbar toggler on mobile */
	.navbar-toggler {
		display: none !important;
	}
	
	/* Hide default navbar collapse on mobile */
	#navbarNavDropdown {
		display: none !important;
	}
	
	/* Ensure hamburger button is above navbar */
	.fsmm-toggle {
		z-index: 10002;
	}
}

/* Tablet adjustments */
@media only screen and (max-width: 768px) {
	.fsmm-toggle {
		top: 10px;
		right: 10px;
		width: 37px;
		height: 37px;
	}
	
	.fsmm-line {
		width: 22px;
		margin: 3px 0;
	}
	
	.fsmm-overlay-content {
		padding: 20px 15px 30px;
	}
	
	.fsmm-menu-link {
		font-size: 22px;
		padding: 16px 15px;
	}
	
	.fsmm-submenu-item .fsmm-menu-link {
		font-size: 18px;
		padding: 12px 15px 12px 35px;
	}
	
	.fsmm-submenu-toggle {
		right: 15px;
		top: 11px;
		margin-top: 0;
	}
}

/* Small mobile devices */
@media only screen and (max-width: 480px) {
	.fsmm-toggle {
		width: 37px;
		height: 37px;
		top: 8px;
		right: 8px;
	}
	
	.fsmm-line {
		width: 20px;
		margin: 2.5px 0;
	}
	
	.fsmm-overlay-content {
		padding: 20px 10px 20px;
	}
	
	.fsmm-menu-link {
		font-size: 20px;
		padding: 14px 12px;
	}
	
	.fsmm-submenu-item .fsmm-menu-link {
		font-size: 16px;
		padding: 10px 12px 10px 30px;
	}
	
	.fsmm-submenu-toggle {
		width: 35px;
		height: 35px;
		right: 12px;
		top: 11px;
		margin-top: 0;
	}
	
	.fsmm-submenu-icon {
		font-size: 20px;
	}
}

/* ============================================
   Prevent Body Scroll When Menu is Open
   ============================================ */

body.fsmm-menu-open {
	overflow: hidden;
}

/* ============================================
   Animation for Menu Items
   ============================================ */

@keyframes fsmm-fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ============================================
   Accessibility
   ============================================ */

.fsmm-toggle[aria-expanded="true"] {
	background: rgba(255, 224, 50, 0.2);
	border-color: #ffe032;
}

/* Screen reader text */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

