/* -----------------------------------------
   Mega Menu Module Styles (VIA Custom)
----------------------------------------- */
.via-mega-menu-wrapper {
	position: relative;
	display: inline-block;
	font-family: inherit;
	z-index: 9999999;
	width: 100%;
	min-width: 100px;
	height: 100%;
}

/* Header Toggle */
.via-mm-toggle-header {
	background-color: var(--wd-primary-color, #83b735);
	color: #fff;
	padding: 12px 20px;
	cursor: pointer;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
	border-radius: 4px;
	border: 1px solid var(--wd-primary-color, #83b735);
	transition: background 0.3s ease;
}

.via-mm-toggle-header:hover {
	background-color: var(--wd-primary-color, #6c992a);
}

/* Main Parent List */
.via-mm-list {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100%;
	background: #fff;
	list-style: none;
	margin: 0;
	padding: 12px;
	border: 1px solid var(--wd-primary-color, #83b735);
	border-top: 2px solid var(--wd-primary-color, #83b735);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.3s ease;
}

/* Mở list phụ thuộc vào hover header (nếu cho phép) hoặc click bằng JS */
.via-mega-menu-wrapper.is-open .via-mm-list {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Luôn mở ở trang chủ (Nếu option = yes) */
.via-mega-menu-wrapper.via-mm-always-open.is-home .via-mm-list {
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	border-top: none;
	border-radius: 0 0 4px 4px;
}

.via-mega-menu-wrapper.via-mm-always-open.is-home .via-mm-toggle-header {
	border-radius: 4px 4px 0 0;
	pointer-events: none;
	/* Không cho click đóng lại ở trang chủ */
}

/* Items */
.via-mm-item {
	position: relative;
	border: 1px solid #f1f1f1;
	border-bottom: none;
	margin: 0;
}

.via-mm-item:last-child {
	border-bottom: 1px solid #f1f1f1;
}

.via-mm-item.is-hidden-cat {
	display: none;
}

.via-mm-item.is-hidden-cat.show {
	display: block;
	animation: viaMmSlideDown 0.3s ease;
}

@keyframes viaMmSlideDown {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.via-mm-link {
	display: flex;
	align-items: center;
	padding: 12px 20px;
	color: #333;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.via-mm-see-more {
	background-color: rgb(247, 247, 247);
}

.via-mm-icon {
	object-fit: contain;
	margin-right: 6px;
}

.via-mm-text {
	flex-grow: 1;
	font-size: 14px;
	font-weight: 500;
}

/* Dropdown Sub-menu */
.via-mm-dropdown {
	position: absolute;
	top: 0;
	left: 100%;
	width: 650px;
	background-color: #fff;
	box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.08);
	opacity: 0;
	visibility: hidden;
	transform: translateX(10px);
	transition: all 0.3s ease;
	z-index: 1000;
	border: 1px solid #eaeaea;
	display: flex;
	flex-direction: column;
	background: url("../img/megamenu-bg-2.webp") no-repeat center center / 100% 100%;

}

.via-mm-dropdown-header {
	padding: 15px 20px;
}

.via-mm-dropdown-header a {
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	text-transform: uppercase;
}


.via-mm-dropdown-content {
	display: flex;
	min-height: 250px;
	flex: 1;
	border-top: 1px solid var(--via-primary-color);
}

.via-mm-dropdown-left {
	flex: 1;
	padding: 20px;
	padding-left: 40px;
}

.via-mm-dropdown-right {
	width: 250px;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
}

/* Danh sách con */
.via-mm-sublist {
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 15px;
}

.via-mm-subitem a {
	color: #444;
	text-decoration: none;
	font-size: 14px;
	transition: color 0.3s ease;
	display: inline-block;
	padding: 5px 0;
	position: relative;
}

.via-mm-subitem a::after {
	content: '';
	position: absolute;
	bottom: 2px;
	left: 0;
	width: 0;
	height: 1px;
	background-color: var(--wd-primary-color, #83b735);
	transition: width 0.3s ease;
}

.via-mm-subitem a:hover {
	color: var(--wd-primary-color, #333);
}

.via-mm-subitem a:hover::after {
	width: 100%;
}

.via-mm-count {
	color: #999;
	font-size: 0.9em;
	margin-left: 4px;
	font-weight: normal;
}

/* -----------------------------------------
   Triggers
----------------------------------------- */
/* HOVER TRIGGER */
@media (min-width: 1025px) {
	.via-mega-menu-wrapper.trigger-hover:hover .via-mm-list {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.via-mega-menu-wrapper.trigger-hover .via-mm-item:hover .via-mm-dropdown {
		opacity: 1;
		visibility: visible;
		transform: translateX(0);
	}

	.via-mega-menu-wrapper.trigger-hover .via-mm-item:hover .via-mm-link {
		background-color: #fcfcfc;
		color: var(--wd-primary-color, #83b735);
	}
}

/* CLICK TRIGGER & ACTIVE CLASSES (Managed by JS) */
.via-mm-item.is-active .via-mm-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

.via-mm-item.is-active>.via-mm-link {
	background-color: #fcfcfc;
	color: var(--wd-primary-color, #83b735);
}

/* -----------------------------------------
   Responsive / Mobile
----------------------------------------- */
@media (max-width: 1024px) {
	.via-mm-dropdown {
		position: static;
		width: 100%;
		transform: none;
		box-shadow: none;
		display: none;
		border: none;
		border-top: 1px solid #eaeaea;
	}

	.via-mm-item.is-active .via-mm-dropdown,
	.via-mega-menu-wrapper.trigger-hover .via-mm-item:hover .via-mm-dropdown {
		display: block;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.via-mm-sublist {
		grid-template-columns: 1fr;
	}

	.via-mm-dropdown-content {
		flex-direction: column;
	}

	.via-mm-dropdown-right {
		width: 100%;
		height: 150px;
		border-left: none;
		border-top: 1px solid #eaeaea;
	}

	.via-mm-list {
		width: 100%;
	}
}