/**
 * ROLT Category Mega Menu — front-end styling (v2.2).
 *
 * Two shipped presets (root classes):
 *   .cpw-mm--p-dark   dark rail look (default — "best of best")
 *   .cpw-mm--p-light  light classic look
 *
 * Colors are CSS variables; the plugin only injects overrides for colors
 * you actually changed in Settings → Design, so each preset keeps its own
 * sensible palette until you customize it. You can also re-skin from
 * Customizer → Additional CSS, e.g.:
 *
 *   .cpw-mm { --cpw-accent: #2b2a95; --cpw-cols: 4; }
 */

.cpw-mm {
	/* -------- light palette (base/fallback) -------- */
	--cpw-accent: #2b2a95;         /* headings / accents               */
	--cpw-brand-bg: #b9b6e4;       /* brand button background          */
	--cpw-brand-bg-hover: #ff4b2b; /* brand hover / active background  */
	--cpw-brand-text: #2b2a95;     /* brand button text                */
	--cpw-brand-text-hover: #fff;
	--cpw-brand-border: #2b2a95;
	--cpw-panel-bg: #ffffff;
	--cpw-link: #333333;
	--cpw-title: #2b2a95;          /* group titles                     */
	--cpw-title-line: #b9b6e4;
	--cpw-filter-bg: #f3f3f7;
	--cpw-filter-text: #333;
	--cpw-filter-border: #dddde6;
	--cpw-cols: 4;                 /* columns in the model panel       */

	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	align-content: flex-start; /* rows keep natural height — the filter bar
	                              never stretches on short menus */
	gap: 20px 24px;
	background: var(--cpw-panel-bg);
	min-height: 320px;
	width: 100%;
}

/* -------- dark rail preset (xcell-style) -------- */

.cpw-mm--p-dark {
	--cpw-brand-bg: #1e1e28;
	--cpw-brand-bg-hover: #ff4b2b;
	--cpw-brand-text: #e8e8f0;
	--cpw-brand-text-hover: #fff;
	--cpw-brand-border: #2b2b38;
	--cpw-panel-bg: #14141a;
	--cpw-link: #c9c9d6;
	--cpw-title: #ffffff;
	--cpw-title-line: #33333f;
	--cpw-filter-bg: #1b1b23;
	--cpw-filter-text: #e8e8f0;
	--cpw-filter-border: #2b2b38;
}

/* ------------------------------------------------- filter bar */

.cpw-mm-filterbar {
	flex: 1 1 100%;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--cpw-filter-bg);
	border: 1px solid var(--cpw-filter-border);
	border-radius: 999px;
	padding: 9px 18px;
	min-height: 0;
}

.cpw-mm-filterbar svg {
	flex: 0 0 auto;
	opacity: 0.55;
	color: var(--cpw-filter-text);
}

/* Hardened against theme input styles (Astra etc. style input[type=search]
 * with white backgrounds, borders, and tall padding). */
.cpw-mm .cpw-mm-filter,
.cpw-mm .cpw-mm-filter:focus,
.cpw-mm .cpw-mm-filter:hover {
	flex: 1 1 auto;
	appearance: none;
	-webkit-appearance: none;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	border-radius: 0;
	color: var(--cpw-filter-text) !important;
	font-size: 14px;
	line-height: 1.4;
	padding: 0 !important;
	margin: 0;
	width: 100%;
	height: auto;
	min-height: 0;
}

.cpw-mm .cpw-mm-filter::placeholder { color: var(--cpw-filter-text); opacity: 0.5; }
.cpw-mm .cpw-mm-filter::-webkit-search-decoration,
.cpw-mm .cpw-mm-filter::-webkit-search-cancel-button { -webkit-appearance: none; }

.cpw-mm-filter-empty {
	flex: 1 1 100%;
	color: var(--cpw-link);
	opacity: 0.7;
	font-size: 14px;
	padding: 4px 2px;
}

/* Search-results view: typing shows matches from EVERY brand's tree
 * (subcategories AND sub-subcategories), grouped per brand. */
.cpw-mm-sr .cpw-mm-group-title--static { opacity: 0.9; }
.cpw-mm-sr mark {
	background: transparent;
	color: var(--cpw-brand-bg-hover);
	font-weight: 700;
}

/* ------------------------------------------------- theme hardening
 * Inside theme navigation (Astra etc.), menu CSS leaks into our lists —
 * li paddings, line-heights, link spacing. Reset everything we own.
 * The root pins font-size/line-height so the theme's header values
 * (e.g. Astra's 52px nav line-height, 17px font) can NEVER inherit in
 * and inflate every row into a 52px line box. */

.cpw-mm {
	font-size: 14px !important;
	line-height: 1.5 !important;
}

.cpw-mm ul,
.cpw-mm li {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.cpw-mm .cpw-mm-brands-item { margin: 0 0 8px !important; }
.cpw-mm .cpw-mm-links li { margin: 0 0 4px !important; }

.cpw-mm .cpw-mm-links a {
	display: inline-block;
	padding: 1px 0 !important;
	margin: 0 !important;
	line-height: 1.5 !important;
	font-size: 14px !important;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

.cpw-mm a.cpw-mm-brand {
	padding: 9px 14px !important;
	margin: 0 !important;
	line-height: 1.35 !important;
	font-size: 14px !important;
	text-transform: none;
	letter-spacing: 0;
}

.cpw-mm .cpw-mm-group { margin: 0 0 18px !important; }

.cpw-mm .cpw-mm-group-title {
	padding: 0 0 4px !important;
	margin: 0 0 6px !important;
	line-height: 1.4 !important;
	font-size: 14.5px !important;
	text-transform: none;
	letter-spacing: 0;
}

.cpw-mm .cpw-mm-viewall { margin: 0 0 14px !important; padding: 0 !important; }

/* ------------------------------------------------- brand rail */

.cpw-mm-brands {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 0 0 250px;
	max-height: 480px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.cpw-mm-brands-item {
	margin: 0 0 8px;
}

.cpw-mm-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--cpw-brand-border);
	border-radius: 10px;
	background: var(--cpw-brand-bg);
	color: var(--cpw-brand-text);
	font-weight: 600;
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.cpw-mm-brand:hover,
.cpw-mm-brand:focus,
.cpw-mm-brand.is-active {
	background: var(--cpw-brand-bg-hover);
	color: var(--cpw-brand-text-hover);
	border-color: var(--cpw-brand-bg-hover);
}

.cpw-mm--p-dark .cpw-mm-brand.is-active {
	transform: translateX(3px);
	box-shadow: 0 6px 18px rgba(255, 75, 43, 0.28);
}

.cpw-mm-brand-icon {
	display: inline-flex;
	align-items: center;
	font-size: 18px;
	line-height: 1;
	opacity: 0.75;
	margin-left: 6px;
	flex: 0 0 auto;
}

.cpw-mm-brand.is-active .cpw-mm-brand-icon,
.cpw-mm-brand:hover .cpw-mm-brand-icon {
	opacity: 1;
}

/* ------------------------------------------------- flat mode
 * When NO brand has subcategories (shallow 2-level trees), there are no
 * panels to show: hide the panel area and spread the brand buttons across
 * the full width instead of leaving empty space. */

.cpw-mm--flat { min-height: 0; }

.cpw-mm--flat .cpw-mm-panel { display: none; }

.cpw-mm--flat .cpw-mm-brands {
	flex: 1 1 100%;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
	max-height: none;
	overflow: visible;
}

.cpw-mm--flat .cpw-mm-brands-item { margin: 0; }

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

.cpw-mm-panel {
	position: relative;
	flex: 1 1 0%; /* basis 0: never wraps below the rail, however big the tree */
	min-width: 0;
	padding: 4px 8px;
}

/* Inside nav/bar dropdowns huge trees scroll instead of growing forever. */
.cpw-mm-nav-li > .cpw-mm-dropdown .cpw-mm-panel {
	max-height: 470px;
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Fresh content slides up + fades in (120ms, GPU-composited). */
@keyframes ossoCmmFadeUp {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.cpw-mm-panel-inner.is-fresh {
	animation: ossoCmmFadeUp 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.cpw-mm-viewall {
	margin: 0 0 14px;
	font-weight: 700;
}

.cpw-mm-viewall a {
	color: var(--cpw-title);
	text-decoration: none;
}

.cpw-mm-viewall a:hover {
	color: var(--cpw-brand-bg-hover);
	text-decoration: underline;
}

.cpw-mm-groups {
	column-count: var(--cpw-cols);
	column-gap: 28px;
}

.cpw-mm-group {
	break-inside: avoid;
	margin: 0 0 18px;
}

/* Flat model lists (3-level branches): the single group spans the panel and
 * its links flow in columns — instead of one long single-column list. */
.cpw-mm-group--flat {
	column-span: all;
	break-inside: auto;
}

.cpw-mm-group--flat .cpw-mm-links {
	column-count: var(--cpw-cols);
	column-gap: 28px;
}

.cpw-mm-group-title {
	display: block;
	font-weight: 700;
	color: var(--cpw-title);
	text-decoration: none;
	margin: 0 0 6px;
	border-bottom: 2px solid var(--cpw-title-line);
	padding-bottom: 4px;
}

a.cpw-mm-group-title:hover {
	color: var(--cpw-brand-bg-hover);
}

.cpw-mm-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cpw-mm-links li {
	margin: 0 0 4px;
}

.cpw-mm-links a {
	color: var(--cpw-link);
	text-decoration: none;
	font-size: 14px;
	line-height: 1.5;
	display: inline-block;
	padding: 1px 0;
	transition: color 0.12s ease;
}

.cpw-mm-links a:hover {
	color: var(--cpw-brand-bg-hover);
}

.cpw-mm-empty a {
	color: var(--cpw-title);
	font-weight: 600;
}

/* ------------------------------------------------- category tag/badge */

.cpw-mm-badge {
	display: inline-block;
	background: var(--cpw-brand-bg-hover);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	padding: 3px 6px;
	border-radius: 8px;
	margin-left: 7px;
	vertical-align: middle;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

/* ------------------------------------------------- loader dots */

.cpw-mm-panel-loader {
	position: absolute;
	top: 40px;
	left: 24px;
	display: flex;
	gap: 6px;
}

.cpw-mm-panel-loader[hidden] {
	display: none;
}

.cpw-mm-panel-loader span {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--cpw-title);
	animation: ossoCmmPulse 0.9s infinite ease-in-out;
}

.cpw-mm-panel-loader span:nth-child(2) { animation-delay: 0.15s; }
.cpw-mm-panel-loader span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ossoCmmPulse {
	0%, 100% { opacity: 0.25; transform: scale(0.85); }
	50%      { opacity: 1;    transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.cpw-mm-brand,
	.cpw-mm-panel-inner.is-fresh,
	.cpw-mm-panel-loader span,
	.cpw-mm-nav-li > .cpw-mm-dropdown,
	.cpw-mm-nav-li > .cpw-mm-dropdown > .cpw-mm {
		transition: none !important;
		animation: none !important;
	}
}

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

@media (max-width: 1200px) {
	.cpw-mm { --cpw-cols: 3; }
}

@media (max-width: 921px) {
	.cpw-mm {
		flex-direction: column;
		min-height: 0;
	}
	.cpw-mm-brands {
		flex-basis: auto;
		max-height: none;
	}
	.cpw-mm { --cpw-cols: 2; }
}

@media (max-width: 544px) {
	.cpw-mm { --cpw-cols: 1; }
}

/* Mobile behaviour (hide / links / accordion) is generated dynamically
 * with the configured breakpoint — see inline_vars_css() in the plugin. */

/* ------------------------------------------------- nav-menu dropdown
 * Used when "Attach mega menus directly to navigation menu items" is on.
 * The <li> gets .cpw-mm-nav-li; the dropdown opens on hover/focus with a
 * 140ms fade/slide (opacity + transform — GPU-composited, no layout). */

.cpw-mm-nav-li {
	position: relative;
}

/* When our mega menu is attached to a nav item, suppress the theme's own
 * native dropdown for that item (prevents double menus on sites where the
 * menu items also have real child items). */
.cpw-mm-nav-li > .sub-menu,
.cpw-mm-nav-li > .astra-full-megamenu-wrapper,
.cpw-mm-nav-li > .ast-mm-custom-content,
.cpw-mm-nav-li > .ast-menu-toggle,
.cpw-mm-nav-li > a .ast-icon.icon-arrow,
.cpw-mm-nav-li .dropdown-menu-toggle {
	display: none !important;
}

/* Closed = display:none. A subtree that is not rendered can never be
 * hit-tested, hovered, or targeted by synthesized pointer events - in
 * ANY browser. (Firefox was observed delivering pointer events into
 * the hidden panel during scroll animations; display:none ends that
 * whole class of bug.) The fade-in on open comes from @starting-style
 * below - browsers without it simply open instantly. */
.cpw-mm-nav-li > .cpw-mm-dropdown {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: min(1140px, 94vw);
	background: transparent;
	padding: 0;
	display: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 99999;
}

/* The chrome (background, shadow, radius) lives on the menu root itself so
 * the dark/light preset controls it. */
.cpw-mm-nav-li > .cpw-mm-dropdown > .cpw-mm {
	box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
	border-radius: 0 0 12px 12px;
	padding: 22px 24px;
	box-sizing: border-box;
	transform: translateY(-14px);
	transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.cpw-mm-nav-li > .cpw-mm-dropdown > .cpw-mm--p-dark {
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* Opening is JS-gated (.cpw-mm-js-open) rather than :hover so browsers
 * that re-evaluate hover while content scrolls under a stationary cursor
 * (Firefox) can never pop the menu open on their own. Keyboard focus
 * still opens it without JS involvement. */
.cpw-mm-nav-li.cpw-mm-js-open > .cpw-mm-dropdown,
.cpw-mm-nav-li:focus-within > .cpw-mm-dropdown {
	display: block;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.14s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Entry animation from display:none (browsers with @starting-style). */
@starting-style {
	.cpw-mm-nav-li.cpw-mm-js-open > .cpw-mm-dropdown,
	.cpw-mm-nav-li:focus-within > .cpw-mm-dropdown {
		opacity: 0;
	}
}

.cpw-mm-nav-li.cpw-mm-js-open > .cpw-mm-dropdown > .cpw-mm,
.cpw-mm-nav-li:focus-within > .cpw-mm-dropdown > .cpw-mm {
	transform: translateY(0);
}

/* Keep the dropdown reachable: bridge the hover gap under the nav link. */
.cpw-mm-nav-li > .cpw-mm-dropdown::before {
	content: "";
	position: absolute;
	top: -14px;
	left: 0;
	right: 0;
	height: 14px;
}

/* Mobile handling of nav dropdowns is generated dynamically with the
 * configured breakpoint — see inline_vars_css() in the plugin. */

/* ------------------------------------------------- menu bar builder
 * [osso_cmm_menu_bar] — the whole bar is plugin-rendered (single template).
 * Items with a linked category reuse .cpw-mm-nav-li, so the dropdown,
 * animations, clamping, and mobile accordion all come for free. */

.cpw-mmbar {
	--cpw-bar-bg: #101016;
	--cpw-bar-link: #f2f2f7;
	--cpw-bar-link-hover: #ff4b2b;
	--cpw-bar-radius: 12px;

	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 2px;
	margin: 0;
	padding: 4px 10px;
	background: var(--cpw-bar-bg);
	border-radius: var(--cpw-bar-radius);
}

.cpw-mmbar--p-light {
	--cpw-bar-bg: #2b2a95;
	--cpw-bar-link: #ffffff;
	--cpw-bar-link-hover: #ff4b2b;
}

.cpw-mmbar-item { margin: 0; }

.cpw-mmbar-link {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 12px 16px;
	color: var(--cpw-bar-link);
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 9px;
	transition: background 0.14s ease, color 0.14s ease;
}

.cpw-mmbar-item:hover > .cpw-mmbar-link,
.cpw-mmbar-item:focus-within > .cpw-mmbar-link {
	background: var(--cpw-bar-link-hover);
	color: #fff;
}

.cpw-mmbar-caret {
	opacity: 0.6;
	transition: transform 0.16s ease, opacity 0.16s ease;
}

.cpw-mmbar-item:hover .cpw-mmbar-caret,
.cpw-mmbar-item:focus-within .cpw-mmbar-caret {
	transform: rotate(180deg);
	opacity: 1;
}

/* Bar dropdowns hang from the bar row. */
.cpw-mmbar .cpw-mm-nav-li > .cpw-mm-dropdown { top: calc(100% + 4px); }

/* Mobile layout for the bar is generated dynamically with the configured
 * breakpoint — see inline_vars_css() in the plugin. */

/* ------------------------------------------------- mobile drawer
 * Burger button → slide-out panel drilling down level by level
 * (items → brands → series → models) with a Back button. */

.cpw-mmbar-burger {
	display: none; /* shown below the breakpoint via inline_vars_css() */
	align-items: center;
	gap: 9px;
	background: var(--cpw-bar-bg, #101016);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 11px 16px;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	cursor: pointer;
}

.cpw-mmbar-burger--p-light { background: #2b2a95; }

.cpw-mm-noscroll { overflow: hidden; }

.cpw-mm-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 999998;
}

.cpw-mm-drawer-overlay.is-open { opacity: 1; visibility: visible; }

.cpw-mm-drawer {
	--cpwd-bg: #14141a;
	--cpwd-head: #101016;
	--cpwd-text: #f2f2f7;
	--cpwd-sub: #b9b9c6;
	--cpwd-line: #26262f;
	--cpwd-accent: #ff4b2b;

	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	width: min(86vw, 360px);
	background: var(--cpwd-bg);
	color: var(--cpwd-text);
	transform: translateX(-102%);
	transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 999999;
	display: flex;
	flex-direction: column;
	box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}

.cpw-mm-drawer.is-open { transform: translateX(0); }

.cpw-mm-drawer--p-light {
	--cpwd-bg: #ffffff;
	--cpwd-head: #2b2a95;
	--cpwd-text: #1d2327;
	--cpwd-sub: #555;
	--cpwd-line: #ececf2;
	--cpwd-accent: #ff4b2b;
}

.cpw-mm-drawer-head {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--cpwd-head);
	color: #fff;
	padding: 14px 14px;
	min-height: 54px;
}

.cpw-mm-drawer-title {
	flex: 1 1 auto;
	font-weight: 700;
	font-size: 15px;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* [hidden] must win over the display rule below — Back only shows when
 * there is actually a level to go back to. */
.cpw-mm-drawer-back[hidden] { display: none !important; }

.cpw-mm-drawer-back,
.cpw-mm-drawer-close {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	flex: 0 0 auto;
}

.cpw-mm-drawer-close { font-size: 18px; line-height: 1; padding: 5px 11px; }

/* Same theme-hover pin for the header buttons (they are <button>s too). */
.cpw-mm-drawer-back:hover,
.cpw-mm-drawer-back:focus,
.cpw-mm-drawer-close:hover,
.cpw-mm-drawer-close:focus {
	background: rgba(255, 255, 255, 0.2) !important;
	color: #fff !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none;
	transform: none !important;
}

.cpw-mm-drawer-body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

@keyframes ossoCmmDrawerIn   { from { opacity: 0.4; transform: translateX(24px); }  to { opacity: 1; transform: none; } }
@keyframes ossoCmmDrawerBack { from { opacity: 0.4; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.cpw-mm-drawer-list.is-slide-in   { animation: ossoCmmDrawerIn 0.18s ease; }
.cpw-mm-drawer-list.is-slide-back { animation: ossoCmmDrawerBack 0.18s ease; }

.cpw-mm-drawer-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--cpwd-line);
	color: var(--cpwd-text);
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 600;
	padding: 14px 16px;
	cursor: pointer;
	text-align: left;
}

.cpw-mm-drawer-row:active { background: rgba(127, 127, 127, 0.12); }

/* Pin hover/focus so the THEME's global button:hover / a:hover styles
 * (e.g. Astra's solid accent button hover) can never repaint a row.
 * Critical on iOS: after tapping into a submenu, Safari re-applies
 * :hover to whatever row lands under the finger in the new level —
 * with a theme hover style that painted a full red bar on a row the
 * user never chose. Rows stay flat; devices with a real pointer get a
 * subtle tint via the media query below. */
.cpw-mm-drawer-row:hover,
.cpw-mm-drawer-row:focus,
.cpw-mm-drawer-row:focus-visible {
	background: none !important;
	color: var(--cpwd-text) !important;
	border-color: var(--cpwd-line) !important;
	box-shadow: none !important;
	outline: none;
	transform: none !important;
}

.cpw-mm-drawer-row--viewall:hover,
.cpw-mm-drawer-row--viewall:focus,
.cpw-mm-drawer-row--viewall:focus-visible { color: var(--cpwd-accent) !important; }

@media (hover: hover) {
	.cpw-mm-drawer-row:hover { background: rgba(127, 127, 127, 0.09) !important; }
}

.cpw-mm-drawer-chev { flex: 0 0 auto; opacity: 0.55; }

.cpw-mm-drawer-row--viewall {
	color: var(--cpwd-accent);
	font-weight: 700;
}

.cpw-mm-drawer-row--loading { color: var(--cpwd-sub); font-weight: 400; }

.cpw-mm-drawer-row .cpw-mm-badge { margin-left: 7px; }

@media (prefers-reduced-motion: reduce) {
	.cpw-mm-drawer,
	.cpw-mm-drawer-overlay,
	.cpw-mm-drawer-list.is-slide-in,
	.cpw-mm-drawer-list.is-slide-back {
		transition: none !important;
		animation: none !important;
	}
}

/* ------------------------------------------------- hover effects (v2.9)
 * Design → Hover effect. Applied to top-level items: menu bar links and
 * nav-attached items. Colors pull the theme palette with fallbacks.
 * Scoped to devices that actually hover — never sticks on touch. */

.cpw-mm-fx-lift > a,
.cpw-mmbar--fx-lift .cpw-mmbar-link,
.cpw-mm-fx-glow > a,
.cpw-mmbar--fx-glow .cpw-mmbar-link {
	transition: transform 0.16s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.16s ease, border-radius 0.16s ease, text-shadow 0.16s ease, box-shadow 0.16s ease;
	will-change: transform;
}

/* Pill — a crisp text-sized chip drawn on a pseudo-element behind the
 * label, so it never tints the theme's full-height anchor box (which
 * reads as a smudge on dark bars). Accent color follows the theme.
 * Nav items: the chip lives on .cpw-mm-fx-inner (our own label wrap) —
 * theme anchors include the inter-item gap padding in their box, and a
 * chip sized to the anchor bleeds into the neighbouring item. The bar's
 * own links are compact, so the chip uses the link box there. */
.cpw-mm-fx-pill > a,
.cpw-mmbar--fx-pill .cpw-mmbar-link {
	position: relative;
	z-index: 0;
	transition: color 0.16s ease;
}

.cpw-mm-fx-pill > a .cpw-mm-fx-inner {
	position: relative;
	z-index: 0;
	display: inline-block;
}

.cpw-mm-fx-pill > a .cpw-mm-fx-inner::before,
.cpw-mmbar--fx-pill .cpw-mmbar-link::before {
	content: '';
	position: absolute;
	z-index: -1;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.82);
	border-radius: 999px;
	background: var(--ast-global-color-1, var(--wp--preset--color--secondary, #ff4b2b));
	opacity: 0;
	transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
	pointer-events: none;
}

/* Chip geometry: hugs the label on nav items, the link box on the bar. */
.cpw-mm-fx-pill > a .cpw-mm-fx-inner::before {
	width: calc(100% + 24px);
	height: 2.15em;
}

.cpw-mmbar--fx-pill .cpw-mmbar-link::before {
	width: calc(100% + 6px);
	height: 2.1em;
	max-height: 85%;
}

.cpw-mm-fx-underline > a,
.cpw-mmbar--fx-underline .cpw-mmbar-link { position: relative; }

.cpw-mm-fx-underline > a::after,
.cpw-mmbar--fx-underline .cpw-mmbar-link::after {
	content: '';
	position: absolute;
	left: 14%;
	right: 14%;
	bottom: 6px;
	height: 2.5px;
	border-radius: 3px;
	background: var(--ast-global-color-1, var(--wp--preset--color--secondary, #ff4b2b));
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
	/* Lift — pop up slightly */
	.cpw-mm-fx-lift:hover > a,
	.cpw-mmbar--fx-lift .cpw-mmbar-item:hover > .cpw-mmbar-link { transform: translateY(-2px); }

	/* Pill — accent chip pops in behind the label, text goes white */
	.cpw-mm-fx-pill:hover > a,
	.cpw-mmbar--fx-pill .cpw-mmbar-item:hover > .cpw-mmbar-link {
		color: #fff !important;
	}

	.cpw-mm-fx-pill:hover > a .cpw-mm-fx-inner::before,
	.cpw-mmbar--fx-pill .cpw-mmbar-item:hover > .cpw-mmbar-link::before {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1);
	}

	/* Bold — thickens without layout shift (shadow-bold trick) */
	.cpw-mm-fx-bold:hover > a,
	.cpw-mmbar--fx-bold .cpw-mmbar-item:hover > .cpw-mmbar-link {
		text-shadow: 0 0 0.65px currentColor, 0 0 0.65px currentColor;
	}

	/* Underline — accent line slides in */
	.cpw-mm-fx-underline:hover > a::after,
	.cpw-mmbar--fx-underline .cpw-mmbar-item:hover > .cpw-mmbar-link::after { transform: scaleX(1); }

	/* Glow — soft accent glow */
	.cpw-mm-fx-glow:hover > a,
	.cpw-mmbar--fx-glow .cpw-mmbar-item:hover > .cpw-mmbar-link {
		text-shadow: 0 0 14px color-mix(in srgb, var(--ast-global-color-1, #ff4b2b) 85%, transparent), 0 0 3px color-mix(in srgb, var(--ast-global-color-1, #ff4b2b) 45%, transparent);
	}
}

/* Touch polish: no gray tap-flash, no sticky highlight at the tapped
 * position when a new drawer level slides in under the finger. */
.cpw-mm-drawer-row,
.cpw-mm-drawer-back,
.cpw-mm-drawer-close,
.cpw-mm-brand,
.cpw-mmbar-link {
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

/* ==================================================================
 * GRADIENT ACCENTS — Design → Gradient accents.
 * --cpw-grad is emitted inline only while the mode is ON (theme or
 * custom), and the --grad classes only render then too, so none of
 * these rules can fire while the setting is Off.
 * ================================================================== */

.cpw-mm--grad .cpw-mm-brand:hover,
.cpw-mm--grad .cpw-mm-brand:focus,
.cpw-mm--grad .cpw-mm-brand.is-active {
	background: var(--cpw-grad);
	border-color: transparent;
	color: #fff;
}

.cpw-mm--grad .cpw-mm-badge { background: var(--cpw-grad); }

.cpw-mmbar--grad .cpw-mmbar-item:hover > .cpw-mmbar-link,
.cpw-mmbar--grad .cpw-mmbar-item:focus-within > .cpw-mmbar-link {
	background: var(--cpw-grad);
	color: #fff;
}

/* Top-level hover effects pick the gradient up too. */
.cpw-mm-grad.cpw-mm-fx-pill > a .cpw-mm-fx-inner::before,
.cpw-mmbar--grad.cpw-mmbar--fx-pill .cpw-mmbar-link::before { background: var(--cpw-grad); }

.cpw-mm-grad.cpw-mm-fx-underline > a::after,
.cpw-mmbar--grad.cpw-mmbar--fx-underline .cpw-mmbar-link::after { background: var(--cpw-grad); }

/* Mobile drawer: gradient header. */
.cpw-mm-drawer--grad .cpw-mm-drawer-head { background: var(--cpw-grad); }

/* ==================================================================
 * DEEP-LINK HOVER — Design → Hover effect → "Panel links on hover".
 * The 3rd/4th-level links inside the panel (.cpw-mm-links a). Flat
 * accent color by default; picks up the gradient when it is on.
 * Hover-only rules are scoped to hover-capable devices.
 * ================================================================== */

.cpw-mm--lfx-pill .cpw-mm-links a {
	padding: 2px 10px !important;
	margin: 0 -10px !important;
	border-radius: 999px;
	transition: background 0.15s ease, color 0.15s ease;
}

.cpw-mm--lfx-underline .cpw-mm-links a { position: relative; }

.cpw-mm--lfx-underline .cpw-mm-links a::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	border-radius: 2px;
	background: var(--cpw-brand-bg-hover);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cpw-mm--grad.cpw-mm--lfx-underline .cpw-mm-links a::after { background: var(--cpw-grad); }

.cpw-mm--lfx-slide .cpw-mm-links a {
	transition: transform 0.15s ease, color 0.12s ease;
	will-change: transform;
}

@media (hover: hover) {
	.cpw-mm--lfx-pill .cpw-mm-links a:hover {
		background: color-mix(in srgb, var(--cpw-brand-bg-hover) 14%, transparent);
		color: var(--cpw-brand-bg-hover);
	}

	.cpw-mm--grad.cpw-mm--lfx-pill .cpw-mm-links a:hover {
		background: var(--cpw-grad);
		color: #fff;
	}

	.cpw-mm--lfx-underline .cpw-mm-links a:hover::after { transform: scaleX(1); }

	.cpw-mm--lfx-slide .cpw-mm-links a:hover { transform: translateX(5px); }

	.cpw-mm--lfx-bold .cpw-mm-links a:hover {
		text-shadow: 0 0 0.65px currentColor, 0 0 0.65px currentColor;
	}
}

/* ==================================================================
 * SITE BACKGROUND LAYOUT — Design → Style preset → checkbox.
 * The panel wears the same soft diagonal weave as the site body:
 * theme-tinted bands (secondary + primary at 3%) over the panel base.
 * Pure CSS — background only, zero requests, zero repaints on scroll.
 * ================================================================== */

.cpw-mm--sitebg {
	background:
		repeating-linear-gradient(115deg,
			transparent 0 220px,
			color-mix(in srgb, var(--ast-global-color-1, #ff2400) 3%, transparent) 220px 360px,
			transparent 360px 500px,
			color-mix(in srgb, var(--ast-global-color-0, #241571) 3%, transparent) 500px 640px),
		var(--cpw-panel-bg);
}

.cpw-mm--sitebg.cpw-mm--p-light { --cpw-panel-bg: #fbfafd; }

/* ==================================================================
 * TOP-LEVEL ITEM ICONS — Design → Item mappings → Icon column.
 * Inline stroke SVG in front of the label; inherits the link color
 * (hover/active states included) so it recolors with every effect.
 * ================================================================== */

.cpw-mm-item-ico {
	width: 17px;
	height: 17px;
	display: inline-block;
	vertical-align: -3px;
	margin-right: 8px;
	flex: 0 0 auto;
	pointer-events: none;
}


/* ==================================================================
 * SCROLL GUARD - while armed (scroll seen, no deliberate pointer move
 * yet) nothing may open on hover. Menu opening itself is JS-gated now
 * (.cpw-mm-js-open), so this block is pure belt-and-braces: it also
 * neutralises any STALE cached critical CSS that still opens on
 * :hover, until those cached pages expire.
 * ================================================================== */

html.cpw-mm-scroll-guard .cpw-mm-nav-li:hover:not(.cpw-mm-js-open):not(:focus-within) > .cpw-mm-dropdown,
html.cpw-mm-scroll-guard .cpw-mmbar-item:hover:not(.cpw-mm-js-open):not(:focus-within) > .cpw-mm-dropdown {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}
