/* ==========================================================================
   Floating glass navigation
   Two pills locked to the viewport over a blurred backdrop, plus a mega panel
   in the same treatment. Loaded after style.css.
   ========================================================================== */

.mn-nav {
	position: fixed;
	top: 0.9rem;
	left: 0;
	right: 0;
	z-index: 900;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 clamp(0.9rem, 2.2vw, 1.75rem);
	pointer-events: none;          /* only the pills catch the pointer */
}
.admin-bar .mn-nav { top: calc(0.9rem + 32px); }
@media (max-width: 782px) { .admin-bar .mn-nav { top: calc(0.9rem + 46px); } }

/* The glass itself. */
.mn-nav__pill,
.mn-mega {
	pointer-events: auto;
	background: rgba(252, 252, 247, 0.58);
	-webkit-backdrop-filter: blur(26px) saturate(1.6);
	backdrop-filter: blur(26px) saturate(1.6);
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-shadow: 0 10px 40px -16px rgba(20, 40, 14, 0.28);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.mn-nav__pill,
	.mn-mega { background: rgba(252, 252, 247, 0.95); }
}

.mn-nav__pill {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	border-radius: var(--r-pill);
	padding: 0.4rem 0.5rem 0.4rem 1.15rem;
	min-height: 52px;
}
.mn-nav__pill--right { padding: 0.4rem 0.4rem 0.4rem 1.1rem; }

.mn-nav__brand {
	display: inline-flex;
	align-items: center;
	color: var(--forest);
	text-decoration: none;
	margin-right: 0.6rem;
}

/* Complete brand marks, including the original wordmark and establishment year. */
.mn-nav__logo { display: block; width: 46px; height: 46px; object-fit: contain; }
.mn-nav__logo--light { display: none; }
.mn-nav--on-dark .mn-nav__logo--dark { display: none; }
.mn-nav--on-dark .mn-nav__logo--light { display: block; }

.mn-nav__links {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.mn-nav__item { position: static; margin: 0; }

.mn-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	background: transparent;
	border: 0;
	border-radius: var(--r-pill);
	padding: 0.55rem 0.95rem;
	font-family: var(--sans);
	font-size: 0.94rem;
	font-weight: 350;
	letter-spacing: -0.012em;
	line-height: 1;
	color: var(--forest);
	text-decoration: none;
	cursor: pointer;
	transition: background 200ms ease;
}
.mn-nav__link:hover,
.mn-nav__item--mega.is-open .mn-nav__link {
	background: rgba(28, 58, 19, 0.09);
	color: var(--forest);
}
.mn-nav__link--quiet { color: var(--ink-2); }

.mn-nav__cart {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	background: var(--forest);
	color: var(--cream);
	border-radius: var(--r-pill);
	padding: 0.65rem 1.1rem;
	font-size: 0.92rem;
	font-weight: 350;
	letter-spacing: -0.012em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background 200ms ease;
}
.mn-nav__cart:hover { background: var(--forest-soft); color: var(--cream); }
/* WooCommerce wraps the subtotal in .amount, which the base sheet colours forest —
   invisible on the forest cart pill. Inherit instead. */
.mn-nav__cart-total,
.mn-nav__cart .amount,
.mn-nav__cart .woocommerce-Price-currencySymbol {
	color: inherit;
	font-variant-numeric: tabular-nums;
}
.mn-nav__cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35em;
	height: 1.35em;
	padding: 0 0.35em;
	border-radius: var(--r-pill);
	background: var(--lime);
	color: var(--forest);
	font-size: 0.78rem;
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- mega panel */

.mn-mega {
	position: absolute;
	top: calc(100% + 0.55rem);
	left: 0;
	width: min(420px, calc(100vw - 2rem));
	border-radius: var(--r-sect);
	padding: 0.75rem;
	/* Denser than the pills: a panel carrying product names and counts has to be
	   readable over whatever the page puts behind it, and blur alone leaves large
	   headline type showing through as legible shapes. */
	background: rgba(252, 252, 247, 0.86);
	-webkit-backdrop-filter: blur(30px) saturate(1.5);
	backdrop-filter: blur(30px) saturate(1.5);
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 200ms ease, transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mn-nav__item--mega.is-open .mn-mega { opacity: 1; transform: none; }

.mn-mega__list { list-style: none; margin: 0; padding: 0; }
.mn-mega__list li { margin: 0; }
.mn-mega__list a {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	padding: 0.6rem;
	border-radius: var(--r-card);
	text-decoration: none;
	transition: background 180ms ease;
}
.mn-mega__list a:hover { background: rgba(28, 58, 19, 0.08); }

.mn-mega__thumb {
	flex: none;
	width: 62px;
	height: 62px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.55);
	display: grid;
	place-items: center;
	overflow: hidden;
	/* Uniform inset so every packshot floats in the same bed. */
	padding: 7px;
}
.mn-mega__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	/* The packshots arrive with baked white/stone grounds that used to paint
	   over the translucent bed, so each tile showed a different box. Multiply
	   drops the baked ground into the bed — the panel behind is 0.86 cream over
	   blur(30px), uniform enough for the blend to read cleanly. */
	mix-blend-mode: multiply;
}
.mn-mega__text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.mn-mega__meta { font-size: 0.78rem; color: var(--ink-3); }
.mn-mega__name {
	font-size: 1.1rem;
	font-weight: 350;
	letter-spacing: -0.02em;
	color: var(--forest);
	line-height: 1.15;
}
.mn-mega__list .mn-badge { margin-left: auto; flex: none; }

.mn-mega__all {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0.5rem 0.6rem 0.35rem;
	padding-bottom: 0.15rem;
	font-size: 0.94rem;
	font-weight: 500;
	color: var(--forest);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

/* Link-list panels (Science, Learn): the same glass, no imagery — the seed.com
   pattern where secondary nav items open a compact list of destinations. */
.mn-mega--links { width: min(300px, calc(100vw - 2rem)); }
.mn-mega--links .mn-mega__list a { padding: 0.55rem 0.7rem; }
.mn-mega--links .mn-mega__name { font-size: 1rem; }

/* Anchors opened from the panels must land clear of the floating pills. */
.mn-topic[id],
#videos { scroll-margin-top: 6.5rem; }

/* ------------------------------------------------------------- dark ground */

/* Over dark bands the glass inverts so the nav keeps reading. */
.mn-nav--on-dark .mn-nav__pill {
	background: rgba(28, 58, 19, 0.5);
	border-color: rgba(252, 252, 247, 0.18);
}
/* The panel stays light on dark grounds — its content is product imagery on
   white tiles, which needs a light surface behind it either way. */
.mn-nav--on-dark .mn-mega { background: rgba(252, 252, 247, 0.9); }
.mn-nav--on-dark .mn-nav__brand,
.mn-nav--on-dark .mn-nav__link { color: var(--cream); }
.mn-nav--on-dark .mn-nav__link--quiet { color: var(--on-dark-2); }
.mn-nav--on-dark .mn-nav__dot { background: var(--lime); }
.mn-nav--on-dark .mn-nav__link:hover { background: rgba(252, 252, 247, 0.14); }
.mn-nav--on-dark .mn-nav__cart { background: var(--cream); color: var(--forest); }
.mn-nav--on-dark .mn-nav__cart:hover { background: #fff; }
.mn-nav--on-dark .mn-nav__cart-count { background: var(--forest); color: var(--lime); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
	.mn-nav { top: 0.6rem; }
	.mn-nav__pill { padding-left: 0.9rem; min-height: 46px; }
	.mn-nav__link { padding: 0.5rem 0.7rem; font-size: 0.88rem; }
	.mn-nav__brand { margin-right: 0.3rem; }
	.mn-nav__logo { width: 40px; height: 40px; }
	.mn-nav__link--quiet { display: none; }
}
@media (max-width: 640px) {
	/* Only the Shop item survives — Science and Learn are now mega items too,
	   so the old :not(--mega) guard would keep all three. */
	.mn-nav__links .mn-nav__item:not(:first-child) { display: none; }
	.mn-nav__cart-total { display: none; }
	.mn-mega { left: 0; right: auto; width: min(340px, calc(100vw - 1.6rem)); }
}

@media (prefers-reduced-motion: reduce) {
	.mn-mega { transition: none; }
}
