/* WEB366 Header Menu — desktop + off-canvas */

.ahm {
	--ahm-accent: #c8102e;
	--ahm-text: #333333;
	--ahm-border: #eeeeee;
	position: relative;
	width: 100%;
}

.ahm-editor-notice {
	padding: 10px 14px;
	font-size: 13px;
	line-height: 1.4;
	color: #856404;
	background: #fff3cd;
	border-radius: 4px;
}

/* ── Desktop nav ─────────────────────────────────────────── */

.ahm-desktop {
	display: flex;
	align-items: center;
	width: 100%;
}

.ahm-desktop__list {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 28px;
}

.ahm-desktop__item {
	position: relative;
	list-style: none;
	margin: 0;
}

.ahm-desktop__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 12px 0;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
	color: #1a1a1a;
	transition: color 0.2s ease;
	white-space: nowrap;
}

.ahm-desktop__caret {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.ahm-desktop__item:hover>.ahm-desktop__link .ahm-desktop__caret,
.ahm-desktop__item:focus-within>.ahm-desktop__link .ahm-desktop__caret {
	transform: rotate(180deg);
}

.ahm-desktop__sub {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	min-width: 220px;
	max-height: 300px;
	overflow-y: auto;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: #fff;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.ahm-desktop__item:hover>.ahm-desktop__sub,
.ahm-desktop__item:focus-within>.ahm-desktop__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ahm-desktop__sub-item {
	position: relative;
	list-style: none;
	margin: 0;
}

.ahm-desktop__sub-link {
	display: block;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	color: #333;
	transition: color 0.15s ease, background 0.15s ease;
}

.ahm-desktop__sub-link:hover {
	color: var(--ahm-accent);
	background: #fafafa;
}

.ahm-desktop__sub--nested {
	top: 0;
	left: 100%;
	margin-left: 4px;
}

/* ── Toggle (hamburger) ──────────────────────────────────── */

.ahm-toggle-wrap {
	display: none;
	align-items: center;
	width: 100%;
}

.ahm-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	margin: 0;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	cursor: pointer;
	line-height: 1;
	appearance: none;
	-webkit-appearance: none;
}

.ahm-toggle:focus-visible {
	outline: 2px solid var(--ahm-accent);
	outline-offset: 2px;
}

.ahm-toggle i,
.ahm-toggle svg {
	display: block;
	pointer-events: none;
	width: 50%;
}

/* ── Off-canvas ──────────────────────────────────────────── */

.ahm-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 99999;
	pointer-events: none;
	visibility: hidden;
}

.ahm-offcanvas.is-open {
	pointer-events: auto;
	visibility: visible;
}

.ahm-offcanvas__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
	cursor: pointer;
}

.ahm-offcanvas.is-open .ahm-offcanvas__overlay {
	opacity: 1;
}

.ahm-offcanvas__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 88%;
	max-width: 420px;
	background: #fff;
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.ahm-offcanvas.is-open .ahm-offcanvas__panel {
	transform: translateX(0);
}

.ahm-offcanvas__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 24px;
}

.ahm-offcanvas__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	border-bottom: 1px solid #e8e8e8;
	flex-shrink: 0;
}

.ahm-offcanvas__logo {
	display: flex;
	align-items: center;
	min-width: 0;
}

.ahm-offcanvas__logo a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.ahm-offcanvas__logo img {
	display: block;
	width: 120px;
	height: auto;
	max-width: 100%;
}

.ahm-offcanvas__logo-text {
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #1a1a1a;
}

.ahm-offcanvas__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	cursor: pointer;
	line-height: 1;
	appearance: none;
	-webkit-appearance: none;
}

.ahm-offcanvas__close:focus-visible {
	outline: 2px solid var(--ahm-accent);
	outline-offset: 2px;
}

.ahm-offcanvas__nav {
	flex-shrink: 0;
}

.ahm-offcanvas__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ahm-offcanvas__item {
	list-style: none;
	margin: 0;
	border-bottom: 1px solid var(--ahm-border, #eee);
}

.ahm-offcanvas__row {
	display: flex;
	align-items: stretch;
	min-height: 52px;
}

.ahm-offcanvas__link {
	flex: 1;
	display: flex;
	align-items: center;
	padding: 16px 20px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none;
	color: #333;
	transition: color 0.15s ease;
}

.ahm-offcanvas__caret {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 48px;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: var(--ahm-accent, #c8102e);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: transform 0.25s ease;
}

.ahm-offcanvas__item.is-open>.ahm-offcanvas__row .ahm-offcanvas__caret {
	transform: rotate(180deg);
}

.ahm-offcanvas__sub {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0 0 8px;
	background: #fafafa;
}

.ahm-offcanvas__item.is-open>.ahm-offcanvas__sub {
	display: block;
}

.ahm-offcanvas__sub-item {
	list-style: none;
	margin: 0;
}

.ahm-offcanvas__sub-link {
	display: block;
	padding: 10px 20px 10px 28px;
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
	color: #555;
	transition: color 0.15s ease;
}

.ahm-offcanvas__sub-link:hover {
	color: var(--ahm-accent, #c8102e);
}

/* Nested Elementor drop zone under menu */
.ahm-offcanvas__footer {
	flex-shrink: 0;
	padding: 28px 20px 8px;
	margin-top: auto;
}

.ahm-offcanvas__footer .e-con,
.ahm-offcanvas__footer .elementor-element {
	width: 100%;
}

/* Body lock when open */
html.ahm-lock,
html.ahm-lock body {
	overflow: hidden;
}

/* ── Responsive via CSS custom property --ahm-bp ─────────── */
/* Default fallback: 1024px. Inline --ahm-bp from widget overrides. */

@media (max-width: 1024px) {
	.ahm:not([style*="--ahm-bp"]) .ahm-desktop {
		display: none;
	}

	.ahm:not([style*="--ahm-bp"]) .ahm-toggle-wrap {
		display: flex;
	}
}

/* Dynamic breakpoint: JS adds .ahm--mobile / .ahm--desktop
   as reliable fallback; CSS container also uses matchMedia via class. */

.ahm.ahm--mobile .ahm-desktop {
	display: none !important;
}

.ahm.ahm--mobile .ahm-toggle-wrap {
	display: flex !important;
}

.ahm.ahm--desktop .ahm-desktop {
	display: flex !important;
}

.ahm.ahm--desktop .ahm-toggle-wrap {
	display: none !important;
}

.ahm.ahm--desktop .ahm-offcanvas.is-open {
	/* Keep panel usable in editor if forced open; normally closed on desktop */
}

/* Keep the same drawer geometry in editor and frontend. */
.elementor-editor-active .ahm-offcanvas.is-editor-open .ahm-offcanvas__footer {
	min-height: 64px;
	outline: 1px dashed #c8102e;
	outline-offset: -1px;
}

/* Hòa Hảo responsive skin. Extra specificity keeps Elementor's legacy
   saved style defaults from overriding this selected preset. */
.ahm.web366-header-menu.web366-header-menu {
	--web366-navy: #0b2552;
	--web366-blue: #1f57a8;
	--web366-orange: #f47b20;
	--ahm-accent: var(--web366-orange);
	font-family: Roboto, system-ui, sans-serif;
}

.ahm.web366-header-menu.web366-header-menu .ahm-toggle-wrap {
	min-height: 68px;
	gap: 12px;
	justify-content: flex-start;
	background: #fff;
}

.ahm.web366-header-menu.web366-header-menu .ahm-toggle {
	flex: none;
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
	background: #f3f6fb;
	color: #0f1c33;
	font-size: 22px;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__overlay {
	background: rgba(8, 20, 45, .55);
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__panel {
	left: 0;
	right: auto;
	width: 78%;
	max-width: 360px;
	background: var(--web366-navy);
	color: #fff;
	transform: translateX(-100%);
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas.is-open .ahm-offcanvas__panel {
	transform: translateX(0);
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__inner {
	padding: 18px;
	box-sizing: border-box;
	overscroll-behavior: contain;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__header {
	padding: 0;
	margin-bottom: 14px;
	border: 0;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__logo-text {
	font-size: 18px;
	font-weight: 900;
	color: #fff;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__close {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__nav {
	flex: 1;
	margin-bottom: 18px;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__item {
	border-bottom-color: rgba(255, 255, 255, .1);
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__row {
	min-height: 50px;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__link {
	padding: 13px 4px;
	color: #fff;
	font-size: 16px;
	font-weight: 500;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__caret {
	width: 44px;
	color: #fff;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__sub {
	background: transparent;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__sub-link {
	padding: 9px 12px;
	color: #c9d6ee;
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__link:hover,
.ahm.web366-header-menu.web366-header-menu .current-menu-item>.ahm-offcanvas__row>.ahm-offcanvas__link,
.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__sub-link:hover {
	color: var(--web366-orange);
}

.ahm.web366-header-menu.web366-header-menu .ahm-offcanvas__footer {
	padding: 0;
}

.ahm.web366-header-menu.web366-header-menu :focus-visible {
	outline: 2px solid var(--web366-orange);
	outline-offset: 2px;
}

.elementor-editor-active .ahm.web366-header-menu.web366-header-menu .is-editor-open .ahm-offcanvas__panel {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {

	.ahm .ahm-offcanvas__panel,
	.ahm .ahm-offcanvas__overlay,
	.ahm .ahm-offcanvas__caret {
		transition: none;
	}
}

.ahm.web366-header-menu.web366-header-menu .web366-menu-call {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
	padding: 0 0 0 20px;
	min-height: 48px;
	background: var(--web366-orange);
	color: #fff;
	font-size: 14px;
	text-decoration: none;
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.ahm.web366-header-menu.web366-header-menu .web366-menu-call__arrow {
	display: grid;
	place-items: center;
	align-self: stretch;
	width: 46px;
	background: rgba(0, 0, 0, .15);
	font-size: 22px;
}