/**
 * Malek Stores taxonomy-driven mega menu.
 * Scoped to the existing custom header.
 */

.ms-site-header .malek-mega-menu__toggle {
	border: 0;
	background: transparent;
	color: currentColor;
	cursor: pointer;
}

.ms-site-header .malek-mega-menu__toggle svg,
.ms-site-header .malek-mega-menu__section-toggle svg {
	width: 16px;
	height: 16px;
	transition: transform 180ms ease;
}

.ms-site-header .malek-mega-menu__panel {
	color: #18201b;
	background: #fff;
}

.ms-site-header .malek-mega-menu__grid {
	display: grid;
}

.ms-site-header .malek-mega-menu__column,
.ms-site-header .malek-mega-menu__list {
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-site-header .malek-mega-menu__section-toggle {
	width: 100%;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border: 0;
	background: transparent;
	color: #131815;
	text-align: start;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}

.ms-site-header .malek-mega-menu__link {
	min-height: 38px;
	padding: 8px 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	border-radius: 8px;
	color: #3e4842;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
	transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.ms-site-header .malek-mega-menu__link:hover,
.ms-site-header .malek-mega-menu__link:focus-visible {
	color: #5f8100;
	background: #f2f9df;
	transform: translateX(2px);
	outline: none;
}

[dir="rtl"] .ms-site-header .malek-mega-menu__link:hover,
[dir="rtl"] .ms-site-header .malek-mega-menu__link:focus-visible {
	transform: translateX(-2px);
}

.ms-site-header .malek-mega-menu__link small {
	min-width: 22px;
	height: 22px;
	padding-inline: 6px;
	display: inline-grid;
	place-items: center;
	border-radius: 99px;
	background: #f2f4f2;
	color: #788078;
	font-size: 10px;
	font-weight: 800;
}

.ms-site-header .malek-mega-menu__promo {
	margin-top: 16px;
	padding: 18px;
	display: grid;
	gap: 5px;
	border: 1px solid #dce9bb;
	border-radius: 14px;
	background: linear-gradient(145deg, #f7fbe9, #eef7d8);
	color: #26301d;
	transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.ms-site-header .malek-mega-menu__promo:hover,
.ms-site-header .malek-mega-menu__promo:focus-visible {
	color: #26301d;
	border-color: #a7dc22;
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(58, 79, 15, .1);
	outline: none;
}

.ms-site-header .malek-mega-menu__eyebrow {
	width: max-content;
	padding: 3px 7px;
	border-radius: 99px;
	background: #a7dc22;
	color: #172005;
	font-size: 9px;
	font-weight: 900;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.ms-site-header .malek-mega-menu__promo strong {
	margin-top: 3px;
	font-size: 15px;
}

.ms-site-header .malek-mega-menu__promo > span:not(.malek-mega-menu__eyebrow) {
	color: #65705e;
	font-size: 11px;
	line-height: 1.45;
}

.ms-site-header .malek-mega-menu__promo b {
	margin-top: 4px;
	color: #557500;
	font-size: 12px;
}

.ms-site-header .malek-mega-menu__all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	border-top: 1px solid #e9ece9;
	color: #526044;
	font-size: 12px;
	font-weight: 800;
}

.ms-site-header .malek-mega-menu__all:hover,
.ms-site-header .malek-mega-menu__all:focus-visible {
	color: #628600;
}

@media (min-width: 901px) {
	.ms-category-nav .ms-header-container {
		position: relative;
	}

	.ms-category-menu > .malek-mega-menu {
		position: static;
		display: flex;
		align-items: center;
	}

	.ms-category-menu > .malek-mega-menu > a {
		padding-inline-end: 22px;
	}

	.ms-category-menu > .malek-mega-menu > .malek-mega-menu__toggle {
		position: relative;
		z-index: 2;
		width: 24px;
		height: 36px;
		margin-inline-start: -22px;
		padding: 4px;
		display: grid;
		place-items: center;
	}

	.ms-category-menu > .malek-mega-menu.is-mega-open > .malek-mega-menu__toggle svg {
		transform: rotate(180deg);
	}

	.ms-category-menu .malek-mega-menu__panel {
		position: absolute;
		z-index: 120;
		inset-block-start: calc(100% + 10px);
		inset-inline-start: 50%;
		width: min(1080px, calc(100vw - 48px));
		border: 1px solid #e4e8e4;
		border-radius: 16px;
		box-shadow: 0 24px 65px rgba(16, 24, 19, .18);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translate(-50%, 8px);
		transition: opacity 190ms ease, transform 190ms ease, visibility 190ms ease;
	}

	[dir="rtl"] .ms-category-menu .malek-mega-menu__panel {
		transform: translate(50%, 8px);
	}

	.ms-category-menu .malek-mega-menu__panel::before {
		content: "";
		position: absolute;
		inset-inline: 0;
		inset-block-start: -11px;
		height: 12px;
	}

	.ms-category-menu > .malek-mega-menu:hover > .malek-mega-menu__panel,
	.ms-category-menu > .malek-mega-menu:focus-within > .malek-mega-menu__panel,
	.ms-category-menu > .malek-mega-menu.is-mega-open > .malek-mega-menu__panel {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translate(-50%, 0);
	}

	[dir="rtl"] .ms-category-menu > .malek-mega-menu:hover > .malek-mega-menu__panel,
	[dir="rtl"] .ms-category-menu > .malek-mega-menu:focus-within > .malek-mega-menu__panel,
	[dir="rtl"] .ms-category-menu > .malek-mega-menu.is-mega-open > .malek-mega-menu__panel {
		transform: translate(50%, 0);
	}

	.ms-category-menu .malek-mega-menu__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 28px;
		padding: 30px 32px 24px;
	}

	.ms-category-menu .malek-mega-menu__column--brands {
		padding-inline-start: 5px;
	}

	.ms-category-menu .malek-mega-menu__column--brands > .malek-mega-menu__column {
		margin: 0;
	}

	.ms-category-menu .malek-mega-menu__section-toggle {
		margin-bottom: 11px;
		pointer-events: none;
	}

	.ms-category-menu .malek-mega-menu__section-toggle svg {
		display: none;
	}

	.ms-category-menu .malek-mega-menu__list {
		display: block !important;
	}

	.ms-category-menu .malek-mega-menu__all {
		min-height: 46px;
	}

	.ms-category-menu > .malek-mega-menu:hover > a,
	.ms-category-menu > .malek-mega-menu:focus-within > a,
	.ms-category-menu > .malek-mega-menu.is-mega-open > a {
		color: #a7dc22;
	}
}

@media (max-width: 900px) {
	.ms-mobile-menu > .malek-mega-menu {
		display: grid;
		grid-template-columns: 1fr 48px;
	}

	.ms-mobile-menu > .malek-mega-menu > a {
		grid-column: 1;
		grid-row: 1;
	}

	.ms-mobile-menu > .malek-mega-menu > .malek-mega-menu__toggle {
		grid-column: 2;
		grid-row: 1;
		min-width: 48px;
		min-height: 48px;
		display: grid;
		place-items: center;
		color: #a7dc22;
	}

	.ms-mobile-menu > .malek-mega-menu.is-mega-open > .malek-mega-menu__toggle svg {
		transform: rotate(180deg);
	}

	.ms-mobile-menu .malek-mega-menu__panel {
		grid-column: 1 / -1;
		display: none;
		margin: 0 -24px;
		padding: 6px 24px 20px;
		border-top: 1px solid rgba(255,255,255,.1);
		background: #f8faf7;
		color: #172019;
	}

	.ms-mobile-menu > .malek-mega-menu.is-mega-open > .malek-mega-menu__panel {
		display: block;
	}

	.ms-mobile-menu .malek-mega-menu__grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.ms-mobile-menu .malek-mega-menu__column {
		border-bottom: 1px solid #e2e7e2;
	}

	.ms-mobile-menu .malek-mega-menu__column--brands {
		border-bottom: 0;
	}

	.ms-mobile-menu .malek-mega-menu__column--brands > .malek-mega-menu__column {
		border-bottom: 1px solid #e2e7e2;
	}

	.ms-mobile-menu .malek-mega-menu__section-toggle {
		min-height: 50px;
	}

	.ms-mobile-menu .malek-mega-menu__section-toggle[aria-expanded="true"] svg {
		transform: rotate(180deg);
	}

	.ms-mobile-menu .malek-mega-menu__list {
		display: none;
		padding: 0 0 10px;
	}

	.ms-mobile-menu .malek-mega-menu__section-toggle[aria-expanded="true"] + .malek-mega-menu__list {
		display: block;
	}

	.ms-mobile-menu .malek-mega-menu__link {
		min-height: 44px;
		padding-inline: 12px;
	}

	.ms-mobile-menu .malek-mega-menu__promo {
		margin: 14px 0;
	}

	.ms-mobile-menu .malek-mega-menu__all {
		min-height: 48px;
		margin-top: 5px;
		border: 1px solid #dce5ca;
		border-radius: 10px;
		background: #f2f8e2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ms-site-header .malek-mega-menu__panel,
	.ms-site-header .malek-mega-menu__link,
	.ms-site-header .malek-mega-menu__promo {
		transition-duration: .01ms !important;
	}
}
