/*
 * Giao diện chung MapleLand (header, chân trang, nút, chữ) — viết MOBILE TRƯỚC, PC mở rộng bằng min-width.
 * Chỉ tác động khi <body> có class `ml-ui` (tắt bằng MAPLELAND_LEGACY_UI). Dùng token ở tokens.css.
 * Giữ khung Flatsome: không đổi cấu trúc HTML, chỉ chỉnh diện mạo.
 */

/* ---------- Chữ và màu nền ---------- */
body.ml-ui { font-family: var(--ml-font-body); color: var(--ml-text); -webkit-text-size-adjust: 100%; }
body.ml-ui h1, body.ml-ui h2, body.ml-ui h3 { font-family: var(--ml-font-heading); letter-spacing: 0; } /* màu chữ giữ theo Flatsome (tiêu đề trên nền tối vẫn trắng) */
body.ml-ui #wrapper, body.ml-ui #main { background: var(--ml-surface-alt); }

/* ---------- Header (mobile trước) ---------- */
.ml-ui #header, .ml-ui #header .header-wrapper { background: #fff; }
.ml-ui #masthead.header-main { height: 52px; min-height: 52px; border-bottom: 1px solid var(--ml-line); background: #fff; } /* chiều cao Flatsome đặt bằng CSS động, ghi đè bằng độ ưu tiên cao hơn */
.ml-ui #masthead .header-inner { height: 100%; align-items: center; flex-wrap: nowrap; }
.ml-ui #logo { margin-right: auto; width: auto; max-width: 56%; }
.ml-ui #logo a.plain, .ml-ui #logo .logo-text, .ml-ui #logo a:not(:has(img)) { font-family: var(--ml-font-heading); font-weight: 700; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; color: var(--ml-red); white-space: nowrap; line-height: 1; }
.ml-ui #logo img { max-height: 30px; width: auto; }
.ml-ui .header-ml-actions { display: flex; align-items: center; gap: 10px; margin: 0; list-style: none; }
.ml-ui .header-ml-actions { height: auto; align-self: center; }
.ml-ui .header-ml-actions .ml-hotline { display: none; align-items: center; gap: 6px; padding: 0 14px; height: 34px; min-height: 34px; line-height: 1; border-radius: 8px; background: var(--ml-primary); color: #fff !important; font-weight: 700; font-size: 14px; white-space: nowrap; text-decoration: none; }
.ml-ui .ml-hotline:hover { background: var(--ml-primary-strong); }
.ml-ui .ml-hotline__label { opacity: .85; font-weight: 600; }
.ml-ui .ml-lang { display: flex; align-items: center; min-height: 36px; max-width: 150px; overflow: hidden; border: 1px solid #d3d8de; border-radius: 8px; padding: 0 8px; font-size: 13px; font-weight: 600; background: #fff; }
.ml-ui .ml-lang a, .ml-ui .ml-lang select { color: var(--ml-dark); font-size: 13px; }
.ml-ui .ml-lang * { max-width: 100%; }
.ml-ui .header-nav .nav-icon a, .ml-ui .header-nav .menu-icon a, .ml-ui .mobile-nav .nav-icon a, .ml-ui .mobile-nav .menu-icon a { color: var(--ml-dark); min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* Menu chính */
.ml-ui .header-nav-main { flex-wrap: nowrap; }
.ml-ui .header-nav-main > li { white-space: nowrap; }
.ml-ui .header-nav-main > li > a { font-family: var(--ml-font-body); font-size: 15px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #1d2733; }
.ml-ui .header-nav-main > li > a:hover, .ml-ui .header-nav-main > li.active > a, .ml-ui .header-nav-main > li.current-menu-item > a { color: var(--ml-primary); }
.ml-ui .nav-dropdown { border-radius: 10px; border: 1px solid var(--ml-line); box-shadow: 0 10px 28px rgba(22,33,47,.14); }
.ml-ui .nav-dropdown li a { font-weight: 600; text-transform: none; }

/* Ngăn kéo menu mobile của Flatsome: chữ rõ, vùng chạm lớn */
.ml-ui .mobile-sidebar .nav-sidebar > li > a { font-weight: 600; font-size: 16px; min-height: 48px; display: flex; align-items: center; text-transform: none; }

@media (min-width: 850px) and (max-width: 1099px) {
	.ml-ui .header-nav-main > li > a { font-size: 14px; padding-inline: 6px; }
	.ml-ui .ml-hotline { padding: 0 12px; font-size: 14px; }
	.ml-ui .ml-lang { max-width: 110px; }
}
@media (min-width: 850px) {
	.ml-ui #masthead.header-main { height: 56px; min-height: 56px; }
	.ml-ui #logo { max-width: none; margin-right: 24px; }
	.ml-ui #logo img { max-height: 34px; }
	.ml-ui .header-ml-actions .ml-hotline { display: inline-flex; }
	.ml-ui .ml-lang { max-width: 180px; }
}

/* ---------- Nút dùng chung (cùng ngôn ngữ với canvas) ---------- */
.ml-ui .ml-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 10px; font-size: 16px; line-height: 1.2; text-decoration: none; }
.ml-ui .ml-btn--zalo { background: #fff; color: var(--ml-zalo); box-shadow: inset 0 0 0 2px var(--ml-zalo); }
.ml-ui .ml-btn--zalo:hover { background: var(--ml-zalo); color: #fff; }
.ml-ui .ml-btn--ghost { background: #fff; color: var(--ml-dark); box-shadow: inset 0 0 0 2px var(--ml-dark); }
.ml-ui .ml-btn--ghost:hover { background: var(--ml-dark); color: #fff; }

/* ---------- Chân trang ---------- */
.ml-ui #footer { background: var(--ml-navy); }
.ml-footer { background: var(--ml-navy); color: #aab4c2; font-size: 14px; line-height: 1.6; }
.ml-footer a { color: #d5dbe4; text-decoration: none; }
.ml-footer a:hover { color: #fff; text-decoration: underline; }
.ml-footer__grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-block: 32px 12px; }
.ml-footer__logo { margin: 0 0 6px; font-family: var(--ml-font-heading); font-size: 24px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.ml-footer__legal { margin: 0 0 6px; color: #fff; font-weight: 600; }
.ml-footer p { margin: 0 0 6px; }
.ml-footer__title { margin: 0 0 10px; font-family: var(--ml-font-heading); font-size: 20px; color: #fff; }
.ml-footer ul { list-style: none; margin: 0; padding: 0; }
.ml-footer li { margin: 0 0 6px; }
.ml-footer__col a { display: inline-block; padding-block: 3px; }
.ml-footer__social { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.ml-footer__bottom { padding-block: 14px 24px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 8px; font-size: 13px; }
.ml-footer__bottom p { margin: 0; }
@media (max-width: 849px) { .ml-ui #footer { padding-bottom: 56px; } } /* chừa chỗ cho thanh dưới mobile */
@media (min-width: 850px) {
	.ml-footer__grid { grid-template-columns: 1.4fr 1fr 1.4fr; gap: 40px; padding-block: 44px 16px; }
}

/* Ngăn kéo menu gọn: hẹp hơn, dòng thấp, chữ vừa */
.ml-ui .off-canvas .mfp-content, .ml-ui .mobile-sidebar { width: 260px; max-width: 86vw; }
.ml-ui .mobile-sidebar { padding: 0; }
.ml-ui .mobile-sidebar .sidebar-menu { padding: 12px 16px 16px; }
.ml-ui .mobile-sidebar .nav-sidebar > li > a { min-height: 44px; font-size: 15px; padding-block: 0; }
.ml-ui .mobile-sidebar .nav-sidebar > li { margin: 0; }
.ml-ui .mobile-sidebar .searchform .search-field, .ml-ui .mobile-sidebar .searchform input[type="search"] { height: 38px; min-height: 38px; font-size: 14px; }
.ml-ui .mobile-sidebar .searchform .button, .ml-ui .mobile-sidebar .searchform button { min-height: 38px; height: 38px; }
.ml-ui #masthead .header-inner { padding-block: 0; }
.ml-ui #masthead .nav-icon a, .ml-ui #masthead .header-nav .nav-icon a { min-width: 36px; min-height: 36px; }

/* Header dính (Flatsome thêm .stuck khi cuộn): giữ cùng kích thước gọn, không để Flatsome nới ra */
.ml-ui .header-wrapper.stuck #masthead.header-main, .ml-ui .header-wrapper.stuck #masthead .header-inner { height: 56px; min-height: 56px; }
.ml-ui #masthead #logo img, .ml-ui .header-wrapper.stuck #masthead #logo img { max-height: 34px !important; height: auto; width: auto; padding: 0; }
.ml-ui #masthead .header-ml-actions, .ml-ui #masthead .header-ml-actions .ml-hotline { line-height: 1 !important; }
.ml-ui #masthead .header-ml-actions .ml-hotline { height: 34px; padding-block: 0; align-items: center; }
@media (max-width: 849px) { .ml-ui .header-wrapper.stuck #masthead.header-main, .ml-ui .header-wrapper.stuck #masthead .header-inner { height: 52px; min-height: 52px; } .ml-ui #masthead #logo img, .ml-ui .header-wrapper.stuck #masthead #logo img { max-height: 30px !important; } }

/* Header riêng của trang dự án: menu mục nhảy trong trang cạnh logo dự án */
html:has(body.ml-pmenu) { scroll-padding-top: 84px; }
.ml-ui .header-nav-main > li.ml-pnav > a { font-family: var(--ml-font-body); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ml-dark, #16212f); padding: 6px 12px; border-bottom: 3px solid transparent; border-radius: 0; }
.ml-ui .header-nav-main > li.ml-pnav > a:hover, .ml-ui .header-nav-main > li.ml-pnav > a.is-active { color: var(--ml-primary-strong); border-bottom-color: var(--ml-primary); background: transparent; }
.ml-ui .header-nav-main.nav-left { gap: 2px; margin-left: 20px; }
@media (min-width: 850px) and (max-width: 1099px) { .ml-ui .header-nav-main > li.ml-pnav > a { padding-inline: 8px; font-size: 13px; } }
.ml-ui .ml-pmenu-list a { font-weight: 600; }

/* Nút Gọi không xuống dòng khi cột phải hẹp */
.ml-ui .header-ml-actions { flex: none; width: max-content; white-space: nowrap; }
.ml-ui .header-ml-actions .ml-hotline { flex-wrap: nowrap; width: max-content; }
