/* TT Mega Menu — theo Figma TABVIET / FULL MENU. Đơn vị rem = px / 19.2 (html 1vw @1920) */

/* chữ thường + chữ đậm chồng 1 ô: rê chuột đổi lớp, không đổi kích thước.
   Dùng opacity, KHÔNG dùng visibility: phần tử con "visibility: visible" vẫn bắt chuột khi khung cha đang ẩn → rê vào vùng trống cũng bật submenu */
.ttmm .ttmm-t {
	display: inline-grid;
}
.ttmm .ttmm-t > span {
	grid-area: 1 / 1;
}
.ttmm .ttmm-b {
	font-weight: 700;
	opacity: 0;
}
.ttmm .is-current > .ttmm-t > .ttmm-n,
.ttmm-li2.is-open > * > .ttmm-t > .ttmm-n,
.ttmm-item:hover > * > .ttmm-t > .ttmm-n,
.ttmm-item:focus-within > * > .ttmm-t > .ttmm-n,
.ttmm-pop a:hover > .ttmm-t > .ttmm-n,
.ttmm-gtitle .ttmm-n {
	opacity: 0;
}
.ttmm .is-current > .ttmm-t > .ttmm-b,
.ttmm-li2.is-open > * > .ttmm-t > .ttmm-b,
.ttmm-item:hover > * > .ttmm-t > .ttmm-b,
.ttmm-item:focus-within > * > .ttmm-t > .ttmm-b,
.ttmm-pop a:hover > .ttmm-t > .ttmm-b,
.ttmm-gtitle .ttmm-b {
	opacity: 1;
}

.ttmm ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ttmm li {
	margin: 0;
}
.ttmm a,
.ttmm span {
	color: #fff;
}

/* ---------- Cấp 1: thanh menu ---------- */
.ttmm-l1 {
	display: flex;
	align-items: center;
}
.ttmm-li1 {
	position: relative;
}
.ttmm-li1 > a,
.ttmm-li1 > span {
	display: block;
	font-size: 0.73rem;
	line-height: 1.5;
	font-weight: 300;
	padding: 0 1.56rem;
	cursor: pointer;
	transition: padding 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.ttmm-li1:hover > a .ttmm-n,
.ttmm-li1:hover > span .ttmm-n,
.ttmm-li1:focus-within > a .ttmm-n {
	opacity: 0;
}
.ttmm-li1:hover > a .ttmm-b,
.ttmm-li1:hover > span .ttmm-b,
.ttmm-li1:focus-within > a .ttmm-b {
	opacity: 1;
}
/* mở ô tìm kiếm trên thanh (theme navSearchFunction) → các mục dồn lại */
.nav.is-search .ttmm-li1 > a,
.nav.is-search .ttmm-li1 > span {
	padding: 0 1rem;
}

/* ---------- Cấp 2: danh sách thả xuống (glass menu) ---------- */
.ttmm-drop {
	position: absolute;
	top: calc(100% + 0.96rem);
	left: 50%;
	z-index: 2;
	width: 9.89rem;
	padding: 0.31rem 0.41rem;
	border-radius: 10px;
	background: linear-gradient(179.28deg, rgba(19, 0, 161, 0.3) 0.61%, rgba(25, 90, 255, 0.3) 99.38%);
	box-shadow: 0 4px 10px rgba(0, 25, 136, 0.25);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 0.5rem);
	transition: opacity 0.4s, transform 0.4s, visibility 0s linear 0.4s;
}
.ttmm-drop.is-wide {
	width: 11.12rem;
}
/* cầu nối vô hình từ chữ cấp 1 xuống khung */
.ttmm-drop::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 100%;
	height: 1.1rem;
}
.ttmm-li1:hover > .ttmm-drop,
.ttmm-li1:focus-within > .ttmm-drop {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition: opacity 0.4s, transform 0.4s, visibility 0s;
}
.ttmm-l2 {
	display: flex;
	flex-direction: column;
	gap: 0.26rem;
}
.ttmm-li2 {
	position: relative;
}
.ttmm-li2 > a,
.ttmm-li2 > span {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.47rem 0.89rem;
	font-size: 0.73rem;
	line-height: 0.94rem;
	letter-spacing: -0.25px;
	font-weight: 300;
	text-align: center;
	cursor: pointer;
}
/* chữ cấp 2 chỉ xuống dòng ở <br> đặt sẵn: bản đậm rộng hơn (vd "Tư vấn quản trị CNTT") tự gãy thêm 1 dòng
   khác bản thường → rê chuột chữ nhảy dòng. Đã đo: mọi mục vẫn vừa khung (cách mép ≥ 9px) */
.ttmm-li2 > a .ttmm-t > span,
.ttmm-li2 > span .ttmm-t > span {
	white-space: nowrap;
}
/* nền nút khi rê chuột */
.ttmm-li2 > a::before,
.ttmm-li2 > span::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 10px;
	background: linear-gradient(90deg, rgba(0, 157, 255, 0.5) 0%, rgba(27, 88, 244, 0.5) 100%);
	box-shadow: 0 0 10px rgba(0, 25, 136, 0.19);
	opacity: 0;
	transition: opacity 0.4s;
}
.ttmm-li2.is-open > a::before,
.ttmm-li2.is-open > span::before {
	opacity: 1;
}
.ttmm-li2.has-panel > a::before,
.ttmm-li2.has-panel > span::before {
	border-radius: 10px 0 0 10px;
}
/* mục có khung con: chừa chỗ mũi tên 2 bên cố định (cả lúc thường lẫn lúc mở) và giữ căn giữa
   → rê chuột chỉ đổi chữ thường ↔ đậm, chữ không nhảy sang trái (trước: lúc mở đổi sang căn trái + đệm phải) */
.ttmm-li2.has-panel > a,
.ttmm-li2.has-panel > span {
	padding-right: 1.6rem;
}
.ttmm-arrow {
	position: absolute;
	top: 50%;
	right: 0.44rem;
	width: 0.55rem;
	height: auto;
	color: #fff;
	opacity: 0;
	transform: translate(-0.3rem, -50%);
	transition: opacity 0.4s, transform 0.4s;
}
.ttmm-li2.is-open .ttmm-arrow {
	opacity: 1;
	transform: translate(0, -50%);
}

/* ---------- Cấp 3: khung xanh bên phải ---------- */
.ttmm-panel {
	position: absolute;
	top: 0;
	left: calc(100% - 0.27rem);
	z-index: 1;
	width: max-content;
	padding: 0.45rem 0.89rem 0.6rem;
	border-radius: 0 10px 10px 10px;
	background: linear-gradient(109.2deg, #1b58f4 -1.74%, #609fff 98.8%);
	box-shadow: 0 0 10px rgba(0, 25, 136, 0.19);
	opacity: 0;
	visibility: hidden;
	transform: translateX(0.5rem);
	transition: opacity 0.35s, transform 0.35s, visibility 0s linear 0.35s;
}
/* chỉ hiện khi dropdown cấp 1 đang mở → khung không bao giờ "vô hình mà bắt chuột" */
.ttmm-li1:hover .ttmm-li2.is-open > .ttmm-panel,
.ttmm-li1:focus-within .ttmm-li2.is-open > .ttmm-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.35s, transform 0.35s, visibility 0s;
}
/* khung tràn mép phải màn hình → mở sang trái */
.ttmm-li2.is-flip > .ttmm-panel {
	left: auto;
	right: calc(100% - 0.27rem);
	border-radius: 10px 0 10px 10px;
	transform: translateX(-0.5rem);
}
.ttmm-li2.is-flip.is-open > .ttmm-panel {
	transform: none;
}
.ttmm-li2.is-flip.has-panel > a::before,
.ttmm-li2.is-flip.has-panel > span::before {
	border-radius: 0 10px 10px 0;
}

.ttmm-grid {
	display: grid;
	grid-template-columns: repeat(var(--ttmm-cols, 2), auto);
	align-items: start;
	gap: 0.85rem 1.2rem;
}
.ttmm-item {
	position: relative;
}
.ttmm-panel a,
.ttmm-panel span {
	display: block;
	font-size: 0.73rem;
	line-height: 0.94rem;
	letter-spacing: -0.25px;
	font-weight: 300;
	white-space: nowrap;
}
.ttmm-panel .ttmm-t {
	display: inline-grid;
}
.ttmm-panel .ttmm-t > span {
	display: block;
}

/* chia nhóm: cột tiêu đề nhóm + lưới link, kẻ ngang giữa các nhóm */
.ttmm-panel.is-group {
	display: grid;
	grid-template-columns: max-content auto;
	align-items: start;
	column-gap: 1.6rem;
}
.ttmm-sep {
	grid-column: 1 / -1;
	height: 0;
	margin: 1.05rem 0;
	border-top: 0.5px solid rgba(255, 255, 255, 0.5);
}

/* link có cấp con → ô trắng thả dưới chữ */
.ttmm ul.ttmm-pop {
	position: absolute;
	top: calc(100% + 3px);
	left: 0;
	z-index: 3;
	width: 6.79rem;
	padding: 0.47rem 0.18rem 0.47rem 0.52rem;
	display: flex;
	flex-direction: column;
	gap: 0.63rem;
	background: #fff;
	border-radius: 0 0 10px 10px;
	box-shadow: 0 4px 5px rgba(0, 25, 136, 0.5);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-0.3rem);
	transition: opacity 0.3s, transform 0.3s, visibility 0s linear 0.3s;
}
.ttmm-item.has-pop:hover > .ttmm-pop,
.ttmm-item.has-pop:focus-within > .ttmm-pop {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity 0.3s, transform 0.3s, visibility 0s;
}
.ttmm .ttmm-pop a,
.ttmm .ttmm-pop span {
	color: #1b58f4;
	white-space: normal;
}

/* ---------- Menu di động (trong .nav-mobile-menu của theme) ---------- */
.ttmm-m-sub {
	display: none;
}
.ttmm-m li.open > .ttmm-m-sub {
	display: block;
	animation: ttmmFade 0.4s ease-in-out;
}
.ttmm-m-row {
	display: flex;
	align-items: center;
}
.nav-mobile-menu .ttmm-m-row > a,
.ttmm-m-row > span {
	display: block;
	flex: 1;
	min-width: 0;
	color: #fff;
	font-size: 1rem;
	padding: 0.725rem 0 0.625rem;
}
.ttmm-m-row > span {
	cursor: pointer;
}
.ttmm-m-toggle {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	box-shadow: none;
}
.ttmm-m-toggle svg {
	width: 0.7rem;
	transition: transform 0.3s;
}
.ttmm-m li.open > .ttmm-m-row .ttmm-m-toggle svg {
	transform: rotate(180deg);
}
.nav-mobile-menu .ttmm-m .is-current {
	font-weight: 700;
}
@keyframes ttmmFade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
