/* ==========================================================
 * Mobile Menu Widget for Elementor
 * ======================================================== */

.mmw {
	display: flex;
	align-items: center;
}

/* ---------- Nút mở ---------- */
.mmw-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	margin: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #1f2937;
	cursor: pointer;
	line-height: 1;
	transition: color .2s ease, background-color .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.mmw-toggle:hover,
.mmw-toggle:focus {
	background: transparent;
	color: #1f2937;
}
.mmw-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.mmw-toggle-icon {
	display: inline-flex;
	font-size: 24px;
}
.mmw-toggle-icon svg,
.mmw-close svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* ---------- Lớp phủ ---------- */
.mmw-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, .5);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;
}
.mmw.is-open .mmw-overlay {
	opacity: 1;
	visibility: visible;
}

/* ---------- Panel ---------- */
.mmw-panel {
	position: fixed;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #1f2937;
	overflow: hidden;
	visibility: hidden;
	transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s ease, visibility .35s;
	box-sizing: border-box;
}

.mmw-pos-left,
.mmw-pos-right {
	top: 0;
	bottom: 0;
	width: 300px;
	max-width: 90vw;
}
.mmw-pos-left  { left: 0;  transform: translateX(-100%); }
.mmw-pos-right { right: 0; transform: translateX(100%); }

.mmw-pos-top {
	top: 0;
	left: 0;
	right: 0;
	max-height: 100vh;
	transform: translateY(-100%);
}

.mmw-pos-full {
	inset: 0;
	opacity: 0;
	transform: scale(1.03);
}

.mmw.is-open .mmw-panel {
	visibility: visible;
	transform: none;
	opacity: 1;
}

/* Trong trình chỉnh sửa Elementor: tránh panel che editor khi chưa mở */
.elementor-editor-active .mmw:not(.is-open) .mmw-panel {
	pointer-events: none;
}

/* ---------- Header ---------- */
.mmw-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e7eb;
	flex-shrink: 0;
}
.mmw-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.mmw-logo img {
	display: block;
	max-width: 120px;
	height: auto;
}
.mmw-title {
	font-size: 18px;
	font-weight: 600;
}
.mmw-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	margin: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.mmw-close:hover,
.mmw-close:focus {
	background: transparent;
	color: inherit;
	opacity: .7;
}

/* ---------- Thân menu ---------- */
.mmw-body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.mmw-menu,
.mmw-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.mmw-menu li {
	position: relative;
	margin: 0;
	border-bottom: 1px solid #f0f0f0;
}
.mmw-menu .sub-menu li:last-child {
	border-bottom: 0;
}
.mmw-menu a {
	display: block;
	flex: 1;
	padding: 14px 20px;
	color: inherit;
	text-decoration: none;
	font-size: 16px;
	transition: color .2s ease, background-color .2s ease;
}
.mmw-menu a:hover {
	color: #2563eb;
}
.mmw-menu .current-menu-item > a,
.mmw-menu .current-menu-item > .mmw-item-row > a {
	color: #2563eb;
	font-weight: 600;
}

/* Hàng chứa link + nút mở submenu */
.mmw-item-row {
	display: flex;
	align-items: stretch;
}
.mmw-sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	padding: 0;
	margin: 0;
	border: 0;
	border-left: 1px solid #f0f0f0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	flex-shrink: 0;
}
.mmw-sub-toggle:hover,
.mmw-sub-toggle:focus {
	background: rgba(0, 0, 0, .03);
	color: inherit;
}
.mmw-sub-toggle::before {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform .25s ease;
}
.mmw-sub-open > .mmw-item-row > .mmw-sub-toggle::before {
	transform: rotate(-135deg) translate(-2px, -2px);
}

/* Submenu dạng accordion */
.mmw-menu .sub-menu {
	display: none;
	background: #f9fafb;
}
.mmw-menu .sub-menu a {
	padding-left: 32px;
	font-size: 15px;
}
.mmw-menu .sub-menu .sub-menu a {
	padding-left: 44px;
}

/* Khóa cuộn trang khi menu mở */
html.mmw-lock,
html.mmw-lock body {
	overflow: hidden;
}

/* Thông báo trong editor */
.mmw-notice {
	padding: 12px 16px;
	background: #fff8e5;
	border: 1px dashed #f0b849;
	font-size: 13px;
	color: #6b5200;
}

@media (prefers-reduced-motion: reduce) {
	.mmw-panel,
	.mmw-overlay,
	.mmw-sub-toggle::before {
		transition: none;
	}
}
