/**
 * HAI Mobile Menu: drill-down off-canvas navigation.
 * All theming flows through CSS custom properties on .hai-mm so each site
 * only overrides a handful of variables (set via the Elementor Style tab).
 */

.hai-mm {
	--hai-mm-bg: #ffffff;
	--hai-mm-text: #1a1a1a;
	--hai-mm-accent: #1f1f1f;
	--hai-mm-muted: rgba(0, 0, 0, 0.55);
	--hai-mm-divider: rgba(0, 0, 0, 0.08);
	--hai-mm-header-bg: transparent;
	--hai-mm-overlay: rgba(0, 0, 0, 0.5);
	--hai-mm-width: 360px;
	--hai-mm-toggle-color: #1a1a1a;
	--hai-mm-toggle-size: 26px;
	--hai-mm-toggle-bar-h: 2px;
	--hai-mm-z: 99990;

	display: inline-flex;
	line-height: 1;
}

/* Hamburger toggle */
.hai-mm-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: calc(var(--hai-mm-toggle-size) + 12px);
	height: calc(var(--hai-mm-toggle-size) + 12px);
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.hai-mm-toggle span {
	display: block;
	flex: 0 0 auto;
	width: var(--hai-mm-toggle-size);
	height: var(--hai-mm-toggle-bar-h);
	background: var(--hai-mm-toggle-color);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
}
/* 3-bar open animation (gap is 5px) */
.hai-mm-bars-3.is-open .hai-mm-toggle span:nth-child(1) { transform: translateY(calc(var(--hai-mm-toggle-bar-h) + 5px)) rotate(45deg); }
.hai-mm-bars-3.is-open .hai-mm-toggle span:nth-child(2) { opacity: 0; }
.hai-mm-bars-3.is-open .hai-mm-toggle span:nth-child(3) { transform: translateY(calc((var(--hai-mm-toggle-bar-h) + 5px) * -1)) rotate(-45deg); }
/* 2-bar open animation */
.hai-mm-bars-2.is-open .hai-mm-toggle span:nth-child(1) { transform: translateY(calc((var(--hai-mm-toggle-bar-h) + 5px) * 0.5)) rotate(45deg); }
.hai-mm-bars-2.is-open .hai-mm-toggle span:nth-child(2) { transform: translateY(calc((var(--hai-mm-toggle-bar-h) + 5px) * -0.5)) rotate(-45deg); }

/* Overlay backdrop */
.hai-mm-overlay {
	position: fixed;
	inset: 0;
	background: var(--hai-mm-overlay);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	z-index: calc(var(--hai-mm-z) - 1);
}
.hai-mm.is-open .hai-mm-overlay { opacity: 1; visibility: visible; }

/* Off-canvas panel */
.hai-mm-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: min(var(--hai-mm-width), 100vw);
	background: var(--hai-mm-bg);
	color: var(--hai-mm-text);
	display: flex;
	flex-direction: column;
	z-index: var(--hai-mm-z);
	transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
}
.hai-mm--right .hai-mm-panel { right: 0; transform: translateX(100%); }
.hai-mm--left  .hai-mm-panel { left: 0;  transform: translateX(-100%); }
.hai-mm.is-open .hai-mm-panel { transform: translateX(0); }

/* Panel header */
.hai-mm-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	background: var(--hai-mm-header-bg);
	border-bottom: 1px solid var(--hai-mm-divider);
	flex: 0 0 auto;
}
.hai-mm-head-title { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.hai-mm-head-logo {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	min-width: 0;
	line-height: 0;
}
/* width + max-height box the logo; contain keeps it from ever distorting */
.hai-mm-head-logo img {
	display: block;
	width: var(--hai-mm-logo-w, 120px);
	max-width: 100%;
	height: auto;
	max-height: var(--hai-mm-logo-maxh, 40px);
	object-fit: contain;
	object-position: left center;
}
.hai-mm-close {
	background: none;
	border: 0;
	cursor: pointer;
	width: 34px;
	height: 34px;
	color: var(--hai-mm-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	-webkit-appearance: none;
	appearance: none;
}
.hai-mm-close::before { content: "\00d7"; font-size: 30px; line-height: 1; }

/* Levels viewport */
.hai-mm-levels { position: relative; flex: 1 1 auto; overflow: hidden; }
.hai-mm-level {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--hai-mm-bg);
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hai-mm-level--root { transform: translateX(0); }
.hai-mm-level.is-open { transform: translateX(0); }

/* Back bar (sublevels) */
.hai-mm-back {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 14px 20px;
	background: none;
	border: 0;
	border-bottom: 1px solid var(--hai-mm-divider);
	color: var(--hai-mm-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	flex: 0 0 auto;
}
.hai-mm-back svg { width: 14px; height: 14px; flex: 0 0 auto; }

/* Item list */
.hai-mm-list { list-style: none; margin: 0; padding: 4px 0; }
.hai-mm-item { display: flex; align-items: stretch; border-bottom: 1px solid var(--hai-mm-divider); }
.hai-mm-link {
	flex: 1 1 auto;
	padding: 15px 20px;
	color: var(--hai-mm-text);
	text-decoration: none;
	font-size: 16px;
	display: flex;
	align-items: center;
}
.hai-mm-link--all { color: var(--hai-mm-accent); font-weight: 600; }
.hai-mm-drill {
	flex: 0 0 auto;
	width: 56px;
	background: none;
	border: 0;
	border-left: 1px solid var(--hai-mm-divider);
	cursor: pointer;
	color: var(--hai-mm-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	-webkit-appearance: none;
	appearance: none;
}
.hai-mm-drill svg { width: 16px; height: 16px; }

/* CTA footer */
.hai-mm-cta-wrap { flex: 0 0 auto; padding: 18px 20px; border-top: 1px solid var(--hai-mm-divider); }
.hai-mm-cta {
	display: block;
	text-align: center;
	padding: 14px 20px;
	background: var(--hai-mm-accent);
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	transition: background-color 0.25s ease, background-image 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Harden against theme/kit global button styles leaking in */
.hai-mm-toggle,
.hai-mm-close,
.hai-mm-drill,
.hai-mm-back {
	background: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
}
.hai-mm-toggle,
.hai-mm-close,
.hai-mm-back { border: 0 !important; }
.hai-mm-drill { border: 0 !important; border-left: 1px solid var(--hai-mm-divider) !important; }
/* Force icon/text colors (header themes often paint buttons a single color) */
.hai-mm-close { color: var(--hai-mm-text) !important; }
.hai-mm-back,
.hai-mm-drill { color: var(--hai-mm-muted) !important; }

/* Body scroll lock */
body.hai-mm-lock { overflow: hidden; }

/* Editor convenience: keep the panel reachable while editing */
.elementor-editor-active .hai-mm-panel,
.elementor-editor-active .hai-mm-overlay { transition: none; }
