/* ==========================================================================
   Jomar Mega Nav v1.0.6
   Scoped strictly to .jomar-mega-parent and .jomar-mega-header classes.
   Uses CSS Grid for reliable 3-column layout.
   ========================================================================== */

/* Mega dropdown panel — CSS Grid, 3 equal columns */
.jomar-mega-parent > .dropdown-menu {
	display: none !important;
	grid-template-columns: 1fr 1fr 1fr;
	min-width: 660px;
	padding: 12px 0;
	border-top: 3px solid #195b7c;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	border-radius: 0 0 6px 6px;
	background: #fff;
}

.jomar-mega-parent:hover > .dropdown-menu,
.jomar-mega-parent:focus-within > .dropdown-menu {
	display: grid !important;
}

/*
 * Column assignment via grid-column.
 * Items flow in DOM order: Header1, items..., Header2, items..., Header3, items...
 * We use nth-child targeting based on the known menu structure:
 *
 * Col 1 (Phone Systems):  items 1-7  (header + 6 items)
 * Col 2 (Cloud & Hosting): items 8-11 (header + 3 items)
 * Col 3 (IT & Security):   items 12-16 (header + 4 items)
 */

/* Column 1: Phone Systems — items 1 through 7 */
.jomar-mega-parent > .dropdown-menu > li:nth-child(-n+7) {
	grid-column: 1;
}

/* Column 2: Cloud & Hosting — items 8 through 11 */
.jomar-mega-parent > .dropdown-menu > li:nth-child(n+8):nth-child(-n+11) {
	grid-column: 2;
}

/* Column 3: IT & Security — items 12 through 16 */
.jomar-mega-parent > .dropdown-menu > li:nth-child(n+12) {
	grid-column: 3;
}

/* All items start from row 1 in their column — grid auto-places them */
.jomar-mega-parent > .dropdown-menu > li {
	list-style: none;
}

/* Category headers — styled as labels */
.jomar-mega-parent > .dropdown-menu > .jomar-mega-header > a {
	font-size: 11px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.08em;
	color: #195b7c !important;
	cursor: default;
	padding: 6px 16px 6px !important;
	border-bottom: 1px solid #e5e5e5;
	display: block;
	pointer-events: none;
	background: transparent !important;
}

/* Regular items in dropdown */
.jomar-mega-parent > .dropdown-menu > li:not(.jomar-mega-header) > a {
	display: block;
	padding: 5px 16px !important;
	font-size: 13.5px !important;
	color: #333 !important;
	text-transform: none !important;
	white-space: normal;
	line-height: 1.5;
}

.jomar-mega-parent > .dropdown-menu > li:not(.jomar-mega-header) > a:hover {
	color: #195b7c !important;
	background-color: #f0f6fa !important;
}

/* Client Portal button */
.menu-item > a[href*="myconnectwise"] {
	background-color: #195b7c;
	color: #fff !important;
	padding: 8px 18px !important;
	border-radius: 4px;
	font-weight: 600;
	font-size: 13px;
	margin-left: 12px;
}

.menu-item > a[href*="myconnectwise"]:hover {
	background-color: #134a64;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
	.jomar-mega-parent > .dropdown-menu {
		grid-template-columns: 1fr;
		min-width: unset;
		box-shadow: none;
		border-top: none;
		padding: 0;
	}

	.jomar-mega-parent > .dropdown-menu > li:nth-child(-n+7),
	.jomar-mega-parent > .dropdown-menu > li:nth-child(n+8):nth-child(-n+11),
	.jomar-mega-parent > .dropdown-menu > li:nth-child(n+12) {
		grid-column: 1;
	}

	.menu-item > a[href*="myconnectwise"] {
		background-color: transparent;
		color: inherit !important;
		padding: inherit !important;
		border-radius: 0;
		font-weight: inherit;
		margin-left: 0;
	}
}
