/*
 * Printley — header mega menu.
 * Desktop: full-width hover panel under the primary nav. Mobile: accordion.
 */

/* Anchor the panel to the FULL-WIDTH nav wrapper (.main-navigation itself is only
   the centered ~1024px band, so anchoring there left the panel narrow/offset).
   .shoptimizer-primary-navigation spans the viewport (x=0). z-index lifts the panel
   above the hero section below the nav. */
.shoptimizer-primary-navigation { position: relative; z-index: 200; }
.main-navigation { position: static; }
.main-navigation .printley-has-mega { position: static; }

/* Panel: spans the full-width wrapper, dropping below the nav. Content is centered
   via .printley-mega-inner. Hidden until hover/focus. */
.printley-mega-panel {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1000;
	/* A broad theme rule fixes nav descendants to the bar height (~127px); force
	   auto so the panel grows to contain all product rows (white covers them). */
	height: auto !important;
	min-height: 0;
	background: #fff;
	border-top: 3px solid var(--cl-primary, #f26522);
	box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
}
@media (min-width: 993px) {
	.main-navigation .printley-has-mega:hover > .printley-mega-panel,
	.main-navigation .printley-has-mega:focus-within > .printley-mega-panel {
		display: block;
	}
}

.printley-mega-inner {
	max-width: calc(1920px + 5.2325em);
	margin: 0 auto;
	padding: 1.75rem 2.617924em;
	box-sizing: border-box;
	height: auto !important;
	min-height: 0;
}
.printley-mega-heading {
	margin: 0 0 1rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: #111;
}
.printley-mega-products {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	/* The theme makes nav sub-<ul>s position:absolute (out of flow), so the list
	   contributed no height and the white panel stayed short. Force it in-flow. */
	position: static !important;
	width: auto;
	/* Grid (not column-count): grid grows deterministically by row. */
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: .55rem 2.5rem;
}
.printley-mega-products li {
	margin: 0;
}
.printley-mega-products a {
	color: #333;
	text-decoration: none;
	font-size: .95rem;
}
.printley-mega-products a:hover {
	color: var(--cl-primary, #f26522);
	text-decoration: underline;
}
.printley-mega-all {
	display: inline-block;
	font-weight: 600;
	color: var(--cl-primary, #f26522);
	text-decoration: none;
}
.printley-mega-all:hover { text-decoration: underline; }

@media (max-width: 1200px) {
	.printley-mega-products { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Mobile (<=992px): static accordion, no hover ===== */
@media (max-width: 992px) {
	.printley-mega-panel {
		position: static;
		display: none;
		left: auto;
		width: auto;
		margin-left: 0;
		box-shadow: none;
		border-top: 0;
		background: transparent;
	}
	.printley-has-mega.is-open > .printley-mega-panel {
		display: block;
	}
	.printley-mega-inner {
		max-width: none;
		padding: .5rem 0 .75rem 1rem;
	}
	.printley-mega-products {
		grid-template-columns: 1fr;
	}
	.printley-mega-heading { display: none; }
}
