#right_menu {
	
	width: 100%;
	background: #f8f8f8;
	border-right: 1px solid #ccc;
	position: relative; /* desktop: in page */
	overflow: visible;
	transition: left 0.3s ease;
}

	/* Menu links */
	#right_menu ul, #right_menu li {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	#right_menu a {
		background: #f8f8f8;
		display: block;
		color: #000;
		font-size:14px;
		margin-left: 10px;
		text-align: left;
		padding: 7px 5px;
		text-decoration: none;
		border-bottom: 1px dotted #aaa;
	}

	#right_menu li:hover > a {
		background: #e2e2e2;
		color: #333;
	}

	/* Submenu */
	#right_menu ul ul {
		display: none;
		background: #333;
	}

		#right_menu ul ul a {
			color: #333;
			padding-left: 10px;
		}

	#right_menu li:hover > ul {
		display: block; /* desktop hover */
	}

/* ===== Toggle Button ===== */
.menu-toggle {
	display: none; /* hidden on desktop */
	background: #333;
	color: #fff;
	border: none;
	padding: 10px 15px;
	cursor: pointer;
	font-size: 16px;
	border-radius: 4px;
	margin-bottom: 5px;
	position: relative; /* keep in layout */
	z-index: 1001;
}

/* ===== Overlay ===== */
#menuOverlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.5);
	z-index: 999;
}

/* ===== Mobile Styles ===== */
@media (max-width: 768px) {
	.menu-toggle {
		display: block;
	}

	#right_menu {
		position: fixed;
		top: 60%; /* Adjust vertical position as you wish */
		left: -250px; /* hidden by default */
		width: 250px;
		height: 65%; /* use percentage or calc(100% - offset) if you want space above */
		background: #f8f8f8;
		border-right: 1px solid #ccc;
		box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
		z-index: 1000;
		/* enable scrolling */
		overflow-y: auto;
		overflow-x: hidden;
		/* smooth animation for slide-in */
		transition: left 0.3s ease;
	}

		/* when open (slide in) */
		#right_menu.open {
			left: 0;
		}

		/* optional: make scrollbar visible but clean */
		#right_menu::-webkit-scrollbar {
			width: 8px;
		}

		#right_menu::-webkit-scrollbar-thumb {
			background: #999;
			border-radius: 4px;
		}

			#right_menu::-webkit-scrollbar-thumb:hover {
				background: #666;
			}


	#menuOverlay.active {
		display: block;
	}

	#right_menu ul ul {
		display: none !important;
	}

	#right_menu li.open > ul {
		display: block !important;
	}
}
