/* ==========================================================================
   MTEE glue: trang chủ và các khối UX Builder dùng trên trang chủ.
   Nạp sau mt.css trên mọi trang (inc/setup.php), nên quy tắc riêng trang chủ
   gắn body.home; quy tắc theo component (.mt-marquee, .mt-qbox) chỉ chạm
   đúng component đó.
   ========================================================================== */

/* ---- Khối [mt_band] ("Mạnh Tùng trong con số"): khoảng cách tiêu đề / số liệu / thẻ cam kết */
.mt-band > .mt-band__body { padding-bottom: 96px; }
.mt-band__body > .mt-stats { margin-top: 40px; }
.mt-band__body > .mt-trust { margin-top: 64px; }

/* Số liệu: nhỏ lại một chút để "12–24 tháng", "13.500+" không bị cắt chữ
   (mt.css để white-space:nowrap trong cột 1/4). */
.mt-band__body .mt-stat__num { font-size: clamp(30px, calc(5.8cqi - 12px), 76px); }
.mt-band__body .mt-stat__num small { font-size: .36em; margin-left: 4px; }

@media (max-width: 834px) {
  .mt-band > .mt-band__body { padding-bottom: 64px; }
  .mt-band__body > .mt-stats { margin-top: 28px; }
  .mt-band__body > .mt-trust { margin-top: 40px; }
  .mt-band__body .mt-stat__num { font-size: clamp(32px, calc(11cqi - 8px), 72px); }
  .mt-band__body .mt-stat__num small { font-size: .42em; margin-left: 3px; }
  /* Cột trái của hàng 2: mt.css @734 (.mt-stat + .mt-stat) đè mất padding-left:0 */
  .mt-band__body > .mt-stats > .mt-stat:nth-child(odd) { padding-left: 0; border-left: 0; }
}

@media (max-width: 374px) {
  .mt-band__body .mt-stat__num { font-size: 25px; letter-spacing: -.02em; }
  .mt-band__body .mt-stat__num small { margin-left: 2px; }
}

/* ---- Dải thương hiệu khi người dùng bật "giảm chuyển động":
   mt.js không nhân bản logo nữa; dải cuộn ngang thay vì xếp nhiều hàng. */
@media (prefers-reduced-motion: reduce) {
  .mt-marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .mt-marquee::-webkit-scrollbar { display: none; }
  .mt-marquee .mt-marquee__track { flex-wrap: nowrap; width: max-content; padding-inline: var(--mt-gutter, 22px); }
  .mt-marquee__item[aria-hidden="true"] { display: none; }
}

/* ---- Logo hãng trong dải thương hiệu (inc/brands.php). Ảnh có sẵn --h (chiều cao theo thị giác);
   logo và tên chữ (hãng chưa có logo) cùng nằm trong một hàng cao 46px để dòng "N mã" thẳng hàng. */
.mt-marquee__item { --k: 1; --row: calc(46px * var(--k)); gap: 8px; }
.mt-marquee__item > b { display: flex; align-items: center; min-height: var(--row); max-width: 250px; }
.mt-marquee__logo {
  display: block; flex: none; align-self: flex-start; width: auto; max-width: 100%; height: calc(var(--h, 32px) * var(--k));
  margin-block: calc((var(--row) - var(--h, 32px) * var(--k)) / 2); object-fit: contain; object-position: left center;
}
@media (max-width: 734px) {
  .mt-marquee__item { --k: .82; }
}

/* ---- Khung báo giá trong dải nền xanh: link nằm trên nền trắng nên dùng màu link
   chuẩn (mt.css tô #7cc4ff cho mọi .mt-more trong .mt-band--brand, tương phản 1.9:1). */
.mt-band .mt-qbox .mt-more { color: var(--mt-link); }
.mt-qbox__head, .mt-qbox__meta { flex-wrap: wrap; gap: 4px 12px; }
/* Gọi/Zalo dưới nút gửi: cặp nút .mt-cbtn (cuối glue.css) thay cho 2 link chữ nhỏ. */
.mt-qbox__alt { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; justify-content: stretch; }
/* "1fr" cũ nở theo chữ nowrap của <small> → nút Zalo tràn khỏi khung ở 375px; ô ~148px nên cho dòng phụ xuống dòng thay vì cắt "…". */
.mt-qbox__alt .mt-cbtn small { white-space: normal; }

/* ---- Bài viết kỹ thuật trên điện thoại: một cột, ảnh nhỏ bên trái (2 cột quá hẹp) */
@media (max-width: 734px) {
  body.home .mt-grid--3:has(> .mt-acard) { grid-template-columns: 1fr; gap: 22px; }
  body.home .mt-grid--3 > .mt-acard { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 14px; align-items: start; }
  body.home .mt-grid--3 > .mt-acard .mt-acard__img { aspect-ratio: 4 / 3; border-radius: var(--mt-r-sm, 12px); }
  body.home .mt-grid--3 > .mt-acard .mt-acard__body { padding: 0; }
  body.home .mt-grid--3 > .mt-acard h3 { margin-top: 4px; font-size: 17px; line-height: 1.28; }
  body.home .mt-grid--3 > .mt-acard p { font-size: 14px; margin-top: 4px; }
  body.home .mt-grid--3 > .mt-acard time { margin-top: 6px; font-size: 12px; }
}

/* Máy tính bảng dọc (735–834): mt.css chuyển 3 bài thành 2 cột, bài thứ 3 nằm lẻ một hàng.
   Giữ 3 cột, chữ nhỏ lại một chút. */
@media (min-width: 735px) and (max-width: 834px) {
  body.home .mt-grid--3:has(> .mt-acard) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; }
  body.home .mt-grid--3 > .mt-acard h3 { font-size: 17px; line-height: 1.28; }
  body.home .mt-grid--3 > .mt-acard p { font-size: 14px; }
}

/* ---- [mt_hero] nhiều sản phẩm: vòng quỹ đạo xoay (inc/elements.php mtee_hero_orbit, assets/js/home.js)
   Vị trí từng sản phẩm do biến CSS: --x (-1..1 ngang), --k (0 trước .. 2 sau), --s (tỉ lệ), --o (độ đậm). */
.mt-hero--orbit { --rx: 40%; --ry: clamp(24px, 3.8vw, 52px); --w: 36%; --h: clamp(270px, 29vw, 410px); --mt-dur: 7s; padding-bottom: 8px; }
.mt-hero__panes { display: grid; }
.mt-hero__pane { grid-area: 1 / 1; transition: opacity .45s var(--mt-ease), transform .45s var(--mt-ease), visibility 0s linear .45s; }
.mt-hero__pane:not(.is-active) { opacity: 0; transform: translateY(10px); visibility: hidden; pointer-events: none; }
.mt-hero__pane.is-active { transition-delay: .12s, .12s, 0s; }

.mt-orbit { position: relative; height: var(--h); margin: 0 auto; max-width: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.mt-orbit.is-drag { cursor: grabbing; }
.mt-orbit__ring { position: absolute; left: calc(50% - var(--rx)); right: calc(50% - var(--rx)); bottom: 0; height: calc(var(--ry) * 2); border-radius: 50%; border: 1px solid rgba(10, 110, 209, .16); background: radial-gradient(closest-side, rgba(10, 110, 209, .07), rgba(10, 110, 209, 0)); pointer-events: none; }
.mt-orbit__ring::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--mt-blue); box-shadow: 0 0 0 4px rgba(10, 110, 209, .14); }
.mt-orbit .mt-hero__glow { bottom: -26%; }
.mt-orbit__item { position: absolute; left: calc(50% + var(--x) * var(--rx)); bottom: calc(var(--k) * var(--ry)); width: min(var(--w), var(--h) * .96); aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; opacity: var(--o); filter: blur(calc((1 - var(--o)) * 2.4px)); mix-blend-mode: multiply; transform: translateX(-50%) scale(var(--s)); transform-origin: 50% 100%; will-change: transform, left, bottom; -webkit-tap-highlight-color: transparent; }
.mt-orbit__item::before { content: ""; position: absolute; left: 18%; right: 18%; bottom: -2%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .14), rgba(0, 0, 0, 0)); }
.mt-orbit__item img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none; -webkit-user-drag: none; }
.mt-orbit__item.is-front { cursor: default; }
.mt-orbit:not(.is-moving) .mt-orbit__item:not(.is-front):hover { filter: drop-shadow(0 6px 14px rgba(10, 110, 209, .18)); }

/* Thông số nổi quanh sản phẩm đang xem */
.mt-orbit__chips { position: absolute; inset: 0; z-index: 300; pointer-events: none; }
.mt-orbit__chip { position: absolute; display: flex; flex-direction: column; gap: 1px; max-width: 220px; padding: 9px 14px 10px; border-radius: 14px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); border: 1px solid var(--mt-line-soft); box-shadow: 0 6px 22px rgba(0, 0, 0, .07); text-align: left; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .35s var(--mt-ease), transform .35s var(--mt-ease); }
.mt-orbit__chip small { font-size: 12px; line-height: 1.3; color: var(--mt-muted); }
.mt-orbit__chip b { font-size: 16px; line-height: 1.25; font-weight: 600; color: var(--mt-ink); letter-spacing: -.01em; }
.mt-orbit { --fw: min(var(--w), var(--h) * .96); }
.mt-orbit__chip--1 { right: calc(50% + var(--fw) * .30); top: 12%; }
.mt-orbit__chip--2 { left: calc(50% + var(--fw) * .32); top: 34%; }
.mt-orbit__chip--3 { right: calc(50% + var(--fw) * .34); top: 60%; }
.mt-orbit__chips.is-active .mt-orbit__chip { opacity: 1; transform: none; transition-delay: .05s; }
.mt-orbit__chips.is-active .mt-orbit__chip--2 { transition-delay: .12s; }
.mt-orbit__chips.is-active .mt-orbit__chip--3 { transition-delay: .19s; }
.mt-orbit.is-moving .mt-orbit__chip { opacity: 0; transform: translateY(6px) scale(.96); transition-delay: 0s; transition-duration: .15s; }

/* Thanh chọn: mũi tên, tên sản phẩm (vạch chạy theo thời gian tự xoay), số thứ tự, tạm dừng */
.mt-hero__nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.mt-hero__arrow, .mt-hero__pause { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--mt-line); background: #fff; color: var(--mt-ink); cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.mt-hero__arrow:hover, .mt-hero__pause:hover { border-color: var(--mt-blue); color: var(--mt-blue); }
.mt-hero__arrow .mt-ico, .mt-hero__pause .mt-ico { width: 18px; height: 18px; }
.mt-hero__pause { border-color: transparent; background: var(--mt-bg-alt); }
.mt-hero__pause[hidden], .mt-hero__iplay, .mt-hero__pause[aria-pressed="true"] .mt-hero__ipause { display: none; }
.mt-hero__pause[aria-pressed="true"] .mt-hero__iplay { display: block; }
.mt-hero__tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--mt-pill); background: var(--mt-bg-alt); }
.mt-hero__tab { position: relative; display: block; padding: 8px 16px 10px; border: 0; border-radius: var(--mt-pill); background: none; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--mt-muted); white-space: nowrap; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.mt-hero__tab:hover { color: var(--mt-ink); }
.mt-hero__tab.is-active { background: #fff; color: var(--mt-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.mt-hero__bar { position: absolute; left: 16px; right: 16px; bottom: 5px; height: 2px; border-radius: 2px; overflow: hidden; background: transparent; }
.mt-hero__tab.is-active .mt-hero__bar { background: var(--mt-line-soft); }
.mt-hero__bar i { display: block; height: 100%; width: 100%; background: var(--mt-blue); transform: scaleX(0); transform-origin: 0 50%; }
.mt-hero__timer { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.mt-hero--orbit.is-ready:not([data-orbit-manual]) :is(.mt-hero__tab.is-active .mt-hero__bar i, .mt-hero__timer) { animation: mt-orbit-fill var(--mt-dur) linear forwards; }
/* Tạm dừng: nút tạm dừng, rời màn hình, tab ẩn, rê chuột lên sân khấu/thanh chọn, focus bàn phím trong hero */
.mt-hero--orbit:is(.is-paused, .is-off, .is-hidden, :has(.mt-orbit:hover, .mt-hero__nav:hover, :focus-visible)) :is(.mt-hero__tab.is-active .mt-hero__bar i, .mt-hero__timer) { animation-play-state: paused; }
.mt-hero--orbit { position: relative; }
@keyframes mt-orbit-fill { to { transform: scaleX(1); } }
.mt-hero__count { display: none; font-size: 14px; color: var(--mt-muted); font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.mt-hero__count b { color: var(--mt-ink); font-weight: 600; }

@media (max-width: 1068px) {
  .mt-hero--orbit { --w: 40%; --rx: 42%; }
  .mt-orbit__chip { max-width: 180px; padding: 8px 12px 9px; }
  .mt-orbit__chip b { font-size: 15px; }
}
@media (max-width: 900px) {
  .mt-hero__nav { gap: 6px; }
  .mt-hero__tab { padding: 8px 11px 10px; font-size: 13px; }
  .mt-hero__bar { left: 11px; right: 11px; }
}
@media (max-width: 734px) {
  .mt-hero--orbit { --w: 62%; --rx: 46%; --ry: 22px; --h: 270px; }
  .mt-orbit { margin-top: 16px; }
  /* Điện thoại: thông số xếp thành hàng dưới sản phẩm, không che ảnh */
  .mt-orbit__chips { inset: auto 0 -58px; display: flex; justify-content: center; gap: 6px; padding: 0 var(--mt-gutter); }
  .mt-orbit__chip { position: static; max-width: none; min-width: 0; flex: 0 1 auto; padding: 6px 10px 7px; border-radius: 12px; box-shadow: none; background: var(--mt-bg-alt); border-color: transparent; }
  .mt-orbit__chip small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mt-orbit__chip b { font-size: 13px; white-space: nowrap; }
  .mt-hero--orbit .mt-hero__nav { margin-top: 82px; }
  .mt-hero__tabs { display: none; }
  .mt-hero__count { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .mt-hero__pane, .mt-orbit__chip { transition: none !important; }
}

/* ---------- [mt_text]: đoạn văn hai cột (inc/elements.php) ---------- */
.mt-textsec { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.mt-textsec__head { position: sticky; top: calc(var(--mt-nav-h) + 30px); }
.mt-textsec__head .mt-eyebrow { margin-bottom: 10px; }
.mt-textsec__body { font-size: 19px; line-height: 1.6; color: var(--mt-text); max-width: 680px; }
.mt-textsec__body > * { margin: 0; }
.mt-textsec__body > * + * { margin-top: 1.1em; }
.mt-textsec__body :is(strong, b) { color: var(--mt-ink); font-weight: 600; }
.mt-textsec__body a { color: var(--mt-blue); }
.mt-textsec__body ul { padding-left: 1.2em; }
.mt-textsec__body li + li { margin-top: .4em; }
@media (max-width: 1068px) { .mt-textsec { gap: 40px; } }
@media (max-width: 734px) {
  .mt-textsec { grid-template-columns: 1fr; gap: 18px; }
  .mt-textsec__head { position: static; }
  .mt-textsec__body { font-size: 17px; }
}
