/**
 * Desktop mega menu cards for itsbot (≥1140px).
 * Industries only (.mega-menu > .desktopmenu). Resources keeps theme icon-grid.
 */

 

@media (min-width: 1140px) {

	/* Custom scrollbar — only visible when panel scrolls (overflow-y: auto on open) */
	#menu-custom-menu .mega-menu > .desktopmenu,
	.mega-menu > .desktopmenu {
		scrollbar-width: thin;
		scrollbar-color: #ed4166 #f3eee8;
	}

	#menu-custom-menu .mega-menu > .desktopmenu::-webkit-scrollbar,
	.mega-menu > .desktopmenu::-webkit-scrollbar {
		width: 4px;
	}

	#menu-custom-menu .mega-menu > .desktopmenu::-webkit-scrollbar-track,
	.mega-menu > .desktopmenu::-webkit-scrollbar-track {
		background: #f3eee8;
		border-radius: 4px;
	}

	#menu-custom-menu .mega-menu > .desktopmenu::-webkit-scrollbar-thumb,
	.mega-menu > .desktopmenu::-webkit-scrollbar-thumb {
		background: #ed4166;
		border-radius: 4px;
	}

	#menu-custom-menu .mega-menu > .desktopmenu::-webkit-scrollbar-thumb:hover,
	.mega-menu > .desktopmenu::-webkit-scrollbar-thumb:hover {
		background: #d12f52;
	}


	.mega-menu {
		position: relative !important;
	}

	.mega-menu,
	.mega-menu > .desktopmenu {
		overflow: visible !important;
	}

	.mega-menu > .desktopmenu,
	#menu-custom-menu .mega-menu > .desktopmenu {
		display: none;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
		box-sizing: border-box;
		position: fixed !important;
		top: var(--mega-menu-top, 80px);
		/* top: 100px; */
		left: 50% !important;
		right: auto !important;
		inset-inline-start: 50% !important;
		inset-inline-end: auto !important;
		width: min(1180px, calc(100vw - 48px)) !important;
		max-width: calc(100vw - 48px) !important;
		min-width: 0 !important;
		transform: translateX(-50%) !important;
		padding: 30px !important;
		margin: 0 !important;
		background: #fff !important;
		border: 0 !important;
		border-radius: 24px !important;
		visibility: hidden;
		opacity: 0;
		pointer-events: none;
		/* Below typical sticky header chrome so sibling nav links stay clickable */
		z-index: 1000;
		list-style: none;
		flex-wrap: unset !important;
		text-align: left !important;
	}

	/* Kill theme caret that can sit over the nav; use a thin hover bridge only */
	.mega-menu > .desktopmenu::before,
	#menu-custom-menu .mega-menu > .desktopmenu:before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -12px;
		height: 12px;
		border: 0 !important;
		background: transparent !important;
		width: auto !important;
		transform: none !important;
		border-radius: 0 !important;
		z-index: auto;
		pointer-events: auto;
	}

	#menu-custom-menu .desktopmenu li a{
		transition: all .3s ease-in !important;
	}

	#menu-custom-menu .desktopmenu li a:hover {
		box-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a !important;
	}

	.mega-menu.is-mega-open > .desktopmenu,
	.mega-menu.active > .desktopmenu,
	.mega-menu > .desktopmenu.active,
	#menu-custom-menu .mega-menu.is-mega-open > .desktopmenu,
	#menu-custom-menu .mega-menu.active > .desktopmenu,
	#menu-custom-menu .mega-menu > .desktopmenu.active {
		display: grid !important;
		visibility: visible !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		overflow-y: auto !important;
		max-height: calc(100vh - 80px);
	}

	.mega-menu > .desktopmenu > .menu-item,
	.mega-menu > .desktopmenu > li,
	#menu-custom-menu .mega-menu > .desktopmenu > li {
		width: auto !important;
		flex: unset !important;
		margin: 0 !important;
		float: none;
		display: block !important;
		position: relative;
		border: 0 !important;
		padding: 0 !important;
	}

	.mega-menu > .desktopmenu > .mega-menu-card > a,
	.mega-menu > .desktopmenu > .mega-menu-card > .menu-link,
	.mega-menu > .desktopmenu > li > a,
	#menu-custom-menu .mega-menu > .desktopmenu > li > a {
		display: flex !important;
		flex-direction: row;
		align-items: stretch;
		justify-content: space-between;
		gap: 12px;
		height: 100%;
		min-height: 148px;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 16px !important;
		overflow: hidden;
		text-decoration: none;
		/* Default only — no !important so ACF inline bg_color can win */
		background-color: #f3eee8;
		/* box-shadow: none !important; */
		white-space: normal;
		line-height: 1.4;
		color: inherit;
		margin: 0 !important;
	}

	.mega-menu > .desktopmenu > .mega-menu-card > a:hover,
	.mega-menu > .desktopmenu > .mega-menu-card > a:focus,
	.mega-menu > .desktopmenu > li > a:hover,
	.mega-menu > .desktopmenu > li > a:focus,
	#menu-custom-menu .mega-menu > .desktopmenu > li > a:hover {
		background-image: none;
		filter: brightness(0.98);
		/* box-shadow: none !important; */
	}

	/* Hide legacy icon-grid chrome inside Industries cards only */
	.mega-menu > .desktopmenu .listing-menu,
	.mega-menu > .desktopmenu .header-svg,
	.mega-menu > .desktopmenu > li > a > img[src*="greaterIcon"] {
		display: none !important;
	}

	.mega-menu-card-text {
		display: flex;
		flex-direction: column;
		flex: 1 1 50%;
		max-width: 50%;
		min-width: 0;
		padding-right: 4px;
		box-sizing: border-box;
		padding: 20px !important;
	}

	.mega-menu-card-title {
		display: block;
		margin: 0 0 8px;
		color: #1d1d1d;
		font-size: 16px;
		font-weight: 700;
		line-height: 1.25;
		font-family: "Plus Jakarta Sans", sans-serif;
	}

	.mega-menu-card-desc {
		display: block;
		color: #5b6470;
		font-size: 12px;
		font-weight: 400;
		line-height: 1.45;
		font-family: "Plus Jakarta Sans", sans-serif;
	}

	.mega-menu-card-media {
		display: block;
		flex: 1 1 50%;
		max-width: 50%;
		min-width: 0;
		min-height: 100%;
		align-self: stretch;
		overflow: hidden;
		box-sizing: border-box;
	}

	.mega-menu-card-media img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		border-radius: 0;
		object-position: right !important;
	}

	/* Keep top-level nav above the fixed mega panel so siblings receive hover */
	#menu-custom-menu > li > a {
		position: relative;
		z-index: 1001;
	}
}

/* Below itsbot desktop breakpoint: do not style mobile .sub-menu. */
@media (max-width: 1139.98px) {
	.mega-menu-card-desc,
	.mega-menu-card-media {
		display: none !important;
	}
}
