/* ==========================================================
 * Header (.tnh) + Footer (.tnf) — tracnghiem
 * Nạp sau custom.css / mobile-header.css nên dùng "html body" để
 * thắng các rule cũ có !important. Breakpoint menu = 1200px (khớp main.js).
 * ========================================================== */
:root {
	--tnc-green: #22a838;
	--tnc-green-600: #1a8a2e;
	--tnc-green-50: #eaf7ed;
	--tnc-ink: #14211a;
	--tnc-text: #3d4a42;
	--tnc-muted: #6b7770;
	--tnc-line: #e3e9e5;
	--tnc-bar-h: 68px;
	--tnc-max: 1200px;
}

/* Ẩn phần header cũ nếu còn sót */
html body .site-banner { display: none !important; }

/* ---------------- Header bar ---------------- */
html body .tnh { position: relative; z-index: 1030; overflow: visible !important; }
html body .tnh-bar {
	position: -webkit-sticky; position: sticky; top: 0; z-index: 1030;
	/* Không dùng backdrop-filter/transform ở đây: sẽ làm panel menu mobile (position: fixed) bị kẹt trong thanh */
	background: #fff;
	border-bottom: 1px solid var(--tnc-line);
	transition: box-shadow .2s ease;
}
html body .tnh-bar.is-scrolled { box-shadow: 0 6px 20px rgba(16, 40, 24, .08); }
html body .tnh-inner {
	max-width: var(--tnc-max); margin: 0 auto; padding: 0 16px;
	height: var(--tnc-bar-h); display: flex; align-items: center; gap: 20px;
}
html body .tnh-logo { flex: none; display: flex; align-items: center; }
html body .tnh-logo img { display: block; height: 44px; width: auto; max-width: 200px; object-fit: contain; }

html body .tnh-nav { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
html body .tnh-actions { flex: none; display: flex; align-items: center; gap: 8px; }

/* Buttons */
html body .tnh-btn {
	display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
	border-radius: 999px; font-size: 14.5px; font-weight: 600; line-height: 1; white-space: nowrap;
	text-decoration: none !important; border: 1.5px solid transparent; transition: background-color .15s, color .15s, border-color .15s;
}
html body .tnh-btn--text { color: var(--tnc-ink) !important; }
html body .tnh-btn--text:hover { background: #f1f4f2; }
html body .tnh-btn--primary { background: var(--tnc-green); color: #fff !important; box-shadow: 0 4px 12px rgba(34, 168, 56, .25); }
html body .tnh-btn--primary:hover { background: var(--tnc-green-600); }
html body .tnh a:focus-visible, html body .tnh button:focus-visible, html body .tnf a:focus-visible {
	outline: 3px solid rgba(34, 168, 56, .45); outline-offset: 2px;
}

/* ---------------- Main menu (block global.bootstrap) ---------------- */
html body .tnh .tn-global-menu {
	position: static !important; display: flex !important; align-items: center;
	width: auto !important; margin: 0 !important; padding: 0 !important;
	background: transparent !important; border: 0 !important; box-shadow: none !important; min-height: 0 !important;
}
html body .tnh .tn-global-menu .header-nav-item { position: relative !important; width: auto !important; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; }
html body .tnh .tn-global-menu .nav-item-cta {
	display: flex !important; align-items: center; gap: 2px; height: auto !important;
	padding: 0 !important; margin: 0 !important; background: transparent !important; border: 0 !important; border-radius: 10px !important;
}
html body .tnh .tn-global-menu .nav-item-cta > a {
	display: block !important; padding: 10px 6px 10px 12px !important; margin: 0 !important;
	color: var(--tnc-ink) !important; font-size: 15px !important; font-weight: 600 !important; line-height: 1.2 !important;
	text-transform: none !important; letter-spacing: 0 !important; background: none !important; border: 0 !important; white-space: nowrap;
}
html body .tnh .tn-global-menu .header-nav-item:not(.has-children) .nav-item-cta > a { padding-right: 12px !important; }
html body .tnh .tn-global-menu .tn-nav-caret-wrap {
	display: inline-flex !important; align-items: center; justify-content: center; width: 22px; height: 30px;
	margin: 0 6px 0 0 !important; padding: 0 !important; cursor: pointer; color: #8a968f !important; background: none !important; border: 0 !important;
}
html body .tnh .tn-global-menu .tn-nav-caret-svg { display: none !important; }
html body .tnh .tn-global-menu .tn-nav-caret-icon { display: inline-block !important; font-size: 13px !important; transition: transform .18s ease; color: inherit !important; }
html body .tnh .tn-global-menu .header-nav-item:hover > .nav-item-cta,
html body .tnh .tn-global-menu .header-nav-item:focus-within > .nav-item-cta,
html body .tnh .tn-global-menu .header-nav-item.active > .nav-item-cta { background: var(--tnc-green-50) !important; }
html body .tnh .tn-global-menu .header-nav-item:hover > .nav-item-cta > a,
html body .tnh .tn-global-menu .header-nav-item.active > .nav-item-cta > a,
html body .tnh .tn-global-menu .header-nav-item:hover .tn-nav-caret-wrap { color: var(--tnc-green-600) !important; }

/* Dropdown panel */
html body .tnh .tn-global-menu .dropdown--inner {
	background: #fff !important; border: 1px solid var(--tnc-line) !important; border-radius: 14px !important;
	box-shadow: 0 18px 40px rgba(16, 40, 24, .14) !important; padding: 8px !important; margin: 0 !important;
}
html body .tnh .tn-global-menu .dropdown-content { display: block !important; padding: 0 !important; margin: 0 !important; background: none !important; }
html body .tnh .tn-global-menu .dropdown-menu-item { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
html body .tnh .tn-global-menu .dropdown-link {
	display: flex !important; align-items: center; justify-content: space-between; gap: 10px;
	padding: 9px 12px !important; margin: 0 !important; border-radius: 9px !important; border: 0 !important;
	color: var(--tnc-text) !important; font-size: 14.5px !important; font-weight: 500 !important; line-height: 1.35 !important;
	background: transparent !important; white-space: normal !important; text-transform: none !important;
}
html body .tnh .tn-global-menu .dropdown-link:hover,
html body .tnh .tn-global-menu .dropdown-link:focus,
html body .tnh .tn-global-menu .dropdown-link.active { background: var(--tnc-green-50) !important; color: var(--tnc-green-600) !important; }
html body .tnh .tn-global-menu .dropdown-link::before,
html body .tnh .tn-global-menu .dropdown-link::after { display: none !important; }
html body .tnh .tn-global-menu .dropdown-children { padding-left: 10px !important; border-left: 2px solid var(--tnc-line); margin: 2px 0 4px 14px !important; }

/* Desktop (>= 1200px): menu ngang, dropdown hover */
@media (min-width: 1200px) {
	html body .tnh .tn-global-menu .tn-menu-header { display: none !important; }
	html body .tnh .tn-global-menu .tn-menu-collapse {
		display: flex !important; flex-direction: row !important; align-items: center; gap: 2px;
		position: static !important; height: auto !important; max-height: none !important; overflow: visible !important;
		padding: 0 !important; margin: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; visibility: visible !important;
	}
	html body .tnh .tn-global-menu .nav-item-dropdown {
		display: block !important; position: absolute !important; top: 100% !important; left: 50% !important; right: auto !important;
		width: 260px !important; min-width: 240px !important; max-width: min(95vw, 520px) !important;
		padding-top: 10px !important; margin: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
		opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
		transform: translate(-50%, 6px) !important; transition: opacity .16s ease, transform .16s ease, visibility .16s !important; z-index: 1050 !important;
	}
	html body .tnh .tn-global-menu .nav-item-dropdown.show,
	html body .tnh .tn-global-menu .header-nav-item.has-children:hover > .nav-item-dropdown,
	html body .tnh .tn-global-menu .header-nav-item.has-children:focus-within > .nav-item-dropdown {
		opacity: 1 !important; visibility: visible !important; pointer-events: auto !important; transform: translate(-50%, 0) !important;
	}
	html body .tnh .tn-global-menu .header-nav-item.has-children:hover .tn-nav-caret-icon { transform: rotate(180deg); }
}

/* Tablet + mobile (< 1200px): nút hamburger + panel trượt */
@media (max-width: 1199.98px) {
	html body .tnh-nav { order: 3; flex: none; justify-content: flex-end; }
	html body .tnh-actions { margin-left: auto; }
	html body .tnh .tn-global-menu .tn-menu-header { display: block !important; margin: 0 !important; padding: 0 !important; float: none !important; }
	html body .tnh .tn-global-menu .tn-menu-toggle {
		display: inline-flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
		width: 42px !important; height: 42px !important; margin: 0 !important; padding: 0 !important; float: none !important;
		border: 1px solid var(--tnc-line) !important; border-radius: 12px !important; background: #fff !important; position: relative !important;
	}
	html body .tnh .tn-global-menu .tn-menu-toggle .icon-bar {
		display: block !important; width: 18px !important; height: 2px !important; margin: 0 !important;
		border-radius: 2px !important; background: var(--tnc-ink) !important; font-size: 0 !important; transition: transform .2s ease, opacity .2s ease;
	}
	html body .tnh .tn-global-menu .tn-menu-toggle .icon-bar + .icon-bar { margin-top: 0 !important; }
	html body .tnh .tn-global-menu .tn-menu-toggle[aria-expanded="true"] .icon-bar:nth-of-type(2) { transform: translateY(7px) rotate(45deg); }
	html body .tnh .tn-global-menu .tn-menu-toggle[aria-expanded="true"] .icon-bar:nth-of-type(3) { opacity: 0; }
	html body .tnh .tn-global-menu .tn-menu-toggle[aria-expanded="true"] .icon-bar:nth-of-type(4) { transform: translateY(-7px) rotate(-45deg); }

	html body .tnh .tn-global-menu .tn-menu-collapse.collapse:not(.in) { display: none !important; }
	html body .tnh .tn-global-menu .tn-menu-collapse.in,
	html body .tnh .tn-global-menu .tn-menu-collapse.collapsing {
		display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important;
		position: fixed !important; top: var(--tnc-bar-h) !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
		width: 100% !important; max-width: none !important; height: auto !important; max-height: none !important;
		margin: 0 !important; padding: 12px 16px 32px !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch;
		background: #fff !important; border-top: 1px solid var(--tnc-line) !important; box-shadow: none !important; z-index: 1041 !important;
		transform: none !important; visibility: visible !important;
	}
	html body .tnh .tn-global-menu .header-nav-item { display: block !important; width: 100% !important; border-bottom: 1px solid #f0f3f1 !important; }
	html body .tnh .tn-global-menu .nav-item-cta { justify-content: space-between; border-radius: 0 !important; background: transparent !important; }
	html body .tnh .tn-global-menu .nav-item-cta > a { flex: 1; padding: 15px 4px !important; font-size: 16px !important; }
	html body .tnh .tn-global-menu .tn-nav-caret-wrap { width: 44px; height: 44px; margin: 0 !important; border-radius: 10px; background: #f4f7f5 !important; }
	html body .tnh .tn-global-menu .tn-nav-caret-wrap[aria-expanded="true"] .tn-nav-caret-icon { transform: rotate(180deg); }
	html body .tnh .tn-global-menu .nav-item-dropdown {
		position: static !important; width: auto !important; min-width: 0 !important; max-width: none !important;
		padding: 0 0 10px !important; margin: 0 !important; transform: none !important; opacity: 1 !important; visibility: visible !important; pointer-events: auto !important;
		background: transparent !important; border: 0 !important; box-shadow: none !important;
	}
	html body .tnh .tn-global-menu .dropdown--inner { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: #f7f9f8 !important; }
	html body .tnh .tn-global-menu .dropdown-link { padding: 12px 14px !important; font-size: 15px !important; }
	html body.tnh-menu-open { overflow: hidden; }
}

/* ---------------- User menu ---------------- */
html body .tnh-user { position: relative; }
html body .tnh-user__toggle {
	display: flex; align-items: center; gap: 8px; height: 44px; padding: 4px 10px 4px 4px;
	background: #fff; border: 1px solid var(--tnc-line); border-radius: 999px; cursor: pointer; color: var(--tnc-ink); font-weight: 600; font-size: 14.5px;
	transition: border-color .15s, box-shadow .15s;
}
html body .tnh-user__toggle:hover, html body .tnh-user.is-open .tnh-user__toggle { border-color: #c9d6cd; box-shadow: 0 2px 8px rgba(16, 40, 24, .08); }
html body .tnh-user__toggle .fa { color: var(--tnc-muted); transition: transform .18s ease; }
html body .tnh-user.is-open .tnh-user__toggle .fa { transform: rotate(180deg); }
html body .tnh-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
html body .tnh-avatar--text { display: grid; place-items: center; background: var(--tnc-green); color: #fff; font-weight: 700; font-size: 15px; }
html body .tnh-user__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .tnh-user__menu {
	position: absolute; right: 0; top: calc(100% + 10px); width: 260px; padding: 8px;
	background: #fff; border: 1px solid var(--tnc-line); border-radius: 16px; box-shadow: 0 18px 40px rgba(16, 40, 24, .16);
	opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .16s ease, transform .16s ease, visibility .16s; z-index: 1060;
}
html body .tnh-user.is-open .tnh-user__menu { opacity: 1; visibility: visible; transform: none; }
html body .tnh-user__head { padding: 10px 12px 12px; border-bottom: 1px solid var(--tnc-line); margin-bottom: 6px; }
html body .tnh-user__head strong { display: block; color: var(--tnc-ink); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body .tnh-user__head span { color: var(--tnc-muted); font-size: 13px; }
html body .tnh-user__group + .tnh-user__group { border-top: 1px solid var(--tnc-line); margin-top: 6px; padding-top: 6px; }
html body .tnh-user__menu a {
	display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
	color: var(--tnc-text) !important; font-size: 14.5px; text-decoration: none !important;
}
html body .tnh-user__menu a .fa { width: 18px; text-align: center; color: #8a968f; }
html body .tnh-user__menu a:hover { background: var(--tnc-green-50); color: var(--tnc-green-600) !important; }
html body .tnh-user__menu a:hover .fa { color: var(--tnc-green-600); }
html body .tnh-user__menu a.tnh-user__logout:hover { background: #fdecec; color: #c62828 !important; }
html body .tnh-user__menu a.tnh-user__logout:hover .fa { color: #c62828; }

/* ---------------- Breadcrumb + nền trang ---------------- */
html body .section-body { padding-top: 20px; }
html body .tnh-crumbs { margin: 0 0 16px !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
html body .tnh-crumbs .breadcrumbs-wrap { margin: 0 !important; background: none !important; }

/* ---------------- Mobile header ---------------- */
@media (max-width: 767.98px) {
	:root { --tnc-bar-h: 60px; }
	html body .tnh-inner { gap: 10px; padding: 0 12px; }
	html body .tnh-logo img { height: 36px; max-width: 150px; }
	html body .tnh-btn { height: 38px; padding: 0 12px; font-size: 14px; }
	html body .tnh-user__name, html body .tnh-user__toggle .fa { display: none; }
	html body .tnh-user__toggle { padding: 3px; height: 42px; }
	html body .tnh-user__menu { position: fixed; left: 12px; right: 12px; top: calc(var(--tnc-bar-h) + 6px); width: auto; }
	html body .section-body { padding-top: 14px; }
}
@media (max-width: 479.98px) {
	html body .tnh-hide-xs { display: none !important; }
	html body .tnh-logo img { max-width: 130px; }
}

/* ==========================================================
 * Footer
 * ========================================================== */
html body #footer.tnf {
	min-height: 0; margin-top: 48px; padding: 0; border: 0;
	background: #0f1f16; background-image: radial-gradient(600px 260px at 100% 0%, rgba(34, 168, 56, .16), transparent 70%);
	color: rgba(255, 255, 255, .72); font-size: 14.5px; line-height: 1.6;
}
html body #footer.tnf a { color: rgba(255, 255, 255, .78); text-decoration: none; transition: color .15s; }
html body #footer.tnf a:hover { color: #fff; }
html body .tnf-inner { max-width: var(--tnc-max); margin: 0 auto; padding: 0 16px; }
html body .tnf-main .tnf-inner {
	display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.25fr; gap: 40px; padding-top: 52px; padding-bottom: 40px;
}
html body .tnf-logo { display: inline-block; background: #fff; border-radius: 12px; padding: 8px 12px; margin-bottom: 16px; }
html body .tnf-logo img { display: block; height: 36px; width: auto; }

/* Tiêu đề cột: cả tiêu đề tĩnh lẫn h3 của block */
html body #footer.tnf .tnf-title,
html body #footer.tnf .tnf-col--blocks h3 {
	margin: 0 0 16px; padding: 0; border: 0; color: #fff; font-size: 15px; font-weight: 700;
	letter-spacing: .02em; text-transform: none;
}
html body #footer.tnf .tnf-intro h3 { display: none; }
html body #footer.tnf .panel-body { padding: 0; margin: 0; background: none; border: 0; }
html body #footer.tnf .tnf-col--blocks .panel-body + .panel-body { margin-top: 24px; }

html body #footer.tnf .tnf-links,
html body #footer.tnf .footer-list,
html body #footer.tnf .contact-box-custom ul { list-style: none; margin: 0; padding: 0; }
html body #footer.tnf .tnf-links li,
html body #footer.tnf .footer-list li { margin: 0 0 10px; padding: 0; border: 0; background: none; }
html body #footer.tnf .footer-list li::before,
html body #footer.tnf .footer-list a::before,
html body #footer.tnf .tnf-links a::before { display: none !important; content: none !important; }
html body #footer.tnf .footer-links-box { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }

/* Block giới thiệu (MENU_FOOTER) */
html body #footer.tnf .quiz-intro-box { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; text-align: left; color: inherit; }
html body #footer.tnf .quiz-badge {
	display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
	background: rgba(34, 168, 56, .18); color: #8ee39d; border: 0;
}
html body #footer.tnf .quiz-title { margin: 0 0 8px; color: #fff; font-size: 18px; font-weight: 700; line-height: 1.35; text-transform: none; }
html body #footer.tnf .quiz-title .highlight-free { color: #ffd666; background: none; -webkit-text-fill-color: currentColor; }
html body #footer.tnf .quiz-description { margin: 0 0 8px; color: rgba(255, 255, 255, .7); font-size: 14px; }
html body #footer.tnf .quiz-description .tag {
	display: inline-block; margin: 6px 4px 0 0; padding: 2px 9px; border-radius: 6px; font-size: 12.5px;
	background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); border: 0;
}
html body #footer.tnf .quiz-subtext { display: none; }

/* Block liên hệ (FEATURED_PRODUCT) */
html body #footer.tnf .contact-box-custom { margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
html body #footer.tnf .contact-box-custom li {
	display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: start;
	margin: 0 0 12px; padding: 0; border: 0; background: none; color: rgba(255, 255, 255, .78);
}
html body #footer.tnf .contact-box-custom .icon { grid-row: span 2; font-size: 15px; line-height: 1.5; }
html body #footer.tnf .contact-box-custom .label { display: block; margin: 0; padding: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: rgba(255, 255, 255, .5); background: none; text-align: left; white-space: normal; border-radius: 0; line-height: 1.5; }
html body #footer.tnf .footer-list a,
html body #footer.tnf .tnf-links a { display: inline; padding: 0; font-size: 14.5px; font-weight: 400; line-height: 1.5; background: none; border: 0; }
html body #footer.tnf .contact-box-custom .text,
html body #footer.tnf .contact-box-custom .link { display: block; color: #fff; word-break: break-word; }

/* Bottom bar */
html body .tnf-bottom { position: relative; border-top: 1px solid rgba(255, 255, 255, .08); }
html body .tnf-bottom .tnf-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
html body #footer.tnf .copyright { margin: 0; padding: 0; font-size: 13px; color: rgba(255, 255, 255, .55); }
html body #footer.tnf .copyright a { color: rgba(255, 255, 255, .72); }
html body .tnf-tools { display: flex; align-items: center; gap: 12px; }
html body #footer.tnf .qr-code-wraper { display: flex; align-items: center; gap: 12px; padding: 0; margin: 0; }
html body #footer.tnf .qr-code-wraper .panel-body,
html body #footer.tnf .qr-code-wraper > * { margin: 0; }
html body #footer.tnf .qr-code-wraper .btn {
	display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500;
	background: rgba(255, 255, 255, .08) !important; border: 1px solid rgba(255, 255, 255, .14) !important; color: rgba(255, 255, 255, .85) !important; box-shadow: none !important;
}
html body #footer.tnf .qr-code-wraper .btn:hover { background: rgba(255, 255, 255, .16) !important; color: #fff !important; }
html body #footer.tnf .qr-code-wraper .btn * { color: inherit !important; }
html body #footer.tnf .counter, html body #footer.tnf .counter * { color: rgba(255, 255, 255, .6); font-size: 13px; background: none; }
html body #footer.tnf .theme-change a, html body #footer.tnf .theme-change span { color: rgba(255, 255, 255, .6); margin-left: 8px; }

/* Nút lên đầu trang */
html body .tnf-totop {
	position: fixed; right: 18px; bottom: 18px; z-index: 1020;
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
	background: var(--tnc-green); color: #fff !important; box-shadow: 0 8px 20px rgba(34, 168, 56, .35);
	opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .2s, transform .2s, visibility .2s;
}
html body .tnf-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
html body .tnf-totop:hover { background: var(--tnc-green-600); }
html body .footerNav2 { display: none !important; }

@media (max-width: 991.98px) {
	html body .tnf-main .tnf-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
	html body .tnf-brand { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
	html body #footer.tnf { margin-top: 32px; }
	html body .tnf-main .tnf-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
	html body .tnf-bottom .tnf-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
	html body .tnh *, html body .tnf *, html body .tnf-totop { transition: none !important; }
}
