/* ==========================================================================
   Mobile menu fix + styling  (<= 980px only, desktop is untouched)
   Place in: child-theme/css/mobile-menu.css
   ========================================================================== */

@media (max-width: 980px) {

	/* 1. Hide the desktop menu so it can't overflow the screen */
	#main-header #top-menu-nav,
	#main-header #top-menu {
		display: none !important;
	}

	/* Divi sets this inline for the logo; not needed on mobile */
	#main-header #et-top-navigation {
		padding-left: 0 !important;
	}

	/* 2. Make sure the hamburger is the only nav */
	#main-header #et_mobile_nav_menu {
		display: block !important;
		float: right;
	}

	/* ---------------------------------------------------------------
	   Dropdown panel
	   --------------------------------------------------------------- */
	#main-header #mobile_menu.et_mobile_menu {
		box-sizing: border-box;
		padding: 8px 20px 20px !important;
		background: #fff;
		border-top: 3px solid #e9503f;
		box-shadow: 0 18px 40px rgba(0, 16, 60, 0.18);
		max-height: calc(100vh - 90px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	#main-header #mobile_menu li {
		position: relative;
		padding-left: 0 !important;
		margin: 0;
		list-style: none;
	}

	/* ---------------------------------------------------------------
	   Level 1 links (About Us, Services, Industries ...)
	   --------------------------------------------------------------- */
	#main-header #mobile_menu > li > a {
		display: block;
		position: relative;
		padding: 15px 44px 15px 4px !important;
		font-size: 16px;
		font-weight: 600;
		color: #0b1f5c;
		background: transparent !important;
		border-bottom: 1px solid #eef0f5;
	}

	/* ---------------------------------------------------------------
	   Sub menus: collapsed by default, opened by mobile-menu.js
	   (overrides Divi's "always show" rule)
	   --------------------------------------------------------------- */
	#main-header #mobile_menu li ul.sub-menu {
		display: none !important;
		visibility: visible !important;
		margin: 0 !important;
		padding: 0 0 6px 12px !important;
		border-left: 2px solid #f0f2f8;
	}
	#main-header #mobile_menu li.mm-open > ul.sub-menu {
		display: block !important;
	}

	/* Level 2 (column titles: Data Engineering / Analytics & BI / AI) */
	#main-header #mobile_menu li li > a {
		display: block;
		position: relative;
		padding: 12px 44px 12px 8px !important;
		font-size: 15px;
		font-weight: 600;
		color: #1f2a44;
		background: transparent !important;
		border-bottom: 1px solid #f3f4f9;
	}

	/* Level 3 (actual service links) */
	#main-header #mobile_menu li li li > a {
		padding: 10px 8px !important;
		font-size: 14.5px;
		font-weight: 400;
		color: #4a5163;
		border-bottom: 0;
	}
	#main-header #mobile_menu li li li > a:active,
	#main-header #mobile_menu li li li > a:hover {
		color: #e9503f;
		background: #f3f5fb !important;
		border-radius: 6px;
	}

	/* ---------------------------------------------------------------
	   Chevron on every item that has children
	   --------------------------------------------------------------- */
	#main-header #mobile_menu li.menu-item-has-children > a::after {
		content: "";
		position: absolute;
		right: 16px;
		top: 50%;
		width: 7px;
		height: 7px;
		margin-top: -6px;
		border-right: 2px solid #e9503f;
		border-bottom: 2px solid #e9503f;
		transform: rotate(45deg);
		transition: transform 0.2s ease, margin-top 0.2s ease;
	}
	#main-header #mobile_menu li.menu-item-has-children.mm-open > a::after {
		transform: rotate(-135deg);
		margin-top: -2px;
	}
	/* highlight an opened parent */
	#main-header #mobile_menu li.mm-open > a {
		color: #e9503f;
	}

	/* ---------------------------------------------------------------
	   Contact Us as a full-width button
	   --------------------------------------------------------------- */
	#main-header #mobile_menu li.menu-item-8192 {
		margin-top: 16px;
	}
	#main-header #mobile_menu li.menu-item-8192 > a {
		padding: 13px 16px !important;
		text-align: center;
		font-size: 16px;
		font-weight: 600;
		color: #fff !important;
		background: #e9503f !important;
		border: 0;
		border-radius: 8px;
	}
}