.xd-menu-nav {
	width: 100%;
}

.xd-menu {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
}

.xd-menu-item {
	position: relative;
}

.xd-menu-item > a {
	display: flex;
	align-items: center;
	text-decoration: none;
	white-space: nowrap;
	transition: color .2s ease;
}

.xd-menu-item > a i.xd-icon-angle {
	font-size: 11px;
	margin-left: 6px;
	transition: transform .2s ease;
}

/* ===== Normal Dropdown Submenu (Desktop) ===== */
.xd-sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	margin: 0;
	padding: 8px 0;
	z-index: 999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
	border-radius: 4px;
}

.xd-sub-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.xd-sub-menu .xd-menu-item {
	width: 100%;
	position: relative;
}

.xd-sub-menu .xd-menu-item > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 18px;
	color: #333333;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.xd-sub-menu .xd-menu-item > a:hover {
	background-color: #f4f6f8;
	color: #3b82f6;
}

/* Sub-submenus flyout (Desktop) */
.xd-sub-menu .xd-sub-menu {
	top: 0;
	left: 100%;
}

.xd-menu-item.xd-menu-has-children:hover > .xd-sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ===== Mega menu / dropdown =====
   Dùng position: fixed + JS tính top/left, để tránh bị overflow:hidden
   của các container/section cha (Elementor) cắt mất nội dung.
   Ẩn bằng visibility+opacity (không dùng display:none) để JS có thể đọc
   được width trước khi hiện ra — tránh nhấp nháy sai vị trí lúc load. */
.xd-menu-mega {
	position: fixed;
	top: -9999px;
	left: -9999px;
	width: max-content;
	max-width: 100vw;
	z-index: 999;
	visibility: hidden;
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
	display: block;
	background-color: #ffffff;
}

.xd-menu-mega-full {
	left: 0 !important;
	right: 20px;
	width: auto;
}

.xd-menu-item.xd-menu-has-mega:hover > .xd-menu-mega,
.xd-menu-item.xd-menu-open > .xd-menu-mega {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
}

/* ===== Mobile panel header ===== */
.xd-mobile-panel-header {
	display: none;
}

.xd-mobile-back-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: transparent;
	border: none;
	padding: 16px 20px;
	font-size: 16px;
	font-weight: 600;
	color: #222222;
	cursor: pointer;
	border-bottom: 1px solid #eeeeee;
}

.xd-mega-content-inner {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
}

/* ===== Mobile trigger + overlay =====
   Hiển thị/ẩn và vị trí drawer được sinh động theo breakpoint của từng
   widget (xem class-xd-menu-widget.php), CSS dưới đây chỉ là phần dùng chung. */
.xd-menu-trigger {
	display: none;
	width: 100%;
}

.xd-menu-trigger-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	cursor: pointer;
	line-height: 1;
}

.xd-trigger-icon-open,
.xd-trigger-icon-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.xd-menu-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99998;
}

body.xd-mobile-menu-open {
	overflow: hidden;
}

/* ===== Grid card xe (shortcode xd_xe_grid) ===== */
.xd-mm-grid {
	display: grid;
	gap: 20px;
}

.xd-mm-card {
	display: block;
	text-decoration: none;
	color: #222;
	text-align: center;
}

.xd-mm-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

.xd-mm-name {
	margin-top: 8px;
	font-weight: 600;
	font-size: 14px;
	color: #1e3a8a;
}

.xd-mm-price {
	margin-top: 4px;
	font-size: 13px;
	font-weight: 700;
	color: #dc2626;
}

.xd-mm-empty {
	text-align: center;
	color: #888;
	grid-column: 1 / -1;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
	.xd-mm-grid {
		grid-template-columns: repeat(4, 1fr) !important;
	}
}

@media (max-width: 768px) {
	.xd-mm-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}
