/* ===== Modern Menu Patch (non-destructive) ===== */
:root {
	/* --nav-bg: rgba(255, 255, 255, .82);
	--nav-border: rgba(0, 0, 0, .08); */
	--nav-shadow: 0 8px 24px rgba(0, 0, 0, .08);
	--nav-text: #1f2937;
	--nav-muted: rgba(31, 41, 55, .75);
	/* --nav-accent: #0ea5e9; */
	--nav-radius: 14px;
}

/* container */
#top-menu.top-menu {
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
}

/* bar */
#top-menu .nav-bar {
	position: sticky;
	top: 8px;
	z-index: 50;
	background: var(--nav-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid var(--nav-border);
	box-shadow: var(--nav-shadow);
	border-radius: var(--nav-radius);
	padding: 10px 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

/* links (desktop) */
#top-menu .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

#top-menu .nav-links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border-radius: 999px;
	text-decoration: none;
	color: var(--nav-text);
	font-size: 15px;
	line-height: 1;
	transition: transform .12s ease, background-color .12s ease, color .12s ease;
	background: rgba(255, 255, 255, .6);
	border: 1px solid rgba(0, 0, 0, .05);
	box-sizing: border-box;
}

#top-menu .nav-links a:hover {
	background: rgba(14, 165, 233, .10);
	border-color: rgba(14, 165, 233, .22);
	color: #0b6b97;
	transform: translateY(-1px);
}

#top-menu .nav-links a:focus {
	outline: 2px solid rgba(14, 165, 233, .35);
	outline-offset: 2px;
}

/* toggle (mobile) */
#top-menu .nav-toggle {
	display: none;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, .10);
	background: rgba(255, 255, 255, .72);
	color: var(--nav-text);
	cursor: pointer;
	user-select: none;
}

#top-menu .nav-toggle__icon {
	width: 18px;
	height: 14px;
	position: relative;
	display: inline-block;
}

#top-menu .nav-toggle__icon:before,
#top-menu .nav-toggle__icon:after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--nav-muted);
	border-radius: 2px;
}

#top-menu .nav-toggle__icon:before {
	top: 1px;
	box-shadow: 0 5px 0 var(--nav-muted), 0 10px 0 var(--nav-muted);
}

#top-menu .nav-toggle__icon:after {
	display: none;
}

/* ===== Responsive behavior ===== */
@media (max-width: 768px) {
	#top-menu .nav-bar {
		justify-content: space-between;
	}

	#top-menu .nav-toggle {
		display: inline-flex;
	}

	#top-menu .nav-links {
		display: none;
		width: 100%;
		padding-top: 10px;
		border-top: 1px solid rgba(0, 0, 0, .08);
		margin-top: 10px;
		justify-content: flex-start;
	}

	#top-menu .nav-links a {
		width: 100%;
		justify-content: flex-start;
		border-radius: 12px;
		padding: 12px 12px;
	}

	#top-menu .nav-bar.is-open {
		flex-wrap: wrap;
		align-items: flex-start;
	}

	#top-menu .nav-bar.is-open .nav-links {
		display: flex;
		flex-direction: column;
		gap: 8px;
	}
}

/* safer: avoid menu being too wide on old 1000px layout */
@media (max-width: 1100px) {
	#main.main {
		width: min(1000px, 100%);
	}

	#top-menu.top-menu {
		padding: 0;
		box-sizing: border-box;
		background-color: rgb(236, 255, 213, 0.5)
	}
}

/* ===== Inner Pages: turn left sidebar into top subnav ===== */

/* The legacy inner pages use a 2-column TABLE: left menu (234px) + content (#products).
   To avoid shrinking the main content, we stack the menu on top and let content be full width.
   This is intentionally non-destructive (no HTML changes, no image path changes). */

table[width="1000"] {
	width: min(100%, 1000px) !important;
}

td * {
	max-width: 100%;
}

td#products {
	width: 100% !important;
	display: block;
	vertical-align: top;
}

td#products>table {
	width: 100% !important;
}

td[width="234"][valign="top"] {
	width: 100% !important;
	display: block;
}

td[width="234"][valign="top"]>table {
	width: 100% !important;
}

/* Make the left-menu title image responsive */
td[width="234"][valign="top"] img {
	max-width: 100%;
	height: auto;
}

/* Convert the left list into modern pills */
#left-menu {
	width: 100%;
}

/* Ensure the main content block stays on a solid white canvas after stacking (legacy pages rely on TD bgcolor) */
td#products,
body #products,
td[width="234"][valign="top"] {
	background: #FFFFFF !important;
}

#left-menu ul {
	list-style: none;
	margin: 0;
	padding: 12px 12px 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

#left-menu li {
	margin: 0;
	padding: 0;
}

#left-menu a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .82);
	border: 1px solid rgba(0, 0, 0, .10);
	color: var(--nav-text);
	text-decoration: none;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
	transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

#left-menu a:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
	border-color: rgba(14, 165, 233, .35);
}

#left-menu a:focus {
	outline: 2px solid rgba(14, 165, 233, .35);
	outline-offset: 2px;
}

/* Give the content some breathing room on small screens */
@media (max-width: 768px) {
	td#products {
		padding: 0 12px !important;
	}
}

/* ===== Inner menu pill layout fix (v2) =====
   Some inner pages render the current item as plain text (no <a>), and legacy CSS adds arrow bullets.
   We style the <li> itself as the pill so BOTH linked and non-linked items look consistent.
*/
#left-menu ul {
	justify-content: center !important;
	margin: 10px auto 18px !important;
	/* prevent clipping inside legacy 1000px tables */
	max-width: 100% !important;
	box-sizing: border-box;
	padding-left: 16px !important;
	padding-right: 16px !important;
}

/* kill legacy bullets/arrows/backgrounds */
#left-menu ul,
#left-menu li {
	list-style: none !important;
}

#left-menu li {
	background: none !important;
	background-image: none !important;
	padding-left: 0 !important;
}

/* Make LI the pill */
#left-menu li {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 10px 14px !important;
	border-radius: 999px !important;
	background: rgba(255, 255, 255, .86) !important;
	border: 1px solid rgba(0, 0, 0, .10) !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .06) !important;
	margin: 0 !important;
	/* allow long labels to wrap instead of pushing outside */
	white-space: normal !important;
	text-align: center;
	color: var(--nav-text) !important;
	max-width: 100%;
}

/* Anchor becomes just the text inside the pill */
#left-menu li>a {
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
	white-space: normal !important;
	text-align: center;
}

/* On narrower screens, make pills more compact so they wrap nicely */
@media (max-width: 1024px) {
	#left-menu li {
		padding: 9px 12px !important;
	}

	#left-menu li>a {
		font-size: 14px;
	}
}

@media (max-width: 768px) {
	#left-menu ul {
		gap: 8px;
	}

	#left-menu li {
		width: 100%;
	}

	#left-menu li>a {
		justify-content: center !important;
	}
}

/* Hover (works for both) */
#left-menu li:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(0, 0, 0, .08) !important;
	border-color: rgba(0, 0, 0, .18) !important;
}

/* === Inner Pages Layout Fix: remove legacy right-float that leaves a blank left column === */
body #products {
	float: none !important;
	width: auto !important;
	max-width: 100% !important;
	position: relative !important;
}

body #products table {
	width: 100% !important;
	max-width: 100% !important;
}

/* ===== v5 FIX: prevent #products float/width from pushing content off-screen ===== */
td#products,
#products {
	float: none !important;
	width: auto !important;
	clear: both !important;
}

/* When stacked, the old mid-line separator is no longer needed */
td#products,
#products {
	background-image: none !important;
}

/* Mobile: make subnav pills full-width and centered so nothing overflows */
@media (max-width: 768px) {
	#left-menu ul {
		flex-direction: column;
		align-items: stretch;
		padding-left: 12px;
		padding-right: 12px;
	}

	#left-menu li {
		width: 100%;
	}

	#left-menu a {
		width: 100%;
		box-sizing: border-box;
		justify-content: center;
		text-align: center;
	}
}

/* ===== Mobile: move inner left-menu items into hamburger ===== */
@media (max-width: 768px) {

	/* Hide legacy inner sidebar area on mobile (it will be injected into hamburger) */
	#left-menu,
	td[width="234"][valign="top"] {
		display: none !important;
	}

	/* Ensure content is full width and not floated */
	td#products,
	#products {
		float: none !important;
		width: auto !important;
		max-width: 100% !important;
		display: block;
		background: #fff !important;
	}

	#products table {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Inner-subnav block inside hamburger panel (#site-nav) */
	#top-menu #site-nav .inner-subnav {
		margin-top: 12px;
		padding-top: 12px;
		border-top: 1px solid rgba(0, 0, 0, .08);
	}

	#top-menu #site-nav .inner-subnav__title {
		font-size: 13px;
		color: var(--nav-muted);
		margin: 0 0 8px;
	}

	#top-menu #site-nav .inner-subnav__list {
		list-style: none;
		padding: 0;
		margin: 0;
		display: grid;
		gap: 8px;
	}

	#top-menu #site-nav .inner-subnav__list a,
	#top-menu #site-nav .inner-subnav__list .subitem--text {
		display: block;
		width: 100%;
		padding: 12px 12px;
		border-radius: 12px;
		border: 1px solid rgba(0, 0, 0, .10);
		background: rgba(255, 255, 255, .72);
		color: var(--nav-text);
		text-decoration: none;
	}

	#top-menu #site-nav .inner-subnav__list a:hover {
		border-color: rgba(14, 165, 233, .25);
		background: rgba(14, 165, 233, .08);
	}

	#top-menu #site-nav .inner-subnav__list .subitem--text {
		opacity: .78;
	}
}

/* ===== Mobile: move inner-page left menu into hamburger (keep page clean) ===== */
@media (max-width: 768px) {

	/* hide legacy left menu block on page */
	#left-menu {
		display: none !important;
	}

	/* make main content full width (legacy css uses float + fixed width) */
	#products,
	td#products {
		float: none !important;
		width: auto !important;
		max-width: 100% !important;
		display: block;
		box-sizing: border-box;
	}

	#products table,
	td#products>table {
		width: 100% !important;
		max-width: 100% !important;
	}
}