/* =========================================================
   Effects layer — nav/mobile menu, hiệu ứng cuộn, thẻ, nút,
   hero động, marquee, bento, toast, view transitions, dark mode.
   Nạp SAU pages.css. Mọi màu lấy từ token để từng site
   (css/sites/<domain>.css) tự đổi theo màu thương hiệu riêng.
   Hành vi JS tương ứng nằm trong js/app.js (mục "EFFECTS").
   ========================================================= */

/* ===== ICON ===== */
.ic { flex: none; display: block; }

/* ===== NAV ===== */
.nav { transition: box-shadow 250ms var(--ease-out), background 250ms var(--ease-out); view-transition-name: site-nav; }
.nav-in { transition: height 250ms var(--ease-out); }
.nav.scrolled { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08); }
.nav.scrolled .nav-in { height: 58px; }
/* Khoảng cách gọn để 6 mục menu + icon vừa khung 1240px; màn hẹp hơn bỏ icon. */
.nav-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.nav-links { position: relative; gap: 0; }
.nav-links a { display: inline-flex; align-items: center; gap: 5px; padding: 8px 7px; border-radius: 10px; white-space: nowrap; }
@media (max-width: 1300px) {
  .nav-links a .ic { display: none; }
}
.nav-links a .ic { opacity: 0.7; transition: opacity 150ms, transform 250ms var(--ease-spring); }
.nav-links a:hover .ic, .nav-links a.active .ic { opacity: 1; transform: translateY(-1px) scale(1.08); }
.nav-links a:hover { background: var(--brand-a08); }
/* Gạch chân trượt theo mục đang hover/đang chọn — vị trí do JS đặt. */
.nav-ind { position: absolute; left: 0; bottom: -2px; height: 2.5px; width: 0; border-radius: 2px; background: var(--brand-500); opacity: 0; transition: transform 350ms var(--ease-out), width 350ms var(--ease-out), opacity 200ms; pointer-events: none; }
.nav-ind.on { opacity: 1; }

.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--fg-1); transition: background 180ms, color 180ms, transform 180ms var(--ease-spring); }
.icon-btn:hover { background: var(--brand-a08); color: var(--brand-700); }
.icon-btn:active { transform: scale(0.92); }
.cart-badge { position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-orange); color: #fff; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg-1); }
.cart-badge[hidden] { display: none; }
.cart-badge.bump { animation: badgeBump 600ms var(--ease-spring); }
@keyframes badgeBump { 0% { transform: scale(1); } 30% { transform: scale(1.5); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
.cart-link.shake .ic { animation: cartShake 500ms var(--ease-out); }
@keyframes cartShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } }

/* Theme toggle: hiện mặt trăng ở chế độ sáng, mặt trời ở chế độ tối. */
.theme-toggle .ic { transition: transform 450ms var(--ease-spring), opacity 250ms; }
.theme-toggle .ic + .ic { position: absolute; }
.theme-toggle .ic:last-child { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .ic:first-child { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="dark"] .theme-toggle .ic:last-child { opacity: 1; transform: none; }

.nav-burger { display: none; }

/* Thanh tiến độ đọc ở mép trên */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--brand-400), var(--brand-600), var(--accent-yellow)); pointer-events: none; }

/* ===== MOBILE DRAWER ===== */
.m-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: opacity 300ms var(--ease-out), visibility 300ms; }
.m-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 71; width: min(86vw, 360px); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; padding: 18px 20px 24px; transform: translateX(105%); transition: transform 420ms var(--ease-out); visibility: hidden; }
.m-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.m-links { display: flex; flex-direction: column; gap: 4px; }
.m-links a { display: flex; align-items: center; gap: 14px; padding: 14px 12px; border-radius: 12px; font-weight: 600; font-size: 16px; color: var(--fg-1); opacity: 0; transform: translateX(24px); transition: opacity 350ms var(--ease-out), transform 450ms var(--ease-out), background 150ms; transition-delay: calc(var(--i, 0) * 45ms + 80ms); }
.m-links a .ic { color: var(--brand-600); }
.m-links a:hover, .m-links a.active { background: var(--brand-a08); color: var(--brand-700); }
.m-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.m-foot .btn { justify-content: center; }
body.nav-open { overflow: hidden; }
body.nav-open .m-overlay { opacity: 1; visibility: visible; }
body.nav-open .m-drawer { transform: none; visibility: visible; }
body.nav-open .m-links a { opacity: 1; transform: none; }
body.nav-open .tweaks-toggle, body.nav-open .to-top { visibility: hidden; }

.logo-row { flex-shrink: 0; }
/* Dưới 1120px không đủ chỗ cho 6 mục menu + nút: chuyển sang menu ☰. */
@media (max-width: 1120px) {
  .nav-links, .nav-desk { display: none !important; }
  .nav-burger { display: inline-flex; }
  .nav-cta { gap: 2px; }
}

/* ===== REVEAL ON SCROLL =====
   Chỉ ẩn khi có JS (html.js). Dùng animation + thuộc tính `translate`
   (tách khỏi `transform`) để không đè hiệu ứng hover/tilt của thẻ. */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].in { animation: revealUp 800ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes revealUp { from { opacity: 0; translate: 0 28px; } to { opacity: 1; translate: 0 0; } }

/* ===== BUTTONS: shine + ripple + glass ===== */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn.shine::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: skewX(-20deg); pointer-events: none; z-index: -1; animation: shineIdle 6s ease-in-out 2s infinite; }
.btn.shine:hover::after { animation: shineSweep 750ms var(--ease-out); }
@keyframes shineSweep { from { left: -60%; } to { left: 130%; } }
@keyframes shineIdle { 0%, 82% { left: -60%; } 100% { left: 130%; } }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: 0.28; transform: scale(0); animation: ripple 650ms var(--ease-out) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn.glass { background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.25); backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(255, 255, 255, 0.22); }
.btn.sm { padding: 8px 14px; font-size: 13.5px; }

/* ===== HERO: aurora + ô bảng tính + chữ đổi luân phiên ===== */
.hero { isolation: isolate; }
.aurora { position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none; filter: blur(70px); opacity: 0.55; }
.aurora i { position: absolute; border-radius: 50%; }
.aurora i:nth-child(1) { width: 520px; height: 420px; left: 2%; top: 4%; background: var(--brand-400); animation: drift1 18s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 460px; height: 380px; right: 6%; top: 0; background: var(--accent-yellow); opacity: 0.7; animation: drift2 22s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 380px; height: 340px; left: 40%; top: 38%; background: var(--accent-violet); opacity: 0.35; animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(120px, 60px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-140px, 80px) scale(0.9); } }
@keyframes drift3 { to { transform: translate(-60px, -70px) scale(1.2); } }
.hero .grid-bg { z-index: 0; }
.hero-in { z-index: 1; }

.hero-cells { position: absolute; inset: 0; pointer-events: none; z-index: 0; mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%); }
.hero-cells i { position: absolute; width: 44px; height: 44px; background: var(--brand-a12); box-shadow: inset 0 0 0 2px var(--brand-500); opacity: 0; animation: cellBlink 4.2s ease-in-out infinite; }
.hero-cells i.y { background: color-mix(in srgb, var(--accent-yellow) 35%, transparent); box-shadow: inset 0 0 0 2px var(--accent-yellow); }
@keyframes cellBlink { 0%, 100% { opacity: 0; } 25%, 60% { opacity: 1; } }

.rotator { display: inline-block; background: linear-gradient(180deg, var(--brand-500) 0%, var(--brand-700) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; transition: opacity 320ms var(--ease-out), translate 420ms var(--ease-out), filter 320ms; }
.rotator.out { opacity: 0; translate: 0 -0.4em; filter: blur(4px); }
.rotator.pre { opacity: 0; translate: 0 0.4em; filter: blur(4px); transition: none; }

/* Parallax: JS dịch perspective-origin theo chuột → khối 3D nghiêng theo góc nhìn. */
.cube-stage { transition: perspective-origin 600ms var(--ease-out), translate 600ms var(--ease-out); }

/* ===== STATS ===== */
.stats { padding: 36px 0; }
/* Số cột = số ô số liệu thực có (index.php đặt --cols); mobile vẫn 2 cột theo app.css. */
@media (min-width: 901px) { .stats-in { grid-template-columns: repeat(var(--cols, 4), 1fr); } }
.stats .n { padding-bottom: 0.12em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--brand-500), var(--brand-700)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===== CARDS: vệt sáng theo chuột + viền gradient + nghiêng 3D ===== */
.prod-wrap { position: relative; display: flex; flex-direction: column; }
.prod-wrap > .prod { flex: 1; }
.prod, .cat, .post { position: relative; }
.prod::after, .cat::after, .post::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), var(--brand-a12), transparent 65%);
  opacity: 0; transition: opacity 300ms;
}
.prod::before, .post::before {
  content: ""; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit; pointer-events: none; z-index: 4;
  background: linear-gradient(135deg, var(--brand-400), var(--accent-yellow) 50%, var(--brand-600));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity 300ms;
}
.prod:hover::after, .cat:hover::after, .post:hover::after,
.prod:hover::before, .post:hover::before { opacity: 1; }
.prod:hover, .post:hover { box-shadow: var(--shadow-lg); border-color: transparent; }
[data-tilt]:hover { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); }

.prod .thumb.has-img { background: var(--surface); }
.prod .thumb img, .post .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.prod:hover .thumb img, .post:hover .cover img { transform: scale(1.07); }
.post .cover { overflow: hidden; }
.prod .thumb .ph { transition: transform 700ms var(--ease-out); }
.prod:hover .thumb .ph { transform: scale(1.04) rotate(-1deg); }
.prod .thumb .ph .lbl { color: var(--brand-700); }
.prod .thumb .ph-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; flex: 1; }
.prod .thumb .ph-cells i { background: #F1F5F9; border-radius: 2px; }
.prod .thumb .ph-cells i.y { background: #FEF9C3; }
.prod .thumb .ph-cells i.g { background: #DCFCE7; }
.prod .thumb .flag { z-index: 3; }
.prod .thumb .flag.flash { background: #DC2626; animation: flashPulse 1.6s ease-in-out infinite; }
@keyframes flashPulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); transform: scale(1.04); } 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); } }
.prod .oos { position: absolute; inset: 0; z-index: 3; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; }
.prod-cta { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; padding: 10px; border-radius: 10px; text-align: center; font-size: 13.5px; font-weight: 700; color: #fff; background: color-mix(in srgb, var(--brand-600) 88%, transparent); backdrop-filter: blur(6px); translate: 0 160%; transition: translate 380ms var(--ease-out); }
.prod:hover .prod-cta, .prod:focus-visible .prod-cta { translate: 0 0; }
@media (hover: none) { .prod-cta { display: none; } }

.cmp-btn { position: absolute; top: 10px; right: 10px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--fg-2); border: 1px solid var(--border-1); box-shadow: var(--shadow-sm); transition: transform 250ms var(--ease-spring), color 150ms, background 150ms; }
.cmp-btn:hover { transform: scale(1.12) rotate(-8deg); color: var(--brand-700); background: var(--brand-50); }

/* ===== BENTO DANH MỤC ===== */
.cats.bento { grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; }
.cats.bento .cat:first-child {
  grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px;
  background:
    linear-gradient(var(--brand-a08) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--brand-a08) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(150deg, var(--brand-50), var(--surface) 70%);
}
.cats.bento .cat:first-child .emoji { font-size: 64px; margin-bottom: auto; animation: floaty 4s ease-in-out infinite; }
.cats.bento .cat:first-child .nm { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.cats.bento .cat:first-child .ds { font-size: 15px; max-width: 360px; }
.cat .emoji { transition: transform 450ms var(--ease-spring); }
.cat:hover .emoji { transform: scale(1.15) rotate(-6deg); }
@keyframes floaty { 50% { translate: 0 -8px; } }

/* ===== 4 BƯỚC: đường nối tự vẽ + số nảy ===== */
.steps::after { content: ""; position: absolute; top: 28px; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1600ms var(--ease-out) 300ms; z-index: 1; }
.steps.in::after { transform: scaleX(1); }
.js .steps .num { opacity: 0; }
.steps.in .num { animation: numPop 600ms var(--ease-spring) both; }
.steps.in .step:nth-child(1) .num { animation-delay: 250ms; }
.steps.in .step:nth-child(2) .num { animation-delay: 650ms; }
.steps.in .step:nth-child(3) .num { animation-delay: 1050ms; }
.steps.in .step:nth-child(4) .num { animation-delay: 1450ms; }
@keyframes numPop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.step .num { transition: background 250ms, color 250ms, transform 300ms var(--ease-spring); }
.step:hover .num { background: var(--brand-500); color: #fff; transform: scale(1.08); }

/* ===== MARQUEE lời khách hàng ===== */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); padding: 6px 0; }
.marquee-track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
/* margin thay cho gap để -50% khớp đúng một lượt (không lệch khi lặp). */
.marquee .test { flex: none; width: 380px; margin-right: 20px; transition: transform 300ms var(--ease-out), box-shadow 300ms; }
.marquee .test:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== CTA BAND: quầng sáng chuyển động ===== */
.cta-band::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 65%); animation: ctaGlow 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes ctaGlow { to { transform: translate(-260px, 220px) scale(1.3); } }
.cta-band > * { position: relative; z-index: 1; }

/* ===== TOAST ===== */
.toasts { position: fixed; top: 84px; right: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 360px; padding: 13px 16px; border-radius: 14px; background: var(--surface); color: var(--fg-1); border: 1px solid var(--border-1); border-left: 4px solid var(--brand-500); box-shadow: var(--shadow-lg); font-size: 14.5px; font-weight: 600; animation: toastIn 450ms var(--ease-spring) both; }
.toast.err { border-left-color: var(--danger); }
.toast.out { animation: toastOut 300ms var(--ease-out) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ===== FLY TO CART ===== */
.fly-dot { position: fixed; z-index: 1200; width: 56px; height: 56px; border-radius: 14px; background-size: cover; background-position: center; box-shadow: var(--shadow-lg); pointer-events: none; }

/* ===== BACK TO TOP ===== */
.to-top { position: fixed; right: 18px; bottom: 78px; z-index: 85; width: 48px; height: 48px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-md); opacity: 0; translate: 0 16px; pointer-events: none; transition: opacity 300ms, translate 400ms var(--ease-spring), background 150ms; }
.to-top.show { opacity: 1; translate: 0 0; pointer-events: auto; }
.to-top:hover { background: var(--brand-50); }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top-ring circle { fill: none; stroke: var(--brand-500); stroke-width: 2.5; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100); }
body:has(.compare-bar) .to-top, body:has(.sticky-buy.show) .to-top { bottom: 140px; }

/* ===== SEARCH SKELETON ===== */
.search-suggest .sk { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-1); }
.search-suggest .sk i { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--bg-3) 25%, var(--surface-2) 50%, var(--bg-3) 75%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.search-suggest .sk i:nth-child(1) { width: 40px; height: 30px; }
.search-suggest .sk i:nth-child(2) { flex: 1; height: 12px; }
.search-suggest .sk i:nth-child(3) { width: 48px; height: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== FORM focus mượt hơn ===== */
.field input, .field select, .field textarea, .search-box input { background: var(--surface); color: var(--fg-1); transition: border-color 180ms, box-shadow 180ms; }
.search-box input:focus { box-shadow: 0 0 0 4px var(--brand-a12); }
.chip, .rv-chip, .pd-tab { transition: all 200ms var(--ease-out); }
.chip:active, .rv-chip:active { transform: scale(0.95); }

/* ===== VIEW TRANSITIONS (chuyển trang mượt, Chrome/Edge/Safari mới) ===== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut 220ms var(--ease-out) both; }
::view-transition-new(root) { animation: vtIn 380ms var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(12px); } }
/* Ảnh thẻ sản phẩm (JS gán tên lúc bấm) "bay" thành ảnh lớn ở trang chi tiết. */
.pd-media { view-transition-name: pimg; }
::view-transition-group(pimg) { animation-duration: 520ms; animation-timing-function: var(--ease-out); }
/* Đổi sáng/tối: tắt hiệu ứng trượt mặc định, để JS vẽ vòng tròn lan (clip-path). */
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt .nav { view-transition-name: none; }

/* ===== DARK MODE chi tiết ===== */
[data-theme="dark"] .grid-bg { background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px); }
[data-theme="dark"] .aurora { opacity: 0.35; }
[data-theme="dark"] .logo-row img, [data-theme="dark"] .m-drawer-head img, [data-theme="dark"] footer .foot img { background: #fff; padding: 5px 10px; border-radius: 10px; box-sizing: content-box; }
[data-theme="dark"] .nav.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
[data-theme="dark"] .cube-shadow { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%); }
[data-theme="dark"] .face-badge.yellow, [data-theme="dark"] .face-badge.blue, [data-theme="dark"] .face-badge.pink, [data-theme="dark"] .face-badge.violet { filter: saturate(1.1) brightness(0.95); }
[data-theme="dark"] .face-stat .v.yellow { color: #FDE68A; }
[data-theme="dark"] .face-stat .v.violet { color: #C4B5FD; }
/* Mô phỏng Google Sheet luôn giữ nền sáng như sheet thật: khai lại token trong phạm vi khối. */
[data-theme="dark"] .sh, [data-theme="dark"] .prod .thumb .ph {
  --surface: #fff; --fg-1: #0F172A; --fg-2: #334155; --fg-3: #64748B;
  --border-1: #E2E8F0; --ink-100: #F1F5F9; --ink-200: #E2E8F0; --bg-2: #F8FAFC;
  color: var(--fg-2);
}
[data-theme="dark"] .cta-band { background: linear-gradient(135deg, var(--brand-500) 0%, color-mix(in srgb, var(--brand-500) 55%, #000) 100%); }
[data-theme="dark"] .prod .thumb .ph { background: #F8FAFC; }
[data-theme="dark"] .prod .thumb .ph .lbl { color: color-mix(in srgb, var(--brand-500) 70%, #000); }
[data-theme="dark"] .alert.err { background: #2A1215; color: #FCA5A5; border-color: #7F1D1D; }
[data-theme="dark"] .stars { color: #FACC15; }
html { transition: background-color 300ms; }

/* ===== RESPONSIVE bổ sung ===== */
@media (max-width: 900px) {
  .cats.bento { grid-template-columns: 1fr 1fr; }
  .cats.bento .cat:first-child { grid-row: span 1; padding: 24px; }
  .cats.bento .cat:first-child .emoji { font-size: 48px; margin-bottom: 12px; }
  .steps::before, .steps::after { display: none; }
  .aurora i { filter: none; }
  .aurora i:nth-child(1) { width: 320px; height: 280px; }
  .aurora i:nth-child(2) { width: 280px; height: 240px; }
}
@media (max-width: 560px) {
  section { padding: 56px 0; }
  .wrap { padding: 0 16px; }
  .prod-row, .prod-grid, .steps, .blog-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 56px; }
  .hero-cells { display: none; } /* màn nhỏ: ô sáng dễ đè lên chữ */
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .hero-trust { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cube-stage { height: 330px; }
  .cube, .cube-face { width: 260px; height: 190px; }
  .face-front  { transform: translateZ(160px); }
  .face-right  { transform: rotateY(90deg) translateZ(160px); }
  .face-back   { transform: rotateY(180deg) translateZ(160px); }
  .face-left   { transform: rotateY(-90deg) translateZ(160px); }
  .face-top    { transform: rotateX(90deg) translateZ(160px); }
  .face-bottom { transform: rotateX(-90deg) translateZ(160px); }
  .face-content { padding: 12px 14px; gap: 6px; }
  .face-title { font-size: 16px; }
  .face-bars { height: 50px; }
  .face-rows .face-row:nth-child(n+3) { display: none; }
  .stats .n { font-size: 34px; }
  .marquee .test { width: 300px; }
  .foot { grid-template-columns: 1fr; gap: 28px; }
  .foot-bot { flex-direction: column; gap: 12px; align-items: flex-start; }
  .pays { flex-wrap: wrap; }
  .cta-band .actions { flex-direction: column; width: 100%; }
  .cta-band .actions .btn { justify-content: center; }
  .toasts { left: 16px; right: 16px; top: auto; bottom: 18px; }
  .toast { max-width: none; }
}

/* ===== TẮT CHUYỂN ĐỘNG theo cài đặt người dùng ===== */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal], .js [data-reveal].in, .js .steps .num { opacity: 1 !important; animation: none !important; }
  .aurora i, .hero-cells, .cats.bento .cat:first-child .emoji, .cta-band::after, .btn.shine::after, .prod .thumb .flag.flash { animation: none !important; }
  .hero-cells { display: none; }
  .steps::after { transform: scaleX(1); transition: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .marquee-track { animation: none; }
  .marquee .test[aria-hidden="true"] { display: none; }
  [data-tilt]:hover { transform: none; }
  .m-drawer, .m-links a, .nav-ind { transition: none; }
  @view-transition { navigation: none; }
}
