/*
 * glue.css: nối hệ thiết kế MTEE (mt.css) với Flatsome, WooCommerce và WordPress.
 * Không thuộc cascade layer nên thắng CSS Flatsome (layer "flatsome").
 */

/* ---------- nền chung ---------- */
/* Chữ phụ (giá gạch, số đếm bộ lọc, ngày, placeholder) dùng --mt-faint trên nền sáng: #86868b chỉ đạt 3,6:1,
   đổi sang #6e6e73 (≈5,1:1) cho đạt WCAG AA với chữ nhỏ. Nền tối dùng #86868b viết cứng trong mt.css nên không đổi. */
:root { --mt-faint: #6e6e73; }
/* Thân trang rộng bằng header (.mt-wrap-wide, 1440px) để mép trái/phải thẳng hàng với logo và nút gọi.
   Khối chữ dài (mô tả sản phẩm, bài viết) giữ max-width riêng nên không bị dòng quá dài. */
:root { --mt-wrap: var(--mt-wrap-wide); }
html.mt-locked, html.mt-locked body { overflow: hidden; }
body.mtee { font-family: var(--mt-font); color: var(--mt-text); background: var(--mt-bg); }
/* html (Flatsome) và body (mt.css) cùng overflow-x:hidden làm body thành khung cuộn riêng, header
   và mọi phần tử position:sticky không dính. clip cắt tràn ngang mà không tạo khung cuộn. */
body.mtee { overflow-x: clip; }
/* mt.css reset form control bằng `all: revert` nên box-sizing về content-box: input width:100% + padding tràn khung.
   Cùng độ ưu tiên 0 (:where) và nạp sau mt.css nên thắng, mà class của component vẫn ghi đè được. */
:where(.mt-ui) :where(button, input, select, textarea) { box-sizing: border-box; }
body.mtee #wrapper { background: var(--mt-bg); }
body.mtee #main { background: transparent; }

/* Flatsome chèn link "skip" riêng; giữ link của theme, hiện khi focus. */
.skip-link.screen-reader-text:focus {
  clip: auto !important; clip-path: none; width: auto; height: auto; z-index: 100000;
  position: fixed; top: 8px; left: 8px; padding: 10px 16px; border-radius: var(--mt-r-xs);
  background: var(--mt-ink); color: #fff; font-size: 14px; text-decoration: none;
}

/* ---------- header ---------- */
/* Thanh quản trị WordPress (khi đăng nhập) đẩy header xuống. */
.admin-bar .mt-gnav { top: var(--wp-admin--admin-bar--height, 32px); }
/* Thanh dính trang sản phẩm phải bám dưới header đã bị admin bar đẩy xuống, nếu không sẽ bị header che, chỉ ló một dải mỏng. */
.admin-bar .mt-lnav { top: calc(var(--wp-admin--admin-bar--height, 32px) + var(--mt-nav-h)); }
@media (max-width: 600px) { .admin-bar .mt-gnav { top: 0; } .admin-bar .mt-lnav { top: var(--mt-nav-h); } }
.mt-gnav__badge[hidden] { display: none; }
.mt-gnav__menu { margin: 0; }
.mt-gnav__item { margin: 0; list-style: none; }
.mt-gnav__link.is-current { color: var(--mt-ink); }
/* Logo MTEE (biểu tượng + 2 dòng chữ): cao 32px để dòng "Electrical Equipment" còn đọc được; ảnh từ thư viện cũng giữ chiều cao này. */
.mt-gnav__logo img, .mt-mmenu__logo img { display: block; height: 32px; width: auto; max-width: none; }
.mt-flyout__card .mt-img img { width: 100%; height: 100%; object-fit: cover; }

/* Flatsome vẫn in sẵn khung menu mobile cũ, lớp phủ và các popup: không để lộ. */
body.mtee #main-menu.mobile-sidebar:not(.mfp-content #main-menu) { display: none; }

/* Thông báo WooCommerce (Flatsome in sau header) nằm trong khung nội dung. */
body.mtee .woocommerce-notices-wrapper:not(:empty) { width: min(100% - 2 * var(--mt-gutter), var(--mt-wrap)); margin: 16px auto 0; }

/* Tiêu đề khối 2 dòng: chia đều thay vì để một chữ rớt xuống dòng ("…Mạnh / Tùng."). */
.mt-shead > h2 { text-wrap: balance; }

/* ---------- toast + Flatsome back-to-top/tawk chừa chỗ ---------- */
.mt-toast a[hidden] { display: none; }

/* Nút Zalo/gọi nổi cũ (Flatsome > Advanced > HTML before </body>): giữ link, đổi thành dock gọn.
   Bản cũ có vòng sóng nhấp nháy 160px che nội dung góc trái. */
body.mtee .hotline-phone-ring-wrap { left: 16px; bottom: 24px; z-index: 110; display: flex; flex-direction: column; gap: 10px; }
body.mtee .hotline-phone-item, body.mtee .hotline-phone-ring { position: static; width: 46px; height: 46px; transform: none; }
body.mtee .hotline-phone-ring-circle, body.mtee .hotline-phone-ring-circle-fill, body.mtee .hotline-bar { display: none; }
body.mtee .hotline-phone-ring-img-circle {
  position: static; width: 46px; height: 46px; border: 0; animation: none; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.16), 0 1px 3px rgba(0,0,0,.12); transition: transform .2s;
}
body.mtee .hotline-phone-ring-img-circle:hover { transform: translateY(-2px); }
body.mtee .hotline-phone-ring-img-circle .pps-btn-img { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; }
body.mtee .hotline-phone-ring-img-circle .pps-btn-img img { width: 26px; height: 26px; }
body.mtee .hotline-phone-ring-img-circle .pps-btn-img:focus-visible { outline: 2px solid var(--mt-blue); outline-offset: 3px; }
/* Trang có thanh liên hệ cố định mobile (đã có Gọi/Zalo): không lặp nút nổi. */
@media (max-width: 849px) {
  /* Điện thoại: chữ canh trái nên dock bên trái che đầu dòng; chuyển sang phải, nhỏ hơn. */
  /* Bong bóng Tawk.to (≈64px, cách đáy ≈20px) cũng nằm góc phải dưới: xếp cụm này ngay phía trên nó. */
  body.mtee .hotline-phone-ring-wrap { left: auto; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  body.mtee .hotline-phone-item, body.mtee .hotline-phone-ring,
  body.mtee .hotline-phone-ring-img-circle, body.mtee .hotline-phone-ring-img-circle .pps-btn-img { width: 44px; height: 44px; }
  body.mtee .hotline-phone-ring-img-circle .pps-btn-img img { width: 24px; height: 24px; }
  body.mtee:has(.mtee-mbar, .mt-mbar) .hotline-phone-ring-wrap { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.mtee .hotline-phone-ring-img-circle { transition: none; } }
/* Trang có form (giỏ hàng, thanh toán, tài khoản, liên hệ): khi lề hai bên hẹp hơn cụm nút (16 + 46 + 12px,
   tức màn < 1180 + 2×74 = 1328px) nút nổi đè lên ô nhập/nút "Mã giảm giá". Ẩn ở đó; Tawk vẫn còn để hỏi. */
@media (max-width: 1327px) {
  body.mtee:is(.woocommerce-cart, .woocommerce-checkout, .woocommerce-account) .hotline-phone-ring-wrap,
  /* Form CF7 của popup "Yêu cầu báo giá" (#ycbg.mfp-hide) có trên MỌI trang: không tính nó, nếu không nút Gọi/Zalo nổi
     bị ẩn gần như toàn site ở màn < 1328px. Chỉ tính form CF7 nằm thẳng trong trang. */
  body.mtee:has(:not(.mfp-hide) > .wpcf7 > form.wpcf7-form, form.mt-qform, form.checkout, form.woocommerce-cart-form) .hotline-phone-ring-wrap { display: none; }
}

/* ---------- nội dung soạn thảo (bài viết, mô tả sản phẩm, trang) ---------- */
.mt-prose { font-size: 17px; line-height: 1.65; color: var(--mt-text); }
.mt-prose > * + * { margin-top: 1em; }
.mt-prose h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.015em; font-weight: 700; margin-top: 1.6em; }
.mt-prose h3 { font-size: 21px; line-height: 1.3; font-weight: 700; margin-top: 1.4em; }
.mt-prose h4 { font-size: 18px; font-weight: 600; margin-top: 1.2em; }
.mt-prose a { color: var(--mt-link); }
.mt-prose img { border-radius: var(--mt-r-sm); height: auto; max-width: 100%; }
.mt-prose ul, .mt-prose ol { padding-left: 1.3em; }
.mt-prose li + li { margin-top: .35em; }
.mt-prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.mt-prose th, .mt-prose td { border-bottom: 1px solid var(--mt-line-soft); padding: 10px 12px; text-align: left; vertical-align: top; }
.mt-prose th { font-weight: 600; background: var(--mt-bg-alt); }
.mt-prose blockquote { border-left: 3px solid var(--mt-blue); padding: 4px 0 4px 18px; color: var(--mt-muted); }
.mt-prose figure { margin: 1.4em 0; }
.mt-prose figcaption, .mt-prose .wp-caption-text { font-size: 13px; color: var(--mt-muted); margin-top: 6px; }
.mt-prose .table-responsive, .mt-prose .wp-block-table { overflow-x: auto; }

/* ---------- WooCommerce chung ---------- */
body.mtee .woocommerce-message, body.mtee .woocommerce-info, body.mtee .woocommerce-error {
  border-radius: var(--mt-r-sm); font-size: 15px;
}

/* Hiệu ứng hiện dần khi cuộn: trên điện thoại cuộn nhanh, 0.8s + dịch 24px để lại khoảng trống — rút ngắn, dịch ít hơn. */
@media (max-width: 734px) {
  .mt-reveal { transform: translateY(12px); transition-duration: .45s, .45s; }
  [data-stagger] > .mt-reveal { transition-delay: calc(var(--d, 0ms) / 2); }
}

/* ---------- Thanh điều hướng (QA 2026-11-18) ---------- */
/* Flyout: .mt-gnav có backdrop-filter nên backdrop-filter của flyout (con) không làm mờ được nội dung
   phía dưới; nền .97 để lộ chữ hero xuyên qua. Dùng nền đặc. */
.mt-gnav .mt-flyout { background: #fbfbfd; }
/* 1401–1439px: ô tìm 230px + nút hotline đầy đủ làm thanh rộng hơn màn hình tới 38px, nút hotline bị cắt. */
.mt-gnav__search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (min-width: 1401px) and (max-width: 1439px) {
  .mt-gnav .mt-gnav__search { width: 190px; }
  .mt-gnav .mt-gnav__search kbd { display: none; }
}

/* ---------- Vùng bấm tối thiểu 40px (QA 2026-11-18) ---------- */
/* Thông báo nổi đặt left:50% nên chỉ rộng tối đa nửa màn hình và xuống dòng trên điện thoại. */
.mt-toast { width: max-content; max-width: calc(100vw - 32px); }
/* Link "Xem giỏ" trong thông báo đã thêm vào giỏ: chữ 14px chỉ cao ~17px. */
.mt-toast a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; margin: -10px -6px -10px 0; border-radius: 8px; }
/* Huy hiệu footer ("Đã thông báo Bộ Công Thương"): giữ viên 26px, nới vùng bấm ra 40px. */
/* Breadcrumb: dấu › đi liền mục sau (inc/pages.php mtee_crumbs) để không rớt dòng đứng một mình. */
.mt-crumbs__i { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }

/* Điện thoại / màn cảm ứng: nới vùng bấm các link chữ nhỏ lên ~40px bằng padding + margin âm (không đổi bố cục). */
@media (max-width: 734px), (pointer: coarse) {
  /* Huy hiệu footer ("Đã thông báo Bộ Công Thương"): ảnh 15px. */
  .mt-footer__badges span a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .mt-crumbs a { padding-block: 11px; margin-block: -11px; }
  /* Bỏ qua link đã có min-height 40px (.mt-more--sm: cuối file này + quy tắc pointer:coarse bên dưới; các khung trong glue-pages.css:239):
     nới thêm thì vùng bấm 56px chồng hàng kế (khung mua PDP, cụm link trang 404). */
  .mt-ui a.mt-more:not(.mt-more--sm, :is(.mt-nf__links, .mt-page__helpcard, .mt-related .mt-shead, .mt-qaside) *) { padding-block: 8px; margin-block: -8px; }
  .mt-popular .mt-chip { height: 40px; }
  /* Ô tìm kiếm lớn (trang chủ, kết quả tìm, 404): ô nhập cao bằng cả khung 54px thay vì 27px. */
  .mt-bigsearch input { align-self: stretch; height: auto; }
  /* Ô số lượng nhỏ (danh sách kết quả tìm): 34px -> 40px, nút ± rộng 36px. */
  .mt-qty--sm { height: 40px; }
  .mt-qty--sm button { width: 36px; }
  .mt-qty input { align-self: stretch; height: auto; }
  /* Nút sao chép mã trong viên mã sản phẩm: icon 15px. */
  .mt-ui .mt-buy__ids .mt-copy button { padding: 10px; margin: -10px -6px -10px -6px; }
  /* Danh mục trong bộ lọc: link 14px chỉ cao 27px. */
  .mt-fcats a { padding-block: 8px; }
  .mt-fcats .mt-sub { gap: 0; }
  /* "Mã giảm giá" trong giỏ hàng. */
  .mt-bag-coupon summary { padding-block: 10px; }
}

/* Nhãn giảm giá: chữ trắng 13px trên #ff3b30 chỉ đạt 3,5:1. Làm đậm gradient để mọi điểm đạt ≥ 4,5:1 (WCAG AA). */
.mt-pcard__flag { background: linear-gradient(135deg, #e5141f, #b0000f); }

/* Nút cam: chữ trắng trên #e8700f chỉ đạt 3,1:1. Dời gradient xuống một bậc để điểm sáng nhất đạt 4,5:1. */
.mt-btn--orange { --b-bg: #a94a09; --b-bd: #a94a09; background-image: linear-gradient(180deg, #c2570c, #a94a09); }
.mt-btn--orange:hover { background: #8f3f08; border-color: #8f3f08; }
/* Link trên dải ưu đãi cam: đậm 700 để thành chữ lớn (≥14px đậm, ngưỡng 3:1); nền sau chữ ≈ #c85a0c cho 4,3:1. */
.mt-dealbar .mt-more { font-weight: 700; }

/* ---------- Dải danh mục cuộn ngang [mt_intro] > [mt_cat] / .mt-subcats (QA 2026-11-18) ---------- */
/* overflow-x:auto kéo overflow-y thành auto; các ô chưa hiện (.mt-reveal dịch xuống 12–24px, ô nằm ngoài
   khung ngang thì chưa bao giờ "is-in") làm dải cao hơn khung → cuộn dọc được. Khoá trục dọc, và trong dải
   chỉ hiện dần bằng độ mờ, không dịch dọc, để ô không bị cắt đáy. Không đặt touch-action để vuốt dọc
   trên dải vẫn cuộn trang. */
.mt-catnav { overflow-y: hidden; overscroll-behavior-x: contain; }
/* Các dải cuộn ngang khác (chip lọc tin tức, tab, menu tài khoản, kệ sản phẩm, dải thương hiệu, chip lọc cửa hàng):
   cùng lý do, khoá trục dọc. overflow-x:auto vốn đã cắt trục dọc nên không cắt thêm gì. */
.mt-filters-row, .mt-tabs, .mt-acct-nav ul, .mt-shelf__track, .mt-marquee, .mt-ui .mt-facets__row { overflow-y: hidden; overscroll-behavior-x: contain; }

/* Máy tính bảng cảm ứng (iPad dọc 768–1024px): nút chữ nhỏ (Gọi, Zalo, So sánh, Đọc thêm) chỉ cao 21px
   vì quy tắc 40px (cuối file này) chỉ áp dụng ≤734px. Theo con trỏ thô thì áp dụng ở mọi cỡ màn. */
/* Cuối file này đặt min-height:0 cho button.mt-more, nên thêm "html" để thắng cùng độ ưu tiên. */
@media (pointer: coarse) { html .mt-ui button.mt-more, html .mt-ui .mt-more--sm { min-height: 40px; } }
.mt-catnav > .mt-reveal { transform: none; }

/* ---------- Thông báo nổi trên điện thoại (QA 2026-11-19) ---------- */
/* Bong bóng Tawk.to (≈56–60px, cách phải 12–20px) và cụm nút Zalo/Gọi (phải 12px, rộng 44px) chiếm cột phải ≈76px.
   Thông báo canh giữa ở màn 375px trùm sang cột này: Tawk (z-index cao nhất) che ⅓ link "Xem giỏ".
   Canh trái và chừa cột phải. Trang sản phẩm: đặt trên thanh mua hàng cố định (cao ≈65px) thay vì đè lên nó. */
@media (max-width: 734px) {
  .mt-toast { left: 16px; max-width: calc(100vw - 16px - 84px); gap: 10px; padding: 12px 10px 12px 14px; transform: translateY(20px); }
  /* Chữ dài (có tên sản phẩm) được xuống dòng, link "Xem giỏ"/"Xem báo giá" giữ một dòng. */
  .mt-toast a { white-space: nowrap; flex-shrink: 0; }
  .mt-toast.is-on { transform: none; }
  .has-mbar .mt-toast { bottom: calc(77px + env(safe-area-inset-bottom, 0px)); }
}
/* Huy hiệu reCAPTCHA (cố định, đáy 14px) nằm sau thanh mua hàng mobile, thò lên ≈9px ở mép phải.
   Đưa lên trên bong bóng Tawk (đáy ≈84px + cao ≈64px). Không ẩn: ẩn thì phải ghi chú reCAPTCHA thay thế. */
@media (max-width: 849px) {
  body.has-mbar .grecaptcha-badge { bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Chân trang trên màn cảm ứng: link pháp lý (Chính sách bảo mật | Điều khoản | Bảo hành) chỉ cao 15px và nằm sát nhau,
   chữ 11–12px khó đọc và vùng chạm thấp. Trên cảm ứng: chữ 13px + đệm dọc 10px → cao ~37px, không đổi bố cục ngang. */
@media (pointer: coarse), (max-width: 834px) {
	.mt-ui .mt-footer__legal { font-size: 13px; }
	.mt-ui .mt-footer__legal li a { display: inline-block; padding-block: 10px; }
}

/* Safari iOS tự phóng to trang khi chạm vào ô nhập có chữ < 16px (ô danh sách mã 13.5–14px, ô số lượng 15px,
   ô sắp xếp 14px, form liên hệ 15px), khách phải tự thu nhỏ lại. Trên màn cảm ứng/hẹp ép mọi ô nhập về 16px. */
@media (pointer: coarse), (max-width: 834px) {
	body.mtee :is(input:not([type=checkbox], [type=radio], [type=submit], [type=button], [type=hidden], [type=range]), select, textarea) { font-size: 16px !important; }
}

/* Tiêu đề cột chân trang dùng <p class="mt-footer__h"> (không phải heading) để menu/footer không chen vào dàn ý tiêu đề của trang.
   Giữ nguyên giao diện của rule gốc .mt-footer__dir h4 trong mt.css (dòng 576 và khối ≤734px). */
.mt-ui .mt-footer__dir .mt-footer__h { font-size: 12px; font-weight: 600; color: var(--mt-ink); margin: 0 0 10px; }
@media (max-width: 734px) {
	.mt-ui .mt-footer__dir .mt-footer__h { margin: 0; padding: 12px 0; display: flex; justify-content: space-between; cursor: pointer; }
	.mt-ui .mt-footer__dir .mt-footer__h::after { content: "+"; font-weight: 300; font-size: 16px; line-height: 1; }
	.mt-ui .mt-footer__dir .is-open .mt-footer__h::after { content: "–"; }
}

/* Bài viết: "Trong bài này" và "Chia sẻ" đổi h4 → h2 (không nhảy cấp sau h1/h2). Giữ giao diện của .mt-toc h4 / .mt-share h4 trong mt.css. */
.mt-toc .mt-toc__h, .mt-share .mt-share__h { font-size: 12px; font-weight: 600; color: var(--mt-muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 12px; }
.mt-share .mt-share__h { margin-bottom: 4px; }

/* ---------- Mega menu "Sản phẩm" (2026-11-19) ----------
   Cột trái: nhóm cấp 1. Phải: lưới danh mục con có ảnh, chia nhóm như live. Dữ liệu: plugin MTEE Mega Menu. */
/* "Sản phẩm" có mũi tên ▾, xoay lên khi menu mở. */
.mt-gnav__item.has-flyout > .mt-gnav__link::after {
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 3px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; opacity: .55;
  transform: rotate(45deg); transition: transform .2s var(--mt-ease), opacity .2s;
}
.mt-gnav__item.has-flyout:hover > .mt-gnav__link::after,
.mt-gnav__item.has-flyout:focus-within > .mt-gnav__link::after { transform: translateY(3px) rotate(225deg); opacity: .9; }

/* Khung: nền trắng đặc, làm mờ trang phía dưới để menu nổi lên. */
/* Nền tối phía dưới: dùng box-shadow lan rộng + clip-path (pseudo-element con của phần tử có
   backdrop-filter không vẽ được màu bán trong suốt). clip-path cắt phần bóng phía trên. */
.mt-flyout--mega {
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .22), 0 0 0 100vmax rgba(29, 29, 31, .28);
  clip-path: inset(0 -100vmax -100vmax -100vmax);
}
.mt-flyout--mega .mt-mega {
  display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 0 8px; padding: 16px 0;
  height: min(620px, calc(100vh - var(--mt-nav-h) - 40px)); height: min(620px, calc(100dvh - var(--mt-nav-h) - 40px));
}

/* Cột trái: khối xám bo góc, mục đang chọn là ô trắng nổi. */
.mt-mega__rail {
  display: flex; flex-direction: column; gap: 2px; padding: 10px;
  background: var(--mt-bg-alt); border-radius: var(--mt-r-md); overflow-y: auto; overscroll-behavior: contain;
}
.mt-ui .mt-mega__cat {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px 6px 7px; flex: none;
  border-radius: var(--mt-r-sm); color: var(--mt-ink); font-size: 14px; font-weight: 500; letter-spacing: -.01em;
  transition: background-color .15s, box-shadow .15s, color .15s;
}
.mt-ui .mt-mega__cat:hover { background: rgba(0, 0, 0, .045); text-decoration: none; }
.mt-ui .mt-mega__cat.is-active { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px -6px rgba(0, 0, 0, .14); font-weight: 600; }
.mt-mega__cat-ico {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: #fff; border-radius: 10px; overflow: hidden;
}
.mt-mega__cat.is-active .mt-mega__cat-ico { background: var(--mt-bg-alt); }
.mt-mega__cat-ico img { width: 28px; height: 28px; object-fit: contain; mix-blend-mode: multiply; }
.mt-mega__cat-ico .mt-ico, .mt-mega__thumb .mt-ico { width: 20px; height: 20px; color: var(--mt-faint); }
.mt-mega__cat-name { flex: 1; min-width: 0; }
.mt-mega__cat > .mt-ico { flex: none; width: 14px; height: 14px; color: var(--mt-faint); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.mt-mega__cat:hover > .mt-ico, .mt-mega__cat.is-active > .mt-ico { opacity: 1; transform: none; }
.mt-mega__cat.is-active > .mt-ico { color: var(--mt-blue); }

/* Bên phải: tiêu đề nhóm + lưới ô ảnh. */
.mt-mega__main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.mt-mega__panes { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 8px 20px 28px; }
.mt-mega__pane { animation: mt-fade .18s; }
.mt-mega__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mt-ui .mt-mega__title { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0; color: var(--mt-ink); }
.mt-ui .mt-mega__all, .mt-ui .mt-mega__sec-head a {
  flex: none; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: var(--mt-link);
}
.mt-ui .mt-mega__all::after, .mt-ui .mt-mega__sec-head a::after { content: "›"; margin-left: 4px; font-size: 1.25em; line-height: 1; transition: transform .15s; }
.mt-ui .mt-mega__all:hover, .mt-ui .mt-mega__sec-head a:hover { text-decoration: none; }
.mt-ui .mt-mega__all:hover::after, .mt-ui .mt-mega__sec-head a:hover::after { transform: translateX(3px); }
.mt-mega__sec { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--mt-line-soft); }
.mt-mega__head + .mt-mega__sec { margin-top: 18px; padding-top: 0; border-top: 0; }
.mt-mega__sec-head { display: flex; align-items: baseline; justify-content: flex-start; gap: 14px; margin-bottom: 14px; }
.mt-ui .mt-mega__sec-head .mt-mega__sec-title { margin: 0; width: auto; flex: 0 1 auto; font-size: 16px; font-weight: 600; color: var(--mt-ink); letter-spacing: -.01em; }

.mt-mega__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 18px 14px; }
.mt-ui .mt-mega__tile {
  display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding: 0; text-align: center;
  background: none; border: 0; border-radius: 0; color: var(--mt-ink);
}
.mt-ui .mt-mega__tile .mt-mega__thumb {
  width: auto; height: auto; aspect-ratio: 5 / 4; display: grid; place-items: center;
  background: var(--mt-bg-alt); border-radius: 14px; overflow: hidden; transition: background-color .2s;
}
.mt-ui .mt-mega__tile .mt-mega__thumb img {
  width: 70%; height: 70%; max-width: 96px; max-height: 80px; object-fit: contain; mix-blend-mode: multiply;
  transition: transform .3s var(--mt-ease);
}
.mt-ui a.mt-mega__tile:hover { text-decoration: none; }
.mt-ui a.mt-mega__tile:hover .mt-mega__thumb { background: #ececf0; }
.mt-ui a.mt-mega__tile:hover .mt-mega__thumb img { transform: scale(1.07); }
.mt-ui a.mt-mega__tile:hover .mt-mega__name { color: var(--mt-blue); }
.mt-ui a.mt-mega__tile:focus-visible { outline: none; }
.mt-ui a.mt-mega__tile:focus-visible .mt-mega__thumb { outline: 2px solid var(--mt-blue); outline-offset: 2px; }
.mt-mega__name {
  font-size: 13px; font-weight: 500; line-height: 1.3; min-height: 2.6em; padding: 0 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Chân: dải xám nhẹ, nút Gọi / Zalo. */
.mt-mega__foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: 0 0 0 28px; padding: 10px 10px 10px 18px; background: var(--mt-bg-alt); border-radius: var(--mt-r-md);
}
.mt-mega__foot p { margin: 0; font-size: 13px; color: var(--mt-muted); line-height: 1.45; max-width: 460px; }
.mt-mega__foot p b { color: var(--mt-ink); font-weight: 600; }
.mt-mega__cta { display: flex; gap: 8px; flex: none; }
.mt-mega__cta .mt-cbtn { padding: 7px 14px; background: #fff; }
.mt-mega__cta .mt-cbtn b { font-size: 14.5px; }
.mt-mega__cta .mt-cbtn small { font-size: 11.5px; }
@media (max-width: 1180px) { .mt-mega__foot p { display: none; } .mt-mega__foot { justify-content: flex-end; } }

/* Menu mobile: danh mục sản phẩm dạng gập, mở ra lưới ô ảnh. */
.mt-mmenu__cats { margin-top: 26px; }
.mt-mmenu__cats-title { font-size: 12px; font-weight: 600; color: var(--mt-muted); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 6px; }
.mt-mcat { border-bottom: 1px solid var(--mt-line-soft); }
.mt-mcat summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 500; color: var(--mt-ink);
}
.mt-mcat summary::-webkit-details-marker { display: none; }
.mt-mcat summary > span:nth-child(2) { flex: 1; }
.mt-mcat summary > .mt-ico { width: 16px; height: 16px; color: var(--mt-faint); transition: transform .2s; }
.mt-mcat[open] summary > .mt-ico { transform: rotate(90deg); }
.mt-mcat__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; padding: 4px 0 18px; }
.mt-ui .mt-mcat__tile { display: flex; flex-direction: column; gap: 7px; text-align: center; color: var(--mt-ink); }
.mt-ui a.mt-mcat__tile:hover, .mt-ui a.mt-mcat__tile:active { text-decoration: none; }
.mt-ui .mt-mcat__tile .mt-mega__thumb {
  width: auto; height: auto; aspect-ratio: 5 / 4; display: grid; place-items: center;
  background: var(--mt-bg-alt); border-radius: 12px; overflow: hidden;
}
.mt-ui .mt-mcat__tile .mt-mega__thumb img { width: 68%; height: 68%; object-fit: contain; mix-blend-mode: multiply; }
.mt-ui a.mt-mcat__tile:active .mt-mega__thumb { background: #ececf0; }
.mt-mcat__tile .mt-mega__name { font-size: 12.5px; min-height: 2.6em; }
.mt-ui .mt-mcat__tile--all .mt-mega__thumb { background: var(--mt-blue-soft); }
.mt-ui .mt-mcat__tile--all { color: var(--mt-blue); }
.mt-mcat__tile--all .mt-ico { width: 22px; height: 22px; color: var(--mt-blue); }
@media (max-width: 359px) { .mt-mcat__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Nhãn số liệu của hero orbit (z-index 200) nổi đè lên flyout của thanh điều hướng (z 100): gói hero thành stacking context riêng. */
.mt-hero--orbit .mt-orbit { isolation: isolate; }

/* ===== Quy tắc dùng chung chuyển từ glue-shop.css (2026-11-19) =====
   glue-shop.css chỉ nạp ở trang WooCommerce, nhưng các class dưới đây có ở mọi trang:
   nút Gọi/Zalo (.mt-cbtn) trong menu mega và khung báo giá, thẻ sản phẩm ở trang chủ,
   phân trang blog/tác giả, nút "Đọc thêm", [hidden]. Đặt ở cuối file để giữ nguyên thứ tự cascade như trước. */
/* ---------- chung ---------- */
.mt-ui .screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Class WooCommerce (button, alt, add_to_cart_button, checkout-button) gắn thêm lên .mt-btn: bỏ style nút Flatsome. */
.mt-ui .mt-btn.button, .mt-ui a.mt-btn.add_to_cart_button {
  text-transform: none; margin: 0; max-width: none; text-shadow: none; box-shadow: none;
  width: auto; /* legacy.css: a.add_to_cart_button.ajax_add_to_cart { width: 100% } */
}
.mt-ui .mt-btn.added::after, .mt-ui .mt-btn.loading::after { display: none; }
.mt-ui .mt-btn.loading { opacity: .6; pointer-events: none; }
.mt-ui .added_to_cart { display: none; }
.mt-ui .mt-ask { font-weight: 600; color: var(--mt-ink); }
/* Phân trang (loop/pagination.php). */
.mt-ui .mt-pager { flex-wrap: wrap; }
.mt-ui .mt-pager .dots { color: var(--mt-muted); }
.mt-ui .mt-card .mt-muted { font-size: 14px; }
/* "Đọc thêm" / "Xem thêm N" là <button>: bỏ khung nút mặc định của Flatsome, giữ kiểu liên kết. */
.mt-ui button.mt-more {
  background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0;
  min-height: 0; line-height: 1.4; text-transform: none; letter-spacing: normal;
  font-weight: 400; color: var(--mt-link); cursor: pointer;
}
.mt-ui button.mt-more:hover, .mt-ui button.mt-more:focus { background: none; color: var(--mt-link); }
.mt-ui button.mt-more:focus-visible { outline: 2px solid var(--mt-blue); outline-offset: 3px; }
.mt-ui .mt-readmore { margin-top: 12px; }
@media (max-width: 734px) { .mt-ui button.mt-more, .mt-ui .mt-more--sm { min-height: 40px; } }
/* Thẻ sản phẩm: nút luôn thẳng hàng đáy dù giá cũ xuống dòng. */
/* Giá + nút luôn bám đáy thẻ, nên các thẻ cùng hàng thẳng giá dù thiếu dòng hãng/mã. */
.mt-ui .mt-pcard__price { margin-top: auto; padding-top: 12px; margin-bottom: 14px; }
.mt-ui .mt-pcard__actions { margin-top: auto; }
.mt-ui .mt-pcard__price ~ .mt-pcard__actions { margin-top: 0; }
.mt-ui .mt-results.is-list .mt-pcard__price { padding-top: 0; }
/* Ô lọc nhãn dài 2 dòng: giữ nguyên cỡ checkbox. */
.mt-ui .mt-check input { flex: none; }
/* ---- Logo hãng trên thẻ sản phẩm (mtee_pcard_brand_html, inc/brands.php). Hàng hãng cao cố định 24px
   để tên sản phẩm các thẻ cùng hàng thẳng nhau dù thẻ có logo hay chỉ có chữ. */
.mt-pcard__brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 24px; }
.mt-pcard__logo { display: block; flex: none; width: auto; height: var(--h, 16px); max-width: 60%; max-height: 24px; object-fit: contain; object-position: left center; }
.mt-pcard__brand.has-logo span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-left: 10px; border-left: 1px solid var(--mt-line-soft, #e5e5ea); line-height: 1.2; }
.mt-ui [hidden] { display: none !important; } /* .mt-more/.mt-tool đặt display, làm "Xem so sánh (0)" hiện dù có [hidden] */
.mt-ui .mt-cbtn {
  --c-fg: #00701a; --c-ic: #00891f; --c-bg: #ebf7ef; --c-bd: #bfe3ca; --c-hover: #dcf1e3;
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 16px;
  border-radius: var(--mt-r-sm); border: 1px solid var(--c-bd); background: var(--c-bg); color: var(--c-fg);
  text-decoration: none; transition: background .2s var(--mt-ease), border-color .2s var(--mt-ease), transform .2s var(--mt-ease);
}
.mt-ui .mt-cbtn--zalo { --c-fg: #0050c8; --c-ic: #0068ff; --c-bg: #ebf2ff; --c-bd: #c3d7fb; --c-hover: #dce8ff; }
.mt-ui .mt-cbtn:hover { background: var(--c-hover); border-color: var(--c-ic); text-decoration: none; }
.mt-ui .mt-cbtn:active { transform: scale(.98); }
.mt-ui .mt-cbtn:focus-visible { outline: 2px solid var(--c-ic); outline-offset: 2px; }
.mt-ui .mt-cbtn .mt-ico { width: 24px; height: 24px; color: var(--c-ic); stroke-width: 1.8; }
.mt-ui .mt-cbtn span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mt-ui .mt-cbtn b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.mt-ui .mt-cbtn small { font-size: 12.5px; color: var(--mt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) {
  .mt-ui .mt-cbtn { gap: 8px; padding: 8px 10px; }
  .mt-ui .mt-cbtn b { font-size: 14.5px; }
  .mt-ui .mt-cbtn small { font-size: 11.5px; }
}

/* Linh vật trên trang trống: mtee_mascot() (inc/elements.php) + initMascot() (mt.js).
   Ảnh tĩnh 360x520; video nền trong suốt phủ lên và hiện dần khi bắt đầu chạy. */
.mt-mascot { position: relative; isolation: isolate; width: var(--mascot-w, 200px); max-width: 100%; aspect-ratio: 360 / 520; margin: 0 auto; }
.mt-mascot img, .mt-mascot video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; transition: opacity .25s ease; }
/* Đổi clip: clip mới hiện lên trên, clip cũ mờ đi chậm hơn một nhịp để không lộ khoảng trống. */
.mt-mascot video { opacity: 0; transition: opacity .2s ease .12s; }
.mt-mascot video.is-on { z-index: 1; opacity: 1; transition-delay: 0s; }
.mt-mascot.is-playing img { opacity: 0; }
/* Clip "walk" ở đầu chuỗi: đi từ trái vào chỗ, quãng đi khớp bước chân của clip (2 bước / 2 giây). */
.mt-mascot.is-walk { opacity: 0; transform: translateX(var(--walk-from, -260px)); }
.mt-mascot.is-walking { animation: mt-mascot-walk 2.4s linear forwards; }
@keyframes mt-mascot-walk { 0% { opacity: 0; transform: translateX(var(--walk-from, -260px)); } 14% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.mt-mascot::after { content: ""; position: absolute; z-index: -1; left: 20%; right: 20%; bottom: -1%; height: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(19, 33, 58, .18), rgba(19, 33, 58, 0)); }
.mt-nf__mascot { --mascot-w: 180px; }
.mt-ui .mt-nf .mt-nf__mascot + .mt-nf__code { margin-top: 12px; }
.mt-bag-empty__mascot { --mascot-w: 170px; margin-bottom: 24px; }
.mt-order-card__mascot { --mascot-w: 140px; margin-bottom: 20px; }
.mt-nores { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 32px; align-items: center; }
.mt-nores .mt-mascot { --mascot-w: 132px; margin: 0; }
@media (max-width: 549px) {
  .mt-nf__mascot { --mascot-w: 140px; }
  .mt-bag-empty__mascot { --mascot-w: 132px; margin-bottom: 16px; }
  .mt-order-card__mascot { --mascot-w: 112px; }
  .mt-nores { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: start; }
  .mt-nores .mt-mascot { --mascot-w: 84px; }
}

/* Avatar linh vật (mtee_mascot_avatar) + linh vật trên đầu trang Liên hệ. */
.mt-avatar { flex: none; display: inline-block; width: var(--av, 40px); height: var(--av, 40px); border-radius: 50%; overflow: hidden; background: var(--mt-blue-soft); box-shadow: inset 0 0 0 1px rgba(8, 116, 188, .12); }
.mt-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mt-ui .mt-bag-help__h--av { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
.mt-contact__intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.mt-contact__mascot { --mascot-w: 150px; margin: 0 0 32px; }
@media (max-width: 849px) {
  .mt-contact__intro { gap: 12px; }
  .mt-contact__mascot { --mascot-w: 84px; margin-bottom: 24px; }
}
@media (max-width: 480px) {
  .mt-contact__mascot { --mascot-w: 64px; }
}

/* Báo giá gửi xong (linh vật cheer), avatar ở các ô hỏi kỹ sư, Tài khoản > Đơn hàng trống. */
.mt-qpage-wrap .mt-qfeedback { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.mt-qpage-wrap .mt-qfeedback .mt-qresult { flex: 1; margin-top: 0; }
.mt-qfeedback__art[hidden] { display: none; }
.mt-qfeedback__mascot { --mascot-w: 88px; margin: 0; }
.mt-qpage-wrap .mt-qaside__h--av { display: flex; align-items: center; gap: 10px; }
.mt-acct-empty { max-width: 520px; margin: 8px auto 0; text-align: center; }
.mt-acct-empty__mascot { --mascot-w: 140px; margin-bottom: 18px; }
.mt-ui .mt-acct-empty__h { margin: 0 0 6px; font-size: 19px; font-weight: 600; color: var(--mt-ink); }
.mt-acct-empty__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
@media (max-width: 549px) {
  .mt-qfeedback__mascot { --mascot-w: 64px; }
  .mt-acct-empty__mascot { --mascot-w: 112px; }
}
.mt-ui .mt-bag-help:not(.mt-bag-help--empty) .mt-bag-help__h--av { justify-content: flex-start; }

/* Trang chủ: linh vật trong dải "Dán danh sách mã" ([mt_b2b mascot]), đứng cạnh các bước, hướng về form. */
.mt-b2b__foot { display: flex; align-items: flex-end; gap: 20px; margin-top: 34px; }
.mt-b2b__foot .mt-steps { flex: 1; min-width: 0; margin-top: 0; }
.mt-b2b__mascot { --mascot-w: 150px; --walk-from: -180px; flex: none; margin: 0 -8px -12px 0; }
.mt-band--brand .mt-b2b__mascot::after { background: radial-gradient(closest-side, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0)); }
@media (max-width: 1068px) { .mt-b2b__mascot { --mascot-w: 120px; } }
@media (max-width: 549px) {
  .mt-b2b__foot { gap: 10px; }
  .mt-b2b__mascot { --mascot-w: 84px; --walk-from: -90px; margin: 0 -4px -6px 0; }
}

/* Huy hiệu ảnh ở footer (Đã thông báo Bộ Công Thương) */
.mt-footer__badges { align-items: center; flex-wrap: wrap; }
.mt-footer__badges span.is-img { height: auto; padding: 0; border: 0; background: none; border-radius: 0; }
.mt-footer__badges span.is-img a { padding-block: 0; margin-block: 0; line-height: 0; }
.mt-footer__badges span.is-img img { display: block; width: auto; height: 40px; }

/* Modal "Yêu cầu báo giá" (inc/quote-modal.php, assets/js/quote-modal.js): <dialog> mở từ mọi nút/link báo giá. */
.mt-qm {
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(92dvh, 860px); margin: auto; padding: 0;
  border: 0; border-radius: var(--mt-r-lg); background: #fff; color: var(--mt-ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .22); overflow: hidden;
}
.mt-qm[open] { display: flex; animation: mt-qm-in .22s var(--mt-ease); }
.mt-qm::backdrop { background: rgba(29, 29, 31, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes mt-qm-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.mt-qm__form { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0; }
.mt-qm__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--mt-line-soft); }
.mt-qm__title { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; color: var(--mt-ink); }
.mt-qm__sub { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--mt-muted); }
.mt-qm__x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--mt-bg-alt); color: var(--mt-muted); cursor: pointer; }
.mt-qm__x:hover { background: var(--mt-line-soft); color: var(--mt-ink); }
.mt-qm__x .mt-ico { width: 18px; height: 18px; }
.mt-qm__body { display: grid; gap: 16px; padding: 18px 24px 22px; overflow-y: auto; overscroll-behavior: contain; }
.mt-qm__prod { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--mt-r-sm); background: var(--mt-bg-alt); }
.mt-qm__prod .mt-ico { flex: none; width: 22px; height: 22px; color: var(--mt-brand); }
.mt-qm__prod span { display: grid; gap: 2px; min-width: 0; }
.mt-qm__prod b { font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.mt-qm__prod small { font-size: 13px; color: var(--mt-muted); }
.mt-qm .mt-field label { font-size: 14px; font-weight: 500; color: var(--mt-ink); margin: 0; }
.mt-qm .mt-field label small { font-weight: 400; color: var(--mt-faint); font-size: 12.5px; }
.mt-qm .mt-input, .mt-qm .mt-textarea { margin: 0; box-shadow: none; }
.mt-qm .mt-textarea { min-height: 0; }
.mt-qm__items { font-family: var(--mt-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 15px; }
.mt-qm__hint { font-size: 12.5px; color: var(--mt-faint); }
.mt-qm__grid { gap: 14px; }
.mt-qm .mt-field.is-invalid :is(.mt-input, .mt-textarea) { border-color: #d92d20; }
.mt-qm .mt-field__err { margin: 0; font-size: 13px; color: #b42318; }
.mt-qm__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mt-qm__status { margin: 0; padding: 12px 16px; border-radius: var(--mt-r-sm); font-size: 14.5px; line-height: 1.45; background: var(--mt-bg-alt); }
.mt-qm__status.is-ok { background: #e8f6ea; color: var(--mt-ok); }
.mt-qm__status.is-err { background: #fdecec; color: #b42318; }
.mt-qm__foot { display: grid; gap: 10px; }
.mt-qm__send { width: 100%; justify-content: center; margin: 0; }
.mt-qm__send[disabled] { opacity: .6; cursor: progress; }
.mt-qm__consent { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--mt-muted); text-align: center; }
.mt-qm__done { display: grid; justify-items: center; gap: 10px; padding: 32px 24px 28px; text-align: center; overflow-y: auto; outline: 0; }
.mt-qm__done h3 { margin: 6px 0 0; font-size: 21px; font-weight: 600; color: var(--mt-ink); }
.mt-qm__done p { margin: 0; font-size: 15px; color: var(--mt-muted); }
.mt-qm__ok { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e8f6ea; color: var(--mt-ok); }
.mt-qm__ok .mt-ico { width: 28px; height: 28px; }
.mt-qm__contact { width: 100%; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--mt-line-soft); }
.mt-qm__contact > p { font-size: 14px; margin-bottom: 10px; }
.mt-qm__cbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.mt-qm__cbtns .mt-cbtn small { white-space: normal; }
.mt-qm__done > .mt-btn { margin-top: 10px; min-width: 140px; justify-content: center; }
@media (max-width: 640px) {
  .mt-qm { width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: var(--mt-r-md) var(--mt-r-md) 0 0; }
  .mt-qm[open] { animation-name: mt-qm-up; }
  .mt-qm__head { padding: 18px 16px 12px; }
  .mt-qm__title { font-size: 20px; }
  .mt-qm__body { padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
  .mt-qm__done { padding: 26px 16px calc(24px + env(safe-area-inset-bottom)); }
  .mt-qm__cbtns { grid-template-columns: 1fr; }
}
@keyframes mt-qm-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mt-qm[open] { animation: none; } }

/* Popup khuyến mãi (inc/promo-popup.php, assets/js/promo-popup.js): <dialog> hiện sau vài giây hoặc khi cuộn. */
.mt-promo {
  width: min(460px, calc(100vw - 32px)); max-width: none; max-height: min(92dvh, 760px); margin: auto; padding: 0;
  border: 0; border-radius: var(--mt-r-lg); background: #fff; color: var(--mt-ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .22); overflow: hidden;
}
.mt-promo[open] { display: flex; animation: mt-promo-in .24s var(--mt-ease); }
.mt-promo::backdrop { background: rgba(29, 29, 31, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@keyframes mt-promo-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.mt-promo__box { position: relative; display: flex; flex-direction: column; width: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mt-promo__x { position: absolute; top: 10px; right: 10px; z-index: 2; flex: none; display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--mt-ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .14); cursor: pointer; }
.mt-promo__x:hover { background: #fff; }
.mt-promo__x .mt-ico { width: 18px; height: 18px; }
.mt-promo__media { flex: none; margin: 0; background: var(--mt-bg-alt); }
.mt-promo__img { display: block; width: 100%; height: auto; }
.mt-promo__imglink { display: block; }
/* Popup chỉ có ảnh (không điền ô chữ nào): khung co theo ảnh, ảnh giữ nguyên tỉ lệ, chỉ hạ cỡ cho vừa màn hình. */
.mt-promo--img { width: fit-content; max-width: min(460px, calc(100vw - 32px)); }
.mt-promo--img .mt-promo__media, .mt-promo--img .mt-promo__imglink { display: flex; }
.mt-promo--img .mt-promo__img { width: auto; max-width: 100%; max-height: min(86dvh, 720px); }
.mt-promo__txt { display: grid; gap: 12px; padding: 22px 24px 24px; text-align: center; }
.mt-promo__title { margin: 0; font-size: 23px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; color: var(--mt-ink); }
.mt-promo__sub { font-size: 15px; line-height: 1.55; color: var(--mt-muted); }
.mt-promo__sub p { margin: 0 0 8px; }
.mt-promo__sub p:last-child { margin-bottom: 0; }
.mt-promo__cta { width: 100%; justify-content: center; margin: 2px 0 0; }
.mt-promo__note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--mt-faint); }
.mt-promo__skip { margin: 0; padding: 4px 0 0; border: 0; background: none; font-size: 13.5px; font-weight: 500; color: var(--mt-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mt-promo__skip:hover { color: var(--mt-ink); }
@media (max-width: 640px) {
  .mt-promo { width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: var(--mt-r-md) var(--mt-r-md) 0 0; }
  .mt-promo[open] { animation-name: mt-promo-up; }
  /* Popup chỉ có ảnh: trên điện thoại cũng là thẻ giữa màn hình, không phải khay dưới, để ảnh không bị kéo rộng. */
  .mt-promo--img { width: fit-content; max-width: calc(100vw - 24px); margin: auto; border-radius: var(--mt-r-md); }
  .mt-promo--img .mt-promo__img { max-height: 82dvh; }
  .mt-promo__txt { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .mt-promo__title { font-size: 21px; }
}
@keyframes mt-promo-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mt-promo[open] { animation: none; } }
/* Hero xoay có từ 7 sản phẩm: dưới 980px thanh tab không còn vừa một hàng, đổi sang bộ đếm "01 / 08" như trên điện thoại */
@media (max-width: 980px) {
  .mt-hero__nav:has(> .mt-hero__tabs > :nth-child(7)) .mt-hero__tabs { display: none; }
  .mt-hero__nav:has(> .mt-hero__tabs > :nth-child(7)) .mt-hero__count { display: block; }
}
/* Thẻ bài viết (/post/, tác giả, bài liên quan…): khung theo tỉ lệ ảnh đại diện bài (1200×630, 768×403 ≈ 1.905:1) thay vì 16:9 nên không còn cắt hai bên;
   ảnh lệch tỉ lệ (vuông…) hiện trọn trên nền xám nhạt thay vì bị cắt. Trang chủ giữ khung 4:3 cắt ảnh như cũ (glue-home.css). */
.mt-acard__img { aspect-ratio: 1.905 / 1; }
.mt-acard__img img { object-fit: contain; }
.mt-acard__img img.mt-img-fallback,
body.home .mt-grid--3 > .mt-acard .mt-acard__img img { object-fit: cover; }
.mt-acard--feature .mt-acard__img { aspect-ratio: 1.905 / 1; min-height: 0; align-self: center; }
