/* Desktop: hide native sub-menu for megamenu items (the panel takes over).
   Mobile: keep the sub-menu visible so the theme's drawer can render it. */
@media (min-width: 1025px) {
	.has-ec-megamenu > .sub-menu { display: none !important; }
}

/* Use the header itself as positioning context so the panel sits below the
   entire header bar (full width), not just below the narrow menu list. */
.ec-header { position: relative; }
.ec-header__nav-list,
.menu,
ul.menu,
.nav-menu { position: static; }
/* Anchor panel to the menu item's left edge (theme already sets li position: relative,
   we just leave it). Full-width mode escapes via static + header relative below. */
li.has-ec-megamenu { position: relative; }
.ec-mm-width-full.has-ec-megamenu { position: static !important; }

/* Panel base */
.ec-mm-panel {
	position: absolute;
	top: 100%;
	background: var(--ec-page-bg, #f5f1ea);
	color: #1c1c1a;
	border: 0;
	border-radius: 0;
	box-shadow: 0 16px 32px -12px rgba(0,0,0,.12);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
	padding: 20px 48px 8px;
}

/* Container mode: only as wide as needed, anchored to the menu item's left edge */
.ec-mm-width-container > .ec-mm-panel {
	left: 0;
	transform: translateY(6px);
	width: max-content;
	max-width: calc(100vw - 32px);
}
.ec-mm-width-container.has-ec-megamenu:hover > .ec-mm-panel,
.ec-mm-width-container.has-ec-megamenu:focus-within > .ec-mm-panel,
.ec-mm-width-container.has-ec-megamenu.is-open > .ec-mm-panel {
	transform: translateY(0);
}

/* Full-width mode: spans the entire header */
.ec-mm-width-full > .ec-mm-panel {
	left: 0;
	right: 0;
	border-left: 0;
	border-right: 0;
	border-radius: 0;
	transform: translateY(6px);
	padding: 32px 0 36px;
}
.ec-mm-width-full.has-ec-megamenu:hover > .ec-mm-panel,
.ec-mm-width-full.has-ec-megamenu:focus-within > .ec-mm-panel,
.ec-mm-width-full.has-ec-megamenu.is-open > .ec-mm-panel {
	transform: translateY(0);
}

.has-ec-megamenu:hover > .ec-mm-panel,
.has-ec-megamenu:focus-within > .ec-mm-panel,
.has-ec-megamenu.is-open > .ec-mm-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Inner */
.ec-mm-panel .ec-mm-panel__inner {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 24px 40px;
	margin: 0 auto;
	box-sizing: border-box;
	list-style: none;
}
.ec-mm-width-full > .ec-mm-panel .ec-mm-panel__inner {
	max-width: none;
	padding: 0 clamp(16px, 5vw, 80px);
}

/* Columns: only as wide as their content */
.ec-mm-panel .ec-mm-col {
	flex: 0 1 auto;
	min-width: 160px;
	max-width: 280px;
	box-sizing: border-box;
	text-align: left;
}
.ec-mm-col__title {
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 1px solid #ececec;
	color: #1d1d1f;
}

/* Link list */
.ec-mm-col__links {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ec-mm-col > *:last-child { margin-bottom: 0 !important; }
.ec-mm-col__links li { margin: 0; }
.ec-mm-col__links a {
	display: block !important;
	justify-content: flex-start !important;
	text-align: left !important;
	color: #1d1d1f;
	text-decoration: none;
	font-size: 12px;
	line-height: 1.5;
	padding: 5px 0 !important;
	min-height: 0 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	transition: color .15s ease, transform .15s ease;
}
.ec-mm-col__links a:hover {
	color: #b68973; /* matches theme accent (used in swatches) */
	transform: translateX(2px);
}

/* Product card — uses the WC loop template; only neutralize layout that breaks inside the megamenu. */
.ec-mm-product-wrap {
	margin-top: 0;
	padding: 24px;
	text-align: left;
	background: #BBB4AC;
	align-self: stretch;
}
.ec-mm-product-wrap .products.ec-mm-product-loop {
	margin: 0;
	padding: 0;
	list-style: none;
	display: block;
}
.ec-mm-product-wrap .products.ec-mm-product-loop > li {
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 220px;
	float: none;
	list-style: none;
}
/* Tighter product card layout inside the megamenu */
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__body {
	padding: 10px 0 0 !important;
	gap: 2px !important;
}
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__title { font-size: 14px !important; line-height: 1.25 !important; }
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__meta { font-size: 11px !important; }
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__price .price { font-size: 13px !important; }
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__cta {
	margin-top: 2px !important;
	font-size: 11px !important;
}
.ec-mm-product-wrap .products li.ec-loop-card .ec-loop-card__cta-icon { width: 11px !important; height: 11px !important; }

/* Mobile: hide the desktop megamenu panel completely — the mobile drawer renders
   the injected sub-menu items instead. */
@media (max-width: 1024px) {
	.ec-mm-panel { display: none !important; }
}
