/* THANH CHÍNH — MEGA MENU (04/11/2026 — web/js/nav.js). Màu chỉ qua token (--c-*); khổ ≤ 900px là ngăn kéo nhóm đóng / mở. */
.mm { display: flex; min-width: 0; }
.mm-bar { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.mm-li { position: static; }
.mm-top { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border: 0; border-radius: var(--radius-s); background: transparent; color: #d6e6e4; font: inherit; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .12s, color .12s; }
.mm-top:hover, .mm-li.open > .mm-top { background: rgba(255,255,255,.09); color: #fff; }
.mm-top.on { background: rgba(255,255,255,.15); color: #fff; }
.mm-top:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.mm-chev { display: inline-grid; transform: rotate(90deg); opacity: .75; transition: transform .15s; }
.mm-li.open > .mm-top .mm-chev { transform: rotate(-90deg); }

/* số đếm */
.mm-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-warn-bg); color: var(--c-warn); font-size: 11px; font-weight: 700; line-height: 1; }
.mm-n[hidden] { display: none; }
.mm-gn { background: #f5c26b; color: var(--c-primary-3); }
.mm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bảng thả xuống (máy tính): cố định ngay dưới thanh trên, vị trí trái do nav.js tính */
.mm-panel { position: fixed; z-index: 45; width: max-content; max-width: calc(100vw - 24px); max-height: calc(100vh - 72px); overflow: auto; background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); border-radius: 0 0 14px 14px; box-shadow: 0 24px 48px rgba(10,38,41,.22); padding: 14px 16px 16px; animation: mm-in .14s ease-out; }
.mm-panel[hidden] { display: none; }
@keyframes mm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mm-panel { animation: none; } .mm-chev { transition: none; } }
.mm-lead { margin: 0 0 10px; padding: 0 8px 10px; border-bottom: 1px solid var(--c-soft); color: var(--c-muted); font-size: 12.5px; max-width: 64ch; }
.mm-cols { display: grid; grid-template-columns: repeat(var(--mm-n, 1), minmax(220px, 262px)); gap: 10px 12px; }
.mm-panel.c2 { --mm-n: 2; } .mm-panel.c3 { --mm-n: 3; } .mm-panel.c4 { --mm-n: 4; }
@media (max-width: 1180px) { .mm-panel.c3, .mm-panel.c4 { --mm-n: 2; } }
.mm-col { min-width: 0; }
.mm-h { margin: 2px 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.mm-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mm-i { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--c-text); text-decoration: none; }
.mm-i:hover { background: var(--c-soft); }
.mm-i:focus-visible { outline: 2px solid var(--c-primary-2); outline-offset: -2px; background: var(--c-soft); }
.mm-i.on { background: var(--c-info-bg); }
.mm-i.on .mm-t b { color: var(--c-primary); }
.mm-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--c-info-bg); color: var(--c-primary-2); }
.mm-i.on .mm-ic { background: var(--c-primary); color: #fff; }
.mm-t { display: grid; min-width: 0; }
.mm-t b { font-weight: 600; font-size: 14px; }
.mm-t small { color: var(--c-muted); font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-foot { display: flex; justify-content: flex-end; margin-top: 10px; padding: 10px 8px 0; border-top: 1px solid var(--c-soft); }
.mm-foot .btn { text-decoration: none; }
.mm-foot .btn.small { height: 32px; padding: 0 12px; font-size: 13px; }

/* 901–1180px: bỏ icon mục cấp 1 để vừa thanh */
@media (min-width: 901px) and (max-width: 1180px) { .mm-top > .ic { display: none; } .mm-top { padding: 0 9px; } }

/* nút ☰ */
.top .nav-toggle { display: none; color: #fff; }
.top .nav-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ≤ 900px: NGĂN KÉO — nhóm đóng / mở, bảng nằm trong dòng */
@media (max-width: 900px) {
  .top .nav-toggle { display: inline-grid; }
  .mm { display: none; }
  .top.mm-open .mm { display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 44; overflow-y: auto; overscroll-behavior: contain; background: var(--c-primary); padding: 8px 12px calc(24px + env(safe-area-inset-bottom)); box-shadow: 0 12px 24px rgba(0,0,0,.25); }
  html.mm-lock, html.mm-lock body { overflow: hidden; }
  .mm-bar { flex-direction: column; gap: 2px; }
  .mm-top { width: 100%; height: 48px; padding: 0 12px; font-size: 15px; }
  .mm-top .mm-l { flex: 1; text-align: left; }
  .mm-panel { position: static; width: auto; max-width: none; max-height: none; overflow: visible; margin: 2px 0 8px; padding: 6px; border-radius: 12px; box-shadow: none; animation: none; }
  .mm-lead { display: none; }
  .mm-cols { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mm-h { margin: 8px 8px 4px; }
  .mm-i { min-height: 48px; grid-template-columns: 32px minmax(0, 1fr) auto; }
  .mm-ic { width: 32px; height: 32px; }
  .mm-foot { justify-content: stretch; margin-top: 6px; padding: 8px 2px 2px; }
  .mm-foot .btn { flex: 1; justify-content: center; height: 40px; }
}

/* 901–1180px: nút HPR Helper chỉ còn chấm (chữ trong title / aria-label) để thanh không chồng */
@media (min-width: 901px) and (max-width: 1180px) { .top .pill-t { display: none; } .top .pill { width: 28px; padding: 0; justify-content: center; } }
