/* ==========================================================
   เมนูส่วนบน (desktop) + เมนูแถบด้านข้าง (มือถือ)
   ========================================================== */
body .x-menu .-menu-container {
	align-items: center;
}

.cx-nav {
	display: flex;
	align-items: center;
	height: 100%;
}

.cx-nav__list,
.cx-nav__list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cx-nav__list {
	display: flex;
	align-items: center;
	gap: .3rem;
	padding: .3rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .22);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.cx-nav__list > li {
	position: relative;
}

.cx-nav__list a,
.cx-nav__list a:hover {
	display: flex;
	align-items: center;
	gap: .35rem;
	margin: 0;
	text-decoration: none;
}

.cx-nav__list > li > a {
	padding: .45rem 1.1rem;
	border-radius: 999px;
	color: #472c59;
	font-size: .98rem;
	font-weight: 500;
	white-space: nowrap;
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.cx-nav__list > li > a:hover,
.cx-nav__list > li:focus-within > a {
	color: #472c59;
	background: rgba(255, 255, 255, .55);
}

.cx-nav__list > .current-menu-item > a,
.cx-nav__list > .current-menu-ancestor > a,
.cx-nav__list > .current_page_item > a,
.cx-nav__list > .current-menu-parent > a {
	color: #472c59;
	background: #fff;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(71, 44, 89, .18);
}

/* ไอคอนลูกศรของเมนูที่มีเมนูย่อย */
.cx-nav__list > .menu-item-has-children > a::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-left: .15rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform .2s ease;
}

.cx-nav__list > .menu-item-has-children:hover > a::after {
	transform: translateY(1px) rotate(-135deg);
}

/* เมนูย่อย */
.cx-nav__list .sub-menu {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	z-index: 20;
	display: block;
	min-width: 220px;
	padding: .5rem;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(71, 44, 89, .2);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.cx-nav__list .sub-menu::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 0;
	right: 0;
	height: 10px;
}

.cx-nav__list li:hover > .sub-menu,
.cx-nav__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.cx-nav__list .sub-menu a {
	padding: .6rem .9rem;
	border-radius: 10px;
	color: #472c59;
	font-size: .92rem;
	transition: background .2s ease, padding .2s ease;
}

.cx-nav__list .sub-menu a:hover,
.cx-nav__list .sub-menu .current-menu-item > a {
	color: #472c59;
	background: linear-gradient(90deg, rgba(255, 207, 61, .35), rgba(255, 181, 30, .15));
	padding-left: 1.15rem;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
	.cx-nav__list > li > a {
		padding: .4rem .8rem;
		font-size: .9rem;
	}
}

/* ---------- แถบเมนูมือถือ ---------- */
@media (max-width: 991.98px) {
	body .x-menu-list-sidebar {
		width: 280px;
		max-width: 82vw;
		text-align: left;
	}

	body .x-menu-list-sidebar .-inner-wrapper {
		background: linear-gradient(180deg, #ffffff 0%, #fff8e6 60%, #ffe7a8 100%);
		box-shadow: 8px 0 30px rgba(71, 44, 89, .18);
		border-radius: 0 28px 28px 0;
		padding: 1.25rem 1rem;
	}

	body .x-menu-list-sidebar .-brand-heading {
		justify-content: center;
		padding-bottom: 1rem;
		border-bottom: 1px dashed rgba(71, 44, 89, .15);
	}

	body .x-menu-list-sidebar .-brand-heading .-logo {
		width: 110px;
	}

	body .x-menu-list-sidebar .-overlay {
		background: rgba(31, 20, 48, .45);
		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);
	}
}

.cx-sidenav {
	margin-top: 1rem;
}

.cx-sidenav__list,
.cx-sidenav__list .sub-menu {
	display: block;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cx-sidenav__list > li + li {
	margin-top: .35rem;
}

.cx-sidenav__list a,
.cx-sidenav__list a:hover {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin: 0;
	text-decoration: none;
}

.cx-sidenav__list > li > a {
	position: relative;
	padding: .8rem 1rem .8rem 1.15rem;
	border-radius: 14px;
	color: #472c59;
	font-size: 1rem;
	font-weight: 500;
	transition: background .2s ease;
}

.cx-sidenav__list > li > a::before {
	content: "";
	width: 7px;
	height: 7px;
	flex: 0 0 7px;
	border-radius: 50%;
	background: #ffb51e;
	box-shadow: 0 0 0 3px rgba(255, 181, 30, .2);
}

.cx-sidenav__list > li > a:hover {
	color: #472c59;
	background: rgba(255, 255, 255, .8);
}

.cx-sidenav__list > .current-menu-item > a,
.cx-sidenav__list > .current-menu-ancestor > a,
.cx-sidenav__list > .current_page_item > a,
.cx-sidenav__list > .current-menu-parent > a {
	color: #472c59;
	font-weight: 600;
	background: linear-gradient(180deg, #ffcf3d, #ffb51e);
	box-shadow: 0 6px 16px rgba(255, 181, 30, .35);
}

.cx-sidenav__list > .current-menu-item > a::before,
.cx-sidenav__list > .current-menu-ancestor > a::before,
.cx-sidenav__list > .current_page_item > a::before,
.cx-sidenav__list > .current-menu-parent > a::before {
	background: #472c59;
	box-shadow: 0 0 0 3px rgba(71, 44, 89, .15);
}

.cx-sidenav__list .sub-menu {
	margin: .25rem 0 .25rem 1.6rem;
	padding-left: .75rem;
	border-left: 2px solid rgba(255, 181, 30, .5);
}

.cx-sidenav__list .sub-menu a {
	padding: .55rem .75rem;
	border-radius: 10px;
	color: #6b3f8a;
	font-size: .92rem;
}

.cx-sidenav__list .sub-menu a:hover,
.cx-sidenav__list .sub-menu .current-menu-item > a {
	color: #472c59;
	background: rgba(255, 255, 255, .8);
}
