/**
 * Shop Kit · Mega menu — the Shoptimizer adapter (enqueued when the active parent theme is
 * Shoptimizer; loads after mega-menu.css).
 *
 * What the theme needs (2.9.x): the menu bar is `.col-full-nav` (a full-width band; sticky when
 * the store pins it), the items are `nav.main-navigation ul.menu > li` — inline-block, and the
 * theme positions only `li.menu-item-has-children` (a class the engine removes from a panel's
 * parent). So: the bar is the panel's containing block, the parent <li> stays static, and the
 * bar rises above the page's sticky controls while a panel is open. The theme's own hover cues
 * on the bar (the underline that grows under a hovered item, the siblings dimming to .65) are
 * kept — the panel is a descendant of the hovered <li>, so they hold while the pointer is in it.
 */

@media (min-width: 993px) {
	.col-full-nav {
		position: relative;   /* a store that pins the bar makes it sticky — positioned too; either way the panel hangs from it */
	}
	nav.main-navigation ul.menu > li.sk-mega-parent {
		position: static;
	}
	/* While a panel is open the bar outranks the page's sticky filters / sort menus (the theme gives the pinned
	 * bar z 10 / 15; a store's sort dropdown sits at 30). The masthead above it is untouched. */
	.col-full-nav:has(.sk-mega-parent.is-open, .sk-mega-parent:focus-within) {
		z-index: var(--sk-mega-bar-z, 40);
	}
	/* The theme's full-width mega menu is not in play for a panel parent. */
	nav.main-navigation ul.menu > li.sk-mega-parent > .sub-menu-wrapper {
		display: none;
	}

	/* The theme styles every list and link inside its nav (`.main-navigation ul ul` is absolute and,
	 * in RTL, parked at right:-9999px; `ul.menu ul li > a` gets the Customizer's sub-menu type and
	 * colour; `ul li` is inline-block). The panel's own list and links take the engine's tokens back,
	 * at a specificity above the theme's (0,2,4). */
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega ul {
		position: static;
		inset: auto;
		width: auto;
		margin: 0;
		padding: 0;
		background: none;
		box-shadow: none;
		visibility: visible;
		opacity: 1;
		transform: none;
	}
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega li {
		display: block;
		position: static;
		float: none;
		width: auto;
		margin: 0;
		padding: 0;
		border: 0;
		line-height: inherit;
	}
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega a {
		display: inline-block;
		padding: 0;
		font-family: inherit;
		letter-spacing: inherit;
		text-transform: none;
		opacity: 1;
	}
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega .sk-mega__link {
		font-size: var(--sk-mega-link-size);
		font-weight: var(--sk-mega-link-weight);
		line-height: var(--sk-mega-link-row);
		color: var(--sk-mega-ink);
	}
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega .sk-mega__title-link,
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega .sk-mega__tile {
		display: block;
		font-size: inherit;
		font-weight: inherit;
		line-height: inherit;
		color: var(--sk-mega-ink);
	}
	nav.main-navigation ul.menu li.sk-mega-parent .sk-mega .sk-mega__title-link {
		display: inline;
	}
}
