/* ============ ShopAcc - giao diện khách ============ */
:root {
  /* Nền "mực đêm". Mọi màu nhấn (nút, giá, đường dẫn, số liệu) đi theo "Màu chính" trong Cài đặt giao diện (theme-init.js) */
  --bg: #0c1019;
  --bg2: #121827;
  --card: #171e2f;
  --card2: #1f2840;
  --border: #29334c;
  --text: #e8ebf3;
  --muted: #9aa3ba;
  --primary: #dba443;
  --primary2: #f0c46c;
  --accent: var(--primary-ink);
  --accent2: var(--primary);
  --green: #22c55e;
  --red: #ef4444;
  --blue: #3b82f6;
  --rk: 1; /* hệ số bo góc (người dùng chỉnh được) */
  --radius: calc(14px * var(--rk));
  --shadow: 0 8px 24px rgba(0, 0, 0, .32);
  --shadow-hover: 0 12px 28px rgba(0, 0, 0, .42);
  --card-end: var(--card);
  --text-strong: #fff;
  --on-primary: #1d1404;
  --primary-ink: var(--primary2);
  --link: var(--primary-ink);
  --link-hover: color-mix(in srgb, var(--primary-ink) 70%, var(--text-strong));
  --primary-soft: color-mix(in srgb, var(--primary2) 55%, #fff);
  --topbar-bg: color-mix(in srgb, var(--bg) 92%, transparent);
  --catbar-bg: color-mix(in srgb, var(--bg2) 80%, transparent);
  --t-green: var(--t-green); --t-red: var(--t-red); --t-blue: var(--t-blue); --t-yellow: var(--t-yellow);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55; font-size: 15px;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
::selection { background: color-mix(in srgb, var(--primary) 38%, transparent); color: var(--text-strong); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.3; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
code { background: var(--card2); padding: 2px 6px; border-radius: calc(6px * var(--rk)); }
.container { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.prewrap { white-space: pre-wrap; }
.hl { color: var(--accent); font-size: 1.1em; letter-spacing: 1px; }
.plus { color: var(--green); font-weight: 600; } .minus { color: var(--red); font-weight: 600; }

/* ---------- Buttons & form ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: calc(10px * var(--rk)); padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text-strong); background: var(--card2); transition: .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); color: var(--text-strong); transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); }
.btn-accent { background: var(--primary); color: var(--on-primary); }
.btn-accent:hover { color: var(--on-primary); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-sm { padding: 7px 12px; font-size: .88rem; } .btn-xs { padding: 4px 9px; font-size: .78rem; border-radius: calc(7px * var(--rk)); }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; } .btn-block { width: 100%; }
input, select, textarea { width: 100%; background: var(--bg2); border: 1px solid var(--border); color: var(--text); border-radius: calc(10px * var(--rk)); padding: 11px 13px; font: inherit; outline: none; transition: .15s; }
textarea { resize: vertical; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary2) 20%, transparent); }
.label { display: block; margin: 12px 0 6px; font-weight: 600; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0; cursor: pointer; }
.check input { width: auto; }
.input-group { display: flex; gap: 8px; margin-bottom: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Header ---------- */
.nav-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .35); }
.nav-backdrop[hidden] { display: none; }
.topbar { position: sticky; top: 0; z-index: 50; background: var(--topbar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; color: var(--text-strong); white-space: nowrap; }
.logo img { height: 38px; width: auto; }
.logo-mark { font-size: 1.6rem; }
.search { flex: 1; display: flex; max-width: 520px; position: relative; }
.search input { border-radius: 999px; padding-right: 46px; }
.search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 38px; border: 0; border-radius: 999px; background: var(--primary); cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-actions > a:not(.btn) { color: var(--text); font-weight: 500; }
.icon-btn { background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; display: none; }
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--card); border: 1px solid var(--border); border-radius: calc(12px * var(--rk)); padding: 6px; box-shadow: var(--shadow); }
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; color: var(--text); border-radius: calc(8px * var(--rk)); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--card2); }
.catbar { border-top: 1px solid var(--border); background: var(--catbar-bg); }
.catbar-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.catbar-inner::-webkit-scrollbar { display: none; }
.catbar a { padding: 11px 14px; color: var(--muted); white-space: nowrap; font-weight: 500; border-bottom: 2px solid transparent; }
.catbar a:hover, .catbar a.active { color: var(--text-strong); border-bottom-color: var(--primary2); }
.badge-hot { background: #dc2626; color: #fff; font-size: .75rem; line-height: 1.3; padding: 0 5px; border-radius: calc(4px * var(--rk)); vertical-align: top; font-weight: 700; }
.notice { background: var(--bg2); border-bottom: 1px solid var(--border); font-size: .9rem; }
.marquee { overflow: hidden; white-space: nowrap; padding: 8px 0; }
.marquee span { display: inline-block; }
/* chỉ chạy chữ khi thông báo dài hơn thanh (main.js gắn .run) */
.marquee.run span { padding-left: 100%; animation: marquee var(--mq-d, 22s) linear infinite; }
.marquee.run:hover span { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .marquee { white-space: normal; } .marquee.run span { padding-left: 0; animation: none; } }

/* ---------- Layout 3 cột: sidebar trái | nội dung | sidebar phải ---------- */
.layout { display: grid; grid-template-columns: 180px minmax(0, 1fr) 180px; gap: 20px; padding-top: 20px; padding-bottom: 40px; }
.side { position: sticky; top: 130px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.side-banner img { border-radius: var(--radius); box-shadow: var(--shadow); transition: .2s; }
.side-banner:hover img { transform: scale(1.02); }
.side:empty { display: none; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb strong { color: var(--text); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: calc(12px * var(--rk)); margin-bottom: 14px; border: 1px solid; }
.alert-success { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); color: var(--t-green); }
.alert-error { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .4); color: var(--t-red); }
.alert-info { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .4); color: var(--t-blue); }
.alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .4); color: var(--t-yellow); }

/* ---------- Card chung ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card.pad, .pad { padding: 20px; margin-bottom: 18px; }
.card-body { padding: 14px; }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
a.card { color: var(--text); display: block; transition: .2s; }
a.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); box-shadow: var(--shadow-hover); }
a.card:hover .thumb img { transform: scale(1.06); }
.ribbon { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-weight: 800; font-size: .78rem; padding: 3px 9px; border-radius: calc(6px * var(--rk)); }
.ribbon.hot { background: #dc2626; }
.ribbon.static { position: static; display: inline-block; }
.code-tag { position: absolute; bottom: 8px; left: 8px; background: rgba(0, 0, 0, .65); font-size: .75rem; padding: 2px 8px; border-radius: calc(6px * var(--rk)); }
.type-tag { position: absolute; bottom: 8px; right: 8px; background: var(--primary); color: var(--on-primary); font-size: .75rem; padding: 2px 8px; border-radius: calc(6px * var(--rk)); font-weight: 600; }

/* ---------- Slider ---------- */
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 18px; aspect-ratio: 3 / 1; background: var(--card); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.slide.active { opacity: 1; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slider-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.6rem; cursor: pointer; }
.slider-nav.prev { left: 12px; } .slider-nav.next { right: 12px; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: .2s; }
.dots button.active { width: 26px; background: #fff; }

.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.stats-bar > div { background: var(--card); border: 1px solid var(--border); border-radius: calc(12px * var(--rk)); padding: 14px; text-align: center; }
.stats-bar b { display: block; font-size: 1.35rem; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stats-bar span { color: var(--muted); font-size: .85rem; }

/* ---------- Sections & grids ---------- */
.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head h1, .section-head h2 { margin: 0; }
.game-grid, .cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-grid { display: grid; grid-template-columns: repeat(var(--pg-pc, 4), minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(var(--pg-tab, 3), minmax(0, 1fr)); } }
.game-card h3, .cat-card h3 { margin-bottom: 8px; }
.game-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.product-title { font-size: .98rem; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.attrs { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .78rem; }
.attrs li { display: flex; justify-content: space-between; gap: 4px; border-bottom: 1px dashed var(--border); padding-bottom: 2px; }
.attrs span { color: var(--muted); }
.price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.price { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
del { color: var(--muted); font-size: .82rem; margin-right: 6px; }
.page-hero { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 16%, var(--card)); border: 1px solid var(--border); margin-bottom: 22px; }
.page-hero img { width: 200px; border-radius: calc(12px * var(--rk)); aspect-ratio: 16/10; object-fit: cover; }
.page-hero p { margin: 0; color: var(--text); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 18px; }

/* ---------- Coupons ---------- */
.coupon-grid { container-type: inline-size; --cp-n: var(--cp-cols, 4); --cp-gap: 14px; display: grid; grid-template-columns: repeat(var(--cp-n), minmax(0, 1fr)); gap: var(--cp-gap); }
@media (max-width: 1100px) { .coupon-grid { --cp-n: var(--cp-cols-t, 3); } }
@media (max-width: 760px) { .coupon-grid { --cp-n: var(--cp-cols-m, 2); --cp-gap: 10px; } }
/* Thẻ mã: tỉ lệ 600 x 350, chữ co giãn theo bề rộng thẻ (cqw) nên thẻ nhỏ trên điện thoại vẫn cân đối */
.coupon { container-type: inline-size; position: relative; aspect-ratio: var(--cp-ar, 600 / 350); display: flex; background: var(--card); border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: calc(16px * var(--rk)); overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s;
  aspect-ratio: auto; min-height: calc((100cqw - (var(--cp-n) - 1) * var(--cp-gap)) / var(--cp-n) * var(--cp-h, 260) / var(--cp-w, 600)); }
/* tỉ lệ thẻ (admin chỉnh) chỉ là chiều cao tối thiểu: chữ nhiều thì thẻ tự cao thêm, không bị cắt */
.coupon:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.coupon-value { flex: 0 0 36%; position: relative; border-radius: calc(15px * var(--rk)) 0 0 calc(15px * var(--rk)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; background: var(--primary); color: var(--on-primary); text-align: center; padding: 3cqw; }
.coupon-value b { font-size: clamp(18px, 12cqw, 44px); line-height: 1; font-weight: 900; letter-spacing: -.5px; }
.coupon-value small { font-size: clamp(12px, 3.6cqw, 13px); font-weight: 700; letter-spacing: 1px; }
.coupon-value .coupon-max { letter-spacing: 0; font-weight: 600; }
/* Đường răng cưa giữa 2 phần như vé */
.coupon-value::after { content: ""; position: absolute; top: 6%; bottom: 6%; right: -1px; border-right: 2px dashed color-mix(in srgb, var(--card) 85%, transparent); }
.coupon::before, .coupon::after { content: ""; position: absolute; left: calc(36% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--bg); z-index: 1; }
.coupon::before { top: -9px; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--primary) 35%, var(--border)); }
.coupon::after { bottom: -9px; box-shadow: inset 0 1px 0 color-mix(in srgb, var(--primary) 35%, var(--border)); }
.coupon-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(2px, 1.2cqw, 6px); padding: 3cqw 4cqw 3cqw 5cqw; }
.coupon-code { flex: 0 0 auto; background: none; border: 0; padding: 0; border-radius: 0; line-height: 1.15; font-family: inherit; font-size: clamp(12px, 6.4cqw, 22px); font-weight: 800; color: var(--primary-ink); letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coupon-desc { flex-shrink: 0; font-size: clamp(12px, 3.6cqw, 13px); color: var(--text); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coupon-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--muted); }
.coupon-meta span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.coupon-meta .ico { width: 1.1em; height: 1.1em; }
.coupon-left { color: var(--primary-ink); font-weight: 600; }
.coupon-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.coupon-copy { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: clamp(3px, 1.4cqw, 6px) clamp(8px, 3.4cqw, 14px); border-radius: 999px; font-size: clamp(12px, 3.4cqw, 13px); font-weight: 700; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-ink); }
.coupon-copy .ico { width: 1.1em; height: 1.1em; }
.coupon:active .coupon-copy { background: var(--primary); color: var(--on-primary, #fff); }
/* Thẻ nhỏ (điện thoại): bớt chữ để không chật */
@container (max-width: 230px) {
  .coupon-desc { -webkit-line-clamp: 1; line-height: 1.25; }
  .coupon-value .coupon-max, .coupon-meta .coupon-left { display: none; }
  .coupon-meta { flex-wrap: nowrap; min-width: 0; }
  .coupon-meta .ico { display: none; }
  .coupon-meta span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .coupon-info { justify-content: space-between; gap: 2px; padding: 7px 8px 7px 11px; }
  .coupon-code { font-size: 14px; }
  .coupon-copy { padding: 3px 9px; }
  .coupon-foot { gap: 4px; }
}
.chip { display: inline-block; padding: 7px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; color: var(--text); cursor: pointer; font: inherit; font-size: .88rem; white-space: nowrap; }
.chip:hover, .chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.mini-coupons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ---------- Filter ---------- */
.filter { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr auto auto; gap: 10px; padding: 14px; margin-bottom: 18px; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-bottom: 24px; }
.gallery-main { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 90px; height: 60px; object-fit: cover; border-radius: calc(8px * var(--rk)); cursor: pointer; opacity: .6; border: 2px solid transparent; }
.gallery-thumbs img.active { opacity: 1; border-color: var(--primary2); }
.buy-box { padding: 20px; }
.price-big { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.price-big .price { font-size: 2rem; }
.attrs-table th { width: 40%; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.actions { display: flex; gap: 6px; }
.status { font-size: .78rem; padding: 3px 9px; border-radius: 99px; font-weight: 600; white-space: nowrap; }
.status-completed, .status-success { background: rgba(34, 197, 94, .15); color: var(--t-green); }
.status-refunded, .status-cancelled { background: rgba(239, 68, 68, .15); color: var(--t-red); }
.status-expired { background: rgba(239, 68, 68, .15); color: var(--t-red); }
.status-pending { background: rgba(245, 158, 11, .15); color: var(--t-yellow); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 16px 0 6px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: calc(10px * var(--rk)); background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 0 8px; }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- Auth ---------- */
.auth-wrap { display: flex; justify-content: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 440px; padding: 28px; }
.auth-card h1 { text-align: center; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha { border-radius: calc(10px * var(--rk)); cursor: pointer; height: 46px; width: auto; flex-shrink: 0; }

/* ---------- User ---------- */
.user-nav { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; background: var(--card); border: 1px solid var(--border); border-radius: calc(12px * var(--rk)); padding: 6px; }
.user-nav a { padding: 9px 14px; border-radius: calc(9px * var(--rk)); color: var(--muted); white-space: nowrap; font-weight: 500; }
.user-nav a.active, .user-nav a:hover { background: var(--primary); color: var(--on-primary); }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat b { font-size: 1.3rem; }
.narrow { max-width: 480px; }
.secret-box { background: var(--bg2); border: 1px solid var(--border); border-radius: calc(12px * var(--rk)); padding: 14px; margin-bottom: 14px; }
.secret-box pre { margin: 0 0 10px; white-space: pre-wrap; word-break: break-all; font-size: 1rem; transition: filter .2s; }
.blurred { filter: blur(6px); user-select: none; }
.secret-actions { display: flex; gap: 8px; }
.deposit-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; margin-bottom: 14px; }
.qr img { width: 100%; border-radius: calc(12px * var(--rk)); background: #fff; padding: 6px; }
.amount-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: var(--primary2); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer / error / popup ---------- */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding-top: 30px; color: var(--muted); font-size: .9rem; }
.footer h4, .footer-title { color: var(--text); margin: 0 0 10px; font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footer ul { list-style: none; padding: 0; margin: 0; } .footer li { margin-bottom: 6px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 20px; padding: 14px 16px; text-align: center; }
.error-page { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.error-code { font-size: 5rem; font-weight: 900; color: var(--primary-ink); line-height: 1; letter-spacing: -.02em; }
.popup { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.popup[hidden] { display: none; }
.popup-box { position: relative; width: min(var(--pw, 520px), 100%); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.popup-inner { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; border-radius: inherit; display: flex; flex-direction: column; align-items: center; }
.popup-img { display: block; max-width: 100%; }
.popup-img img { display: block; width: 100%; height: auto; object-fit: cover; }
.popup-box:not(.popup-imgonly) .popup-img img { border-radius: 0; }
.popup-box:not(.popup-imgonly) .popup-img-in { padding: 14px 14px 0; }
.popup-box:not(.popup-imgonly) .popup-img-in:last-child { padding: 0 14px 14px; }
.popup-box:not(.popup-imgonly) .popup-img-in img { border-radius: calc(10px * var(--rk)); }
.popup-imgonly { background: transparent; box-shadow: none; border: 0; }
.popup-imgonly .popup-img img { border-radius: var(--radius); }
.popup-body { width: 100%; padding: 20px 22px 22px; line-height: 1.6; overflow-wrap: anywhere; }
.popup-title { margin: 0 0 10px; line-height: 1.3; font-weight: 800; color: var(--text-strong); }
.popup-content > :first-child { margin-top: 0; }
.popup-content > :last-child { margin-bottom: 0; }
.popup-content p { margin: 0 0 8px; }
.popup-content ul, .popup-content ol { margin: 0 0 8px; padding-left: 22px; }
.popup-content a { color: inherit; text-decoration: underline; }
.popup-btn { display: block; width: fit-content; max-width: 100%; margin: 16px auto 0; padding: 11px 26px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-weight: 700; text-align: center; text-decoration: none; transition: filter .15s; }
.popup-btn:hover { filter: brightness(1.08); color: var(--on-primary); }
.popup-close { position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; color: #000; cursor: pointer; font-weight: 800; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 10px 18px; border-radius: calc(10px * var(--rk)); z-index: 200; font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
}
@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; }
  .filter { grid-template-columns: 1fr 1fr; }
  .filter input[name=q] { grid-column: 1 / -1; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .deposit-grid { grid-template-columns: 1fr; }
  .qr { max-width: 280px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .icon-btn { display: block; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hide-sm { display: none; }
  .catbar { display: none; }
  .catbar.open { display: block; max-height: calc(100dvh - 130px); overflow-y: auto; overscroll-behavior: contain; }
  .catbar-inner { flex-direction: column; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .slider { aspect-ratio: 2 / 1; }
  .game-grid, .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .product-grid { grid-template-columns: repeat(var(--pg-mb, 2), minmax(0, 1fr)); gap: 10px; }
  .attrs { grid-template-columns: 1fr; }
  .page-hero { flex-direction: column; align-items: flex-start; }
  .page-hero img { width: 100%; }
  .card-body { padding: 10px; }
  .game-meta { font-size: .72rem; }
}

/* ---------- Icon SVG ---------- */
.ico { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.ico-lg { width: 1.5em; height: 1.5em; }
.section-head h2 .ico, .section-head h1 .ico { color: var(--primary-ink); }
.logo-mark .ico { width: 30px; height: 30px; color: var(--primary-ink); }
.search button { display: flex; align-items: center; justify-content: center; color: #fff; }
.icon-btn .ico { width: 26px; height: 26px; }
.slider-nav { display: flex; align-items: center; justify-content: center; }
.slider-nav .ico { width: 24px; height: 24px; }
.popup-close { display: flex; align-items: center; justify-content: center; }
.game-meta span { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb span { display: inline-flex; align-items: center; }
.pagination .ico { width: 18px; height: 18px; }
.user-nav a, .catbar a, .dropdown-menu a { display: inline-flex; align-items: center; gap: 6px; }
.dropdown-menu a { display: flex; }

/* ---------- Số liệu "đang bán / đã bán" trên thẻ (bật tắt theo cấp: Admin -> Thẻ sản phẩm) ---------- */
.card-stats { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-size: .86rem; color: var(--muted); line-height: 1.4; }
.card-stats span { white-space: nowrap; }
.card-stats b { color: var(--text-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.card-stats .sold b { color: var(--primary-ink); }
.game-card h3, .cat-card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Footer tùy chỉnh ---------- */
.footer-grid { grid-template-columns: 1.6fr repeat(var(--cols, 2), 1fr); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text-strong); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social { width: 38px; height: 38px; border-radius: calc(12px * var(--rk)); display: inline-flex; align-items: center; justify-content: center; background: var(--card2); border: 1px solid var(--border); color: var(--text) !important; transition: .15s; }
.social:hover { color: #fff !important; }
.social .ico { width: 20px; height: 20px; }
.social:hover { transform: translateY(-2px); }
.social-facebook:hover { background: #1877f2; } .social-zalo:hover { background: #0068ff; } .social-tiktok:hover { background: #111; }
.social-youtube:hover { background: #ff0033; } .social-telegram:hover { background: #229ed9; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Ô bắt buộc ---------- */
.req { color: #f87171; font-weight: 800; margin-left: 2px; }

/* ---------- Ô chọn (select): danh sách xổ xuống cách 1 khoảng nhỏ, bo góc ---------- */
select { cursor: pointer; }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  select::picker-icon { color: var(--muted); transition: rotate .2s; }
  select:open { border-color: var(--primary2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary2) 20%, transparent); }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) {
    margin-block: 6px; padding: 6px; border: 1px solid var(--border); border-radius: calc(14px * var(--rk));
    background: var(--card); box-shadow: 0 18px 44px rgba(0, 0, 0, .45); max-height: min(360px, 60vh); overflow-y: auto;
  }
  select option { padding: 9px 12px; border-radius: calc(10px * var(--rk)); color: var(--text); gap: 8px; }
  select option:hover, select option:focus-visible { background: var(--card2); outline: none; }
  select option:checked { background: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--text-strong); font-weight: 700; }
  select option::checkmark { color: var(--primary-ink); }
}

/* ---------- Thẻ sản phẩm: mã góc trên trái, giá vàng + nút mũi tên (cả thẻ là link) ---------- */
.product-card { display: flex !important; flex-direction: column; }
.product-card .card-body { display: flex; flex-direction: column; flex: 1; }
.product-card .code-tag { top: 10px; left: 10px; bottom: auto; background: rgba(8, 10, 18, .78); font-weight: 700; letter-spacing: .3px; }
.product-card .ribbon-right { left: auto; right: 10px; }
.product-card .product-title { font-size: 1rem; font-weight: 700; margin: 0 0 10px; min-height: 2.6em; }
.product-card .attrs { margin-bottom: 12px; }
.buy-row { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.price-box { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.price-box .price { font-size: 1.05rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-box del { font-size: .78rem; margin: 0; line-height: 1.2; color: var(--muted); }
.btn-view { width: 38px; height: 38px; padding: 0; border-radius: calc(10px * var(--rk)); }
.btn-view .ico { width: 20px; height: 20px; }
a.card:hover .btn-view { filter: brightness(1.1); }


/* ---------- Ảnh acc tỉ lệ 1500x900 (5:3) ---------- */
.product-card .thumb { aspect-ratio: 5 / 3; }

/* ---------- Dải ảnh chạy trang chủ (300x150, PC 5 ảnh / ĐT 3 ảnh, chạy phải -> trái) ---------- */
.img-strip { --gap: 12px; --show: 5; container-type: inline-size; overflow: hidden; margin-bottom: 26px; border-radius: var(--radius);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.strip-track { display: flex; gap: var(--gap); width: max-content; animation: stripMove calc(var(--n, 10) * 3.2s) linear infinite; }
.img-strip:hover .strip-track { animation-play-state: paused; }
.strip-item { flex: 0 0 calc((100cqw - (var(--show) - 1) * var(--gap)) / var(--show)); aspect-ratio: 2 / 1; border-radius: calc(12px * var(--rk)); overflow: hidden; background: var(--card); border: 1px solid var(--border); transition: transform .2s, border-color .2s; }
.strip-item img { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.strip-item:hover { transform: translateY(-3px); border-color: var(--primary2); }
/* Dịch đúng nửa track (1 bản sao + 1 khoảng cách) để vòng lặp liền mạch */
@keyframes stripMove { to { transform: translateX(calc(-50% - var(--gap) / 2)); } }
@media (max-width: 720px) { .img-strip { --show: 3; --gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .strip-track { animation-duration: calc(var(--n, 10) * 8s); } }

/* ---------- Trang chi tiết acc ---------- */
.pd { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 26px; }
.pd-gallery { padding: 12px; }
.pd-main { position: relative; border-radius: calc(12px * var(--rk)); overflow: hidden; background: var(--bg2); }
.pd-main .gallery-main { display: block; width: 100%; aspect-ratio: 5 / 3; object-fit: cover; }
.pd-code { top: 12px !important; left: 12px; bottom: auto; font-size: .82rem; padding: 4px 10px; font-weight: 700; background: rgba(10, 8, 25, .75); backdrop-filter: blur(4px); }
.pd-main .ribbon-right { left: auto; right: 12px; top: 12px; }
.pd-count { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; padding: 4px 10px; border-radius: 99px; background: rgba(10, 8, 25, .7); color: #fff; }
.pd-gallery .gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 10px 0 0; overflow: visible; }
.pd-gallery .gallery-thumbs img { width: 100%; height: auto; aspect-ratio: 5 / 3; border-radius: calc(8px * var(--rk)); opacity: .55; transition: .15s; }
.pd-gallery .gallery-thumbs img:hover { opacity: .9; }
.pd-gallery .gallery-thumbs img.active { opacity: 1; border-color: var(--primary2); }
.pd-info { padding: 22px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 130px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 99px; background: var(--card2); border: 1px solid var(--border); color: var(--muted); font-size: .8rem; }
.pd-tag:hover { color: var(--text-strong); border-color: var(--primary2); }
.pd-title { font-size: 1.45rem; margin: 0; line-height: 1.35; word-break: break-word; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .85rem; }
.pd-meta span { display: inline-flex; align-items: center; gap: 5px; }
.pd-meta b { color: var(--text); }
.pd-price { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: calc(14px * var(--rk)); background: color-mix(in srgb, var(--primary) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border)); }
.pd-price-label { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.pd-price .price { font-size: 2rem; line-height: 1.1; }
.pd-old { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pd-old del { font-size: .9rem; }
.pd-save { font-size: .76rem; font-weight: 700; color: var(--t-green); }
.pd-attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pd-attr { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: calc(10px * var(--rk)); background: var(--bg2); border: 1px solid var(--border); min-width: 0; }
.pd-attr span { font-size: .78rem; color: var(--muted); }
.pd-attr b { font-size: .92rem; word-break: break-word; }
.pd-stock { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: calc(12px * var(--rk)); background: rgba(59, 130, 246, .12); border: 1px solid rgba(59, 130, 246, .35); color: var(--t-blue); font-size: .88rem; }
.pd-buy { display: flex; flex-direction: column; gap: 10px; }
.pd-buy .label { margin: 0; }
.pd-buy .input-group { margin: 0; }
.pd-buy .mini-coupons { margin: 0; }
#couponMsg:empty { display: none; }
.pd-balance { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: calc(12px * var(--rk)); background: var(--bg2); border: 1px solid var(--border); font-size: .88rem; }
.pd-balance span, .pd-balance a { display: inline-flex; align-items: center; gap: 6px; }
.pd-policy { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px dashed var(--border); display: grid; gap: 8px; color: var(--muted); font-size: .84rem; }
.pd-policy li { display: flex; align-items: center; gap: 8px; }
.pd-policy .ico { color: var(--primary-ink); }
.pd-desc h2 { display: flex; align-items: center; gap: 8px; }
.section-head-sub { align-items: flex-end; }
.section-head-sub p { margin: 2px 0 0; }
.product-grid-4 { grid-template-columns: repeat(var(--pg-pc, 4), minmax(0, 1fr)); }
@media (max-width: 1100px) { .product-grid-4 { grid-template-columns: repeat(var(--pg-tab, 3), minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .pd { grid-template-columns: 1fr; }
  .pd-info { position: static; }
}
@media (max-width: 720px) {
  .product-grid-4 { grid-template-columns: repeat(var(--pg-mb, 2), minmax(0, 1fr)); }
  .pd-info { padding: 16px; }
  .pd-title { font-size: 1.2rem; }
  .pd-price .price { font-size: 1.6rem; }
  .pd-gallery .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* =====================================================================
   Thẻ game / danh mục / sản phẩm: khoảng cách đều nhau (PC + điện thoại)
   ===================================================================== */
.game-card, .cat-card, .product-card { display: flex !important; flex-direction: column; }
.game-card .card-body, .cat-card .card-body, .product-card .card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 14px; }
.game-card .card-body > *, .cat-card .card-body > *, .product-card .card-body > * { margin: 0 !important; }
.game-card h3, .cat-card h3 { font-size: 1rem; line-height: 1.35; }
.card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.game-card .card-stats, .cat-card .card-stats { margin-top: auto !important; }
.cat-price { align-items: center; }
.product-card .product-title { min-height: 2.7em; line-height: 1.35; }

/* Thuộc tính: nằm trong khung, chữ nhỏ, mỗi "thuộc tính: giá trị" 1 dòng */
.product-card .attrs { display: flex; flex-direction: column; gap: 4px; list-style: none; padding: 7px 10px; border-radius: calc(10px * var(--rk)); background: var(--bg2); font-size: .8rem; line-height: 1.4; }
.product-card .attrs li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; padding: 0; border: 0; }
.product-card .attrs span { color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.product-card .attrs b { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.product-card .buy-row { margin-top: auto !important; }
.product-card .buy-row { gap: 6px; }
.product-card .price-box .price { font-size: 1.12rem; overflow: visible; text-overflow: clip; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .game-card .card-body, .cat-card .card-body, .product-card .card-body { gap: 8px; padding: 10px; }
  .game-card h3, .cat-card h3 { font-size: .9rem; }
  .product-card .product-title { font-size: .88rem; }
  .product-card .attrs { font-size: .75rem; padding: 6px 8px; gap: 3px; }
  /* Danh mục: bỏ "Chỉ từ" cho gọn */
  .cat-price { display: none !important; }
  .card-stats { font-size: .8rem; gap: 2px 10px; }
  /* Giá + nút mũi tên cùng 1 hàng */
  .buy-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .price-box .price { font-size: .95rem; }
  .price-box del { font-size: .75rem; }
  .btn-view { width: 32px; height: 32px; border-radius: calc(8px * var(--rk)); }
  .btn-view .ico { width: 18px; height: 18px; }
}
@media (max-width: 420px) { .hide-xs { display: none; } }
@media (max-width: 720px) {
  .product-card .price-box .price { font-size: .95rem; }
}

/* =====================================================================
   Ảnh có viền nhẹ + bo 4 góc (chỉ phần ảnh): game, danh mục, acc, chi tiết acc
   ===================================================================== */
:root { --img-border: color-mix(in srgb, var(--text) 12%, transparent); }
.game-card .thumb, .cat-card .thumb, .product-card .thumb { margin: 10px 10px 0; border-radius: calc(12px * var(--rk)); border: 1px solid var(--img-border); }
a.card:hover .thumb { border-color: color-mix(in srgb, var(--primary) 45%, transparent); }
.product-card .code-tag { top: 8px; left: 8px; }
.product-card .ribbon-right { right: 8px; top: 8px; }
.product-card .type-tag { right: 8px; bottom: 8px; }
/* Khoảng cách trong thẻ acc: bỏ chiều cao tối thiểu của tên để không hở khoảng trống */
.product-card .product-title { min-height: 0; }
.game-card .card-body, .cat-card .card-body, .product-card .card-body { padding: 12px 12px 14px; gap: 10px; }
@media (max-width: 720px) {
  .game-card .thumb, .cat-card .thumb, .product-card .thumb { margin: 7px 7px 0; border-radius: calc(10px * var(--rk)); }
  .game-card .card-body, .cat-card .card-body, .product-card .card-body { padding: 9px 9px 10px; gap: 8px; }
}

/* Chi tiết acc: khung ảnh + ảnh nhỏ */
.pd-main { border: 1px solid var(--img-border); }
.pd-gallery .gallery-thumbs img { border: 1px solid var(--img-border); }
.pd-gallery .gallery-thumbs img.active { border: 2px solid var(--primary2); }

/* Phóng to: PC hiện kính lúp khi di chuột, bấm để xem; điện thoại chạm để xem */
.gallery-main[data-zoom] { cursor: zoom-in; transition: transform .35s ease; }
.pd-main:hover .gallery-main[data-zoom] { transform: scale(1.02); }
.pd-zoom-hint { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 25, .62); border: 1px solid rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(4px); opacity: 0; transform: scale(.85); transition: .2s; pointer-events: none; }
.pd-zoom-hint .ico { width: 26px; height: 26px; }
.pd-main:hover .pd-zoom-hint { opacity: 1; transform: scale(1); }
@media (hover: none) {
  .pd-zoom-hint { left: 12px; top: auto; bottom: 12px; margin: 0; width: 34px; height: 34px; opacity: .9; transform: none; }
  .pd-zoom-hint .ico { width: 17px; height: 17px; }
}

.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 4, 15, .93); animation: lbFade .15s ease; }
.lightbox[hidden] { display: none; }
.lb-img { max-width: min(96vw, 1500px); max-height: 88vh; object-fit: contain; border-radius: calc(12px * var(--rk)); border: 1px solid var(--img-border); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); background: #0b0a14; user-select: none; }
.lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn .ico { width: 24px; height: 24px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; margin-top: -23px; }
.lb-next { right: 16px; top: 50%; margin-top: -23px; }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, .12); font-size: .85rem; }
.lb-count:empty { display: none; }
body.lb-open { overflow: hidden; }
@keyframes lbFade { from { opacity: 0; } }
@media (max-width: 720px) {
  .lightbox { padding: 8px; }
  .lb-img { max-width: 100%; max-height: 80vh; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-prev, .lb-next { top: auto; bottom: 14px; margin: 0; }
  .lb-prev { left: 14px; } .lb-next { right: 14px; }
  .lb-close { top: 10px; right: 10px; }
}

/* =====================================================================
   CÀI ĐẶT GIAO DIỆN (người dùng tự chọn, lưu trên trình duyệt)
   data-theme: dark | light   ·   data-bg: ink | purple | slate | gray | zinc | stone
   Màu chính (--primary/--primary2) và độ bo góc (--rk) do /js/theme-init.js đặt
   ===================================================================== */
/* --- Nền tối (mặc định: "ink" - mực đêm, khai báo ở :root) --- */
html[data-bg="purple"] { --bg: #0f0d1a; --bg2: #171428; --card: #1d1933; --card2: #252042; --border: #2f2952; --muted: #9a93c2; --text: #ece9ff; }
html[data-bg="slate"] { --bg: #0b1120; --bg2: #111827; --card: #162033; --card2: #1e293b; --border: #293548; --muted: #94a3b8; --text: #e2e8f0; }
html[data-bg="gray"]  { --bg: #0c0c0f; --bg2: #141418; --card: #1b1b20; --card2: #25252c; --border: #303038; --muted: #a1a1aa; --text: #ececf0; }
html[data-bg="zinc"]  { --bg: #09090b; --bg2: #111113; --card: #18181b; --card2: #222226; --border: #2c2c31; --muted: #a1a1aa; --text: #f4f4f5; }
html[data-bg="stone"] { --bg: #0f0d0b; --bg2: #171412; --card: #1f1b18; --card2: #29241f; --border: #36302a; --muted: #a8a29e; --text: #f5f5f4; }
/* --- Nền sáng --- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9; --bg2: #e9edf4; --card: #ffffff; --card2: #eef1f6; --border: #dce2ec; --muted: #5f6880; --text: #161b29;
  --text-strong: #0a0d16; --shadow: 0 6px 20px rgba(22, 27, 41, .08); --shadow-hover: 0 10px 26px rgba(22, 27, 41, .14);
  --primary-ink: color-mix(in srgb, var(--primary) 66%, #000);
  --primary-soft: color-mix(in srgb, var(--primary) 80%, #000);
  --t-green: #15803d; --t-red: #b91c1c; --t-blue: #1d4ed8; --t-yellow: #a16207;
}
html[data-theme="light"][data-bg="purple"] { --bg: #f6f4fd; --bg2: #eeeaf9; --card: #fff; --card2: #f1eefb; --border: #e1dbf3; --muted: #6b6590; --text: #1e1a33; }
html[data-theme="light"][data-bg="slate"] { --bg: #f1f5f9; --bg2: #e8eef5; --card: #fff; --card2: #eef2f7; --border: #dbe3ec; --muted: #64748b; --text: #0f172a; }
html[data-theme="light"][data-bg="gray"]  { --bg: #f4f4f5; --bg2: #ececee; --card: #fff; --card2: #f0f0f2; --border: #e2e2e6; --muted: #6b7280; --text: #18181b; }
html[data-theme="light"][data-bg="zinc"]  { --bg: #fafafa; --bg2: #f0f0f1; --card: #fff; --card2: #f4f4f5; --border: #e4e4e7; --muted: #71717a; --text: #09090b; }
html[data-theme="light"][data-bg="stone"] { --bg: #f7f5f3; --bg2: #eeebe7; --card: #fff; --card2: #f3f0ec; --border: #e7e2dc; --muted: #78716c; --text: #1c1917; }
html[data-theme="light"] .card { box-shadow: var(--shadow); }
html[data-theme="dark"] { color-scheme: dark; }

/* =====================================================================
   Thanh đường dẫn: khung bọc ngoài + từng mục có khung riêng
   ===================================================================== */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: calc(12px * var(--rk)); font-size: .85rem; }
.breadcrumb > a, .breadcrumb > strong { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: calc(9px * var(--rk)); border: 1px solid var(--border); background: var(--bg2); color: var(--muted); line-height: 1.3; }
.breadcrumb > a:hover { color: var(--text-strong); border-color: var(--primary2); }
.breadcrumb > strong { color: var(--text-strong); border-color: color-mix(in srgb, var(--primary2) 55%, var(--border)); background: color-mix(in srgb, var(--primary) 14%, var(--bg2)); font-weight: 700; }
.breadcrumb > span { display: inline-flex; color: var(--muted); opacity: .7; }
.breadcrumb > span .ico { width: 14px; height: 14px; }
@media (max-width: 720px) { .breadcrumb { font-size: .78rem; padding: 5px; gap: 4px; } .breadcrumb > a, .breadcrumb > strong { padding: 4px 9px; } }

/* =====================================================================
   Nút + hộp "Cài đặt giao diện"
   ===================================================================== */
.icon-round { width: 38px; height: 38px; border-radius: calc(10px * var(--rk)); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; transition: .15s; }
.icon-round:hover { border-color: var(--primary2); color: var(--text-strong); }
.icon-round .ico { width: 19px; height: 19px; }
.dropdown-menu .dd-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.dropdown-menu button { display: flex; align-items: center; gap: 6px; }

.ui-modal { position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 4, 15, .55); backdrop-filter: blur(3px); animation: lbFade .15s ease; }
.ui-modal[hidden] { display: none; }
.ui-box { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: calc(18px * var(--rk)); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); padding: 18px 20px 22px; }
.ui-head { position: relative; text-align: center; margin-bottom: 6px; }
.ui-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-strong); }
.ui-close { position: absolute; right: -4px; top: -2px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ui-close:hover { background: var(--card2); color: var(--text-strong); }
.ui-sec { padding: 16px 0; border-bottom: 1px solid var(--border); }
.ui-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.ui-label { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; color: var(--text-strong); font-size: .95rem; }
.ui-label small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.ui-label .ico { width: 17px; height: 17px; color: var(--muted); }
.ui-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.ui-dot.bg { background: var(--muted); }
.ui-swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.ui-swatch { aspect-ratio: 1; border-radius: calc(9px * var(--rk)); border: 2px solid transparent; cursor: pointer; position: relative; padding: 0; background: var(--sw); transition: transform .12s; }
.ui-swatch:hover { transform: scale(1.07); }
.ui-swatch[aria-checked="true"] { border-color: var(--text-strong); box-shadow: 0 0 0 2px var(--card) inset; }
.ui-swatch[aria-checked="true"]::after { content: ''; position: absolute; left: 50%; top: 46%; width: 30%; height: 16%; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translate(-50%, -50%) rotate(-45deg); }
.ui-swatches.bg { grid-template-columns: repeat(9, 1fr); }
.ui-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ui-seg.r5 { grid-template-columns: repeat(5, 1fr); }
.ui-opt { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; border-radius: calc(10px * var(--rk)); border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; transition: .15s; }
.ui-opt .ico { width: 16px; height: 16px; }
.ui-opt:hover { border-color: var(--primary2); }
.ui-opt[aria-checked="true"] { border-color: var(--primary); color: var(--primary-soft); background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: 0 0 0 1px var(--primary) inset; }
.ui-reset { margin-top: 16px; width: 100%; }
@media (max-width: 420px) { .ui-swatches, .ui-swatches.bg { grid-template-columns: repeat(6, 1fr); } .ui-box { padding: 16px; } }

/* ---------- Banner theo kích cỡ admin chỉnh (cắt lấy phần giữa, giống khung xanh trong admin) ---------- */
.slider { aspect-ratio: var(--ar, 3 / 1) !important; }
.strip-item { aspect-ratio: var(--ar, 2 / 1); }
.side-banner img { width: 100%; aspect-ratio: var(--ar, 1 / 2); object-fit: cover; }

/* ---------- Logo thay cho tên shop ---------- */
.logo img { height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.footer-logo { display: inline-block; margin-bottom: 10px; }
.footer-logo img { max-height: 48px; max-width: 220px; width: auto; object-fit: contain; }
@media (max-width: 720px) { .logo img { height: 34px; max-width: 150px; } }
.cd-over { color: var(--t-red); }
[data-countdown] { font-variant-numeric: tabular-nums; }

/* Bảng dạng thẻ trên điện thoại: mỗi dòng thành 1 khung, cột thành "Nhãn ....... Giá trị" */
@media (max-width: 640px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 3px 0; border: 0; }
  .table-cards td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .table-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 500; text-align: left; flex-shrink: 0; }
  .table-cards .tc-head { font-size: .95rem; word-break: break-all; }
  .table-cards .tc-full { padding-bottom: 6px; font-weight: 600; }
  .table-cards .tc-full .muted { font-weight: 400; }
  .table-cards .tc-action { padding-top: 8px; display: flex; gap: 8px; justify-content: flex-end; }
  .table-cards .tc-empty { text-align: center; }
  .table-cards tr { display: flex; flex-direction: column; }
  .table-cards .tc-head { order: -1; }
  .table-wrap:has(.table-cards) { overflow: visible; }
}

/* Giao dịch gần đây trên điện thoại: 1 dòng "khách · sản phẩm… · giá", tên sản phẩm dài tự rút gọn */
@media (max-width: 640px) {
  .recent-table tr { flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; font-size: .8rem; }
  .recent-table td { width: auto; padding: 0; }
  .recent-table .tc-head { order: 0; flex: 0 0 auto; font-size: .8rem; word-break: normal; white-space: nowrap; color: var(--muted); }
  .recent-table .tc-full { flex: 1 1 auto; min-width: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .recent-table td[data-label] { flex: 0 0 auto; white-space: nowrap; font-size: .82rem; }
  .recent-table td[data-label]::before { content: none; }
  .recent-table .rc-time { display: none !important; }
}

/* Thẻ gần vuông / dọc: mức giảm ở trên, thông tin ở dưới */
.coupon-grid-v .coupon { flex-direction: column; }
.coupon-grid-v .coupon-value { flex: 0 0 40%; border-radius: calc(15px * var(--rk)) calc(15px * var(--rk)) 0 0; }
.coupon-grid-v .coupon-value b { font-size: clamp(20px, 15cqw, 56px); }
.coupon-grid-v .coupon-value::after { top: auto; bottom: -1px; left: 6%; right: 6%; border-right: 0; border-bottom: 2px dashed color-mix(in srgb, var(--card) 85%, transparent); }
.coupon-grid-v .coupon::before, .coupon-grid-v .coupon::after { left: auto; top: calc(40% - 8px); bottom: auto; }
.coupon-grid-v .coupon::before { left: -9px; }
.coupon-grid-v .coupon::after { right: -9px; }
.coupon-grid-v .coupon-info { padding: 4cqw 5cqw; justify-content: space-between; }
.coupon-grid-v .coupon-code { font-size: clamp(13px, 8cqw, 26px); }
.coupon-grid-v .coupon-desc { font-size: clamp(12px, 4.6cqw, 15px); }
.coupon-grid-v .coupon-meta { font-size: clamp(12px, 4cqw, 13px); }
.coupon-grid-v .coupon-copy { font-size: clamp(12px, 4.2cqw, 14px); }

/* ---------- Popup xác nhận mua ---------- */
body.no-scroll { overflow: hidden; }
.bc-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 6, 20, .66); backdrop-filter: blur(4px); animation: bcFade .15s ease; }
.bc-modal[hidden] { display: none; }
.bc-box { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: calc(20px * var(--rk)); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); padding: 20px; animation: bcPop .18s ease; }
@keyframes bcFade { from { opacity: 0; } }
@keyframes bcPop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.bc-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.bc-head h3 { margin: 0; font-size: 1.12rem; }
.bc-head p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.bc-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: calc(12px * var(--rk)); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.bc-icon .ico { width: 22px; height: 22px; }
.bc-x { margin-left: auto; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.bc-x:hover { color: var(--text); border-color: var(--primary); }
.bc-product { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: calc(14px * var(--rk)); background: color-mix(in srgb, var(--primary) 7%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border)); }
.bc-product img { width: 86px; aspect-ratio: 5 / 3; object-fit: cover; border-radius: calc(10px * var(--rk)); flex: 0 0 auto; background: var(--bg2); }
.bc-product div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bc-product b { font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-product span { color: var(--muted); font-size: .8rem; }
.bc-product .bc-code { color: var(--primary-ink); font-weight: 700; }
.bc-lines, .bc-wallet { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.bc-lines > div, .bc-wallet > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bc-lines > div[hidden] { display: none; }
.bc-lines span, .bc-wallet span { color: var(--muted); }
.bc-lines em { font-style: normal; font-weight: 700; color: var(--primary-ink); margin-left: 4px; }
.bc-minus { color: #22c55e; }
.bc-total { padding-top: 10px; border-top: 1px dashed var(--border); }
.bc-total span { color: var(--text) !important; font-weight: 700; }
.bc-total b { font-size: 1.35rem; color: var(--accent); }
.bc-wallet { padding: 10px 12px; border-radius: calc(12px * var(--rk)); background: var(--bg2); font-size: .86rem; gap: 6px; }
.bc-wallet .bc-neg { color: var(--t-red, #f87171); }
.bc-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.bc-note .ico { flex: 0 0 auto; width: 16px; height: 16px; color: var(--primary-ink); margin-top: 1px; }
.bc-err { color: var(--t-red, #f87171); background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .3); padding: 8px 10px; border-radius: calc(10px * var(--rk)); }
.bc-err[hidden] { display: none; }
.bc-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.bc-actions .btn { justify-content: center; min-width: 0; }
.bc-actions [hidden] { display: none; }
.pd-coupon-rule { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pd-coupon-rule .ico { width: 14px; height: 14px; }
@media (max-width: 560px) {
  .bc-modal { align-items: flex-end; padding: 0; }
  .bc-box { max-width: none; border-radius: calc(22px * var(--rk)) calc(22px * var(--rk)) 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
}
/* Nhãn trên ảnh acc (mã acc, còn N acc, % giảm): nền tối cố định nên chữ luôn trắng, kể cả chế độ sáng */
.code-tag, .pd-code { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.type-tag { color: var(--on-primary, #fff); }
.ribbon { color: #fff; }
.product-card .code-tag, .product-card .type-tag, .product-card .ribbon { line-height: 1.35; white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  /* Điện thoại: nhãn nhỏ gọn để không che ảnh */
  .product-card .code-tag, .product-card .type-tag, .product-card .ribbon { font-size: 12px; padding: 1px 6px; border-radius: calc(5px * var(--rk)); letter-spacing: 0; }
  .product-card .code-tag, .product-card .ribbon-right { top: 6px; }
  .product-card .code-tag { left: 6px; }
  .product-card .ribbon-right { right: 6px; }
  .product-card .type-tag { right: 6px; bottom: 6px; }
  .pd-code { font-size: 12px; padding: 3px 8px; top: 8px !important; left: 8px; }
  .pd-main .ribbon-right { top: 8px; right: 8px; font-size: 11px; padding: 3px 8px; }
  .pd-count { font-size: 11px; padding: 3px 8px; }
}

/* ---------- Header điện thoại: logo + số dư + tài khoản 1 hàng, thanh tìm kiếm tự ẩn khi cuộn xuống ---------- */
.catbar-ui { display: none; }
@media (max-width: 720px) {
  .topbar-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "menu logo actions" "search search search"; align-items: center; gap: 8px; padding: 8px 12px; }
  .topbar-inner > .menu-toggle { grid-area: menu; }
  .topbar-inner > .logo { grid-area: logo; min-width: 0; font-size: 1.05rem; gap: 6px; }
  .topbar-inner > .logo > span:not(.logo-mark) { overflow: hidden; text-overflow: ellipsis; }
  .topbar-inner > .logo .logo-mark .ico { width: 24px; height: 24px; }
  .topbar-inner > .logo img { height: 32px; max-width: 100%; object-fit: contain; object-position: left center; }
  .topbar-inner > .top-actions { grid-area: actions; margin-left: 0; gap: 6px; flex-wrap: nowrap; }
  .topbar-inner > .search { grid-area: search; max-width: none; max-height: 60px; transition: max-height .25s ease, opacity .2s ease, margin .25s ease; }
  .top-actions > .icon-round { display: none; } /* đã có trong menu tài khoản / menu ☰ */
  .top-actions .btn-sm { padding: 5px 9px; font-size: .75rem; gap: 4px; border-radius: calc(8px * var(--rk)); line-height: 1.3; }
  .top-actions .btn-sm .ico { width: 14px; height: 14px; }
  .top-uname { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
  .top-balance { white-space: nowrap; }
  .topbar.search-hidden .search { max-height: 0; opacity: 0; margin-top: -8px; overflow: hidden; pointer-events: none; }
  .catbar-ui { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: none; border: 0; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
  .catbar-ui .ico { width: 18px; height: 18px; }
}
@media (max-width: 360px) {
  .top-uname { max-width: 48px; }
  .top-actions .btn-sm { padding: 6px 8px; }
}
/* ---------- Khối banner tự thêm ở trang chủ ---------- */
.home-banner .hb-grid { display: grid; grid-template-columns: repeat(var(--hb-cols, 1), minmax(0, 1fr)); gap: 14px; }
.hb-item { display: block; aspect-ratio: var(--hb-ar, 3 / 1); border-radius: calc(14px * var(--rk)); overflow: hidden; background: var(--card); border: 1px solid var(--img-border, var(--border)); transition: transform .15s, box-shadow .15s; }
a.hb-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 1100px) { .home-banner .hb-grid { grid-template-columns: repeat(var(--hb-cols-t, 2), minmax(0, 1fr)); } }
@media (max-width: 720px) { .home-banner .hb-grid { grid-template-columns: repeat(var(--hb-cols-m, 1), minmax(0, 1fr)); gap: 10px; } .hb-item { border-radius: calc(10px * var(--rk)); } }
/* ---------- Xác minh 2 lớp / quên mật khẩu ---------- */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.auth-row .check { margin: 0; }
.auth-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-ink); }
.auth-icon .ico { width: 28px; height: 28px; }
.auth-card h1 { text-align: center; }
.otp-input { font-size: 1.7rem; letter-spacing: .55em; text-align: center; font-weight: 800; padding-left: .55em; }
.sec-list { display: flex; flex-direction: column; gap: 10px; }
.sec-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.sec-item .ico { width: 22px; height: 22px; color: var(--primary-ink); flex-shrink: 0; }
.sec-item > div { flex: 1; min-width: 180px; }
.sec-item b { display: block; }
.sec-item form { margin: 0; }
.badge-ok { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: rgba(34, 197, 94, .15); color: var(--t-green); }
.badge-warn { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; background: rgba(245, 158, 11, .15); color: var(--t-yellow); }
.sec-form { margin-top: 12px; max-width: 460px; }
.sec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
.sec-actions form { margin: 0; }
.sec-details, .sec-toggle { margin-top: 12px; }
.sec-details > summary, .sec-toggle > summary, .sec-actions summary { list-style: none; display: inline-flex; cursor: pointer; }
.sec-details > summary::-webkit-details-marker, .sec-toggle > summary::-webkit-details-marker, .sec-actions summary::-webkit-details-marker { display: none; }
.sec-toggle[open] { flex-basis: 100%; }
.mt { margin-top: 10px; }
.sec-form > .btn { margin-top: 14px; }
.sec-actions .btn.active { border-color: var(--primary2); color: var(--primary2); }
.pw-wrap { position: relative; flex: 1; min-width: 0; }
.pw-wrap > input { padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted, #888); cursor: pointer; }
.pw-eye:hover { color: var(--text); }
.linkish { background: none; border: 0; padding: 0; color: var(--primary2); font: inherit; cursor: pointer; text-decoration: underline; }
.auth-card form.center { margin-top: 12px; }
/* Nút to (cả hàng) nằm ngay dưới ô nhập -> luôn cách ra */
form :is(input, select, textarea, .captcha-row, .pw-wrap, .cf-turnstile) + :is(.btn-block, .btn-lg) { margin-top: 14px; }
/* Chống spam: trang yêu cầu đăng nhập & đếm ngược khi thao tác quá nhanh */
.gate-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.gate-body .auth-wrap { width: 100%; padding: 0; }
.gate-card { text-align: center; }
.gate-card h1 { font-size: 1.35rem; margin: 14px 0 18px; }
.gate-logo { display: inline-flex; justify-content: center; }
.gate-logo img { max-height: 64px; max-width: 220px; object-fit: contain; }
.gate-logo b { font-size: 1.4rem; }
.gate-actions { display: grid; gap: 10px; }
.slow-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1001; display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-size: .9rem; line-height: 1.35; }
.slow-toast b { color: var(--accent); font-variant-numeric: tabular-nums; }
.slow-toast.slow-static { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: calc(16px * var(--rk)); padding: 16px 20px; }
.slow-toast > span:last-child { min-width: 0; }
.slow-toast .spinner { flex: 0 0 auto; }
.slow-toast.shake { animation: slowShake .35s; }
.slow-toast.slow-static.shake { animation: none; }
.slow-shield { position: fixed; inset: 0; z-index: 1000; cursor: not-allowed; }
@keyframes slowShake { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
/* Popup nạp tiền thành công — luôn ở giữa màn hình (PC & mobile) */
.dp-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 6, 20, .7); backdrop-filter: blur(4px); animation: bcFade .15s ease; }
.dp-modal[hidden] { display: none; }
.dp-box { width: 100%; max-width: 380px; max-height: calc(100vh - 32px); overflow-y: auto; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: calc(22px * var(--rk)); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); padding: 26px 20px 20px; animation: dpPop .28s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes dpPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
.dp-check { width: 68px; height: 68px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(34, 197, 94, .15); color: #22c55e; box-shadow: 0 0 0 8px rgba(34, 197, 94, .07); }
.dp-check .ico { width: 40px; height: 40px; stroke-width: 2.2; }
.dp-box h3 { margin: 0; font-size: 1.2rem; }
.dp-amount { margin: 6px 0 16px; font-size: 2rem; font-weight: 800; color: #22c55e; font-variant-numeric: tabular-nums; }
.dp-lines { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: calc(14px * var(--rk)); background: var(--bg2); }
.dp-lines > div:not(.dp-arrow) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .92rem; }
.dp-lines span { color: var(--muted); }
.dp-lines b { font-variant-numeric: tabular-nums; }
.dp-after b { font-size: 1.15rem; color: var(--accent); }
.dp-arrow { display: flex; justify-content: center; color: var(--muted); height: 16px; }
.dp-arrow .ico { width: 16px; height: 16px; }
.dp-meta { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.dp-meta b { color: var(--text); }
.dp-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.dp-actions .btn { justify-content: center; }

/* ---------------- Cày thuê ---------------- */
.text-ok { color: var(--t-green); } .text-err { color: var(--t-red); } .right { text-align: right; }
.boost-tile .thumb { display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 14%, var(--bg2)); }
.boost-tile-art .ico { width: 64px; height: 64px; color: var(--primary-ink); }
.boost-tile-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: .75rem; font-weight: 800; }
.boost-tile-badge .ico { width: 13px; height: 13px; }

.bx-list { position: relative; --cols: var(--cols-pc, 4); --gap: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(var(--min-w, 160px), calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols))), 1fr)); gap: var(--gap); margin-bottom: 18px; }
/* khung hẹp (PC có cột giỏ hàng + quảng cáo 2 bên) -> tự giảm số cột, mỗi ô tối thiểu 160px */
.bx-list-icon { --cols: min(var(--cols-pc, 2), 2); --gap: 10px; --min-w: 260px; }
.bx-list.bx-scroll { overflow-y: auto; padding-right: 6px; scrollbar-width: thin; } /* cuộn hết khung thì trang tự cuộn tiếp */
.bx-item, a.bx-item { display: flex; position: relative; min-width: 0; color: var(--text); transition: border-color .15s, transform .15s; }
a.bx-item:hover { border-color: var(--primary2); }
.bx-item h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.bx-image { flex-direction: column; }
.bx-image .bx-thumb { position: relative; aspect-ratio: 16 / 10; margin: 10px 10px 0; border-radius: calc(12px * var(--rk)); overflow: hidden; background: var(--bg2); border: 1px solid var(--img-border, var(--border)); display: grid; place-items: center; }
.bx-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bx-thumb-ico { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 12%, var(--bg2)); }
.bx-thumb-ico .ico { width: 46%; height: 46%; max-width: 72px; max-height: 72px; }
.bx-image .bx-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; min-width: 0; }
.bx-image .bx-act, .bx-image .bx-body > .bx-foot:last-child { margin-top: auto; }
.bx-image .bx-act .btn { width: 100%; justify-content: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; overflow: hidden; }
.bx-desc { margin: 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.bx-desc.can-expand { cursor: pointer; }
.bx-desc.open { -webkit-line-clamp: unset; }
.bx-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bx-meta { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; }
.bx-meta .ico { width: 14px; height: 14px; }
.bx-price .price { font-size: 1.05rem; }
.bx-eta, .bx-sub { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; }
.bx-eta .ico, .bx-sub .ico { width: 14px; height: 14px; vertical-align: -2px; }
.bx-icon { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
a.bx-icon { align-items: center; }
.bx-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: calc(14px * var(--rk)); display: grid; place-items: center; color: var(--ic); background: color-mix(in srgb, var(--ic) 16%, transparent); border: 1px solid color-mix(in srgb, var(--ic) 35%, transparent); }
.bx-ico .ico { width: 26px; height: 26px; }
.bx-ico-sm { width: 36px; height: 36px; border-radius: calc(10px * var(--rk)); }
.bx-ico-sm .ico { width: 19px; height: 19px; }
.bx-icon .bx-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.bx-icon .bx-sub .bx-price { color: var(--text); font-size: .85rem; }
.bx-add-ico { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: calc(12px * var(--rk)); display: grid; place-items: center; cursor: pointer;
  background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 10px rgba(0, 0, 0, .3); transition: transform .12s, filter .12s; }
.bx-add-ico .ico { width: 21px; height: 21px; }
.bx-add-ico:hover { filter: brightness(1.08); }
.bx-add-ico:active { transform: scale(.94); }
.bx-add-ico:disabled { opacity: .6; cursor: default; }
.bx-add-ico.added { background: var(--t-green, #22c55e); }
.bx-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; text-align: right; }
.bx-side .ico { width: 18px; height: 18px; color: var(--muted); }
.bx-incart { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: .75rem; font-weight: 800; vertical-align: 2px; }
.bx-incart .ico { width: 12px; height: 12px; }
.bx-thumb .bx-incart { position: absolute; top: 8px; right: 8px; }
.bx-badge { position: absolute; top: -1px; left: -1px; z-index: 1; max-width: 70%; padding: 2px 9px; border-radius: var(--radius) 0 calc(10px * var(--rk)) 0; background: #dc2626; color: #fff; font-size: .75rem; font-weight: 800; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.bx-thumb .bx-badge { top: 8px; left: 8px; border-radius: 99px; }
.bx-paused { display: inline-flex; align-items: center; gap: 5px; color: var(--t-yellow); font-size: .82rem; font-weight: 600; }
.bx-paused .ico { width: 14px; height: 14px; }
.bx-item.is-paused { opacity: .7; }
[data-boost-add].added { background: var(--t-green, #22c55e); }

.bp-head h1 { font-size: 1.4rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; }
.bp-head h1 .muted { font-size: 1rem; font-weight: 500; }
.bp-head p { margin: 0 0 10px; }
.bp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.bp-chips::-webkit-scrollbar { display: none; }
.bp-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.bp-chips .chip .ico { width: 15px; height: 15px; }
.bp-chips .chip.active span { color: #fff !important; }
.bp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
.bp-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; border-radius: var(--radius); }
.bp-cart { margin: 0; }
.bp-cart h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin: 0 0 4px; }
.bp-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: .78rem; display: inline-grid; place-items: center; }
.bp-cart-note { margin: 0 0 10px; }
.bp-cart-note .ico { width: 13px; height: 13px; vertical-align: -2px; }
.bp-form h3 { font-size: .98rem; margin: 18px 0 4px; display: flex; align-items: center; gap: 6px; }
.bp-form .label { margin: 10px 0 5px; }
.bp-form .input-group { margin-bottom: 4px; }
.bp-form .mini-coupons { margin-top: 6px; }
#bCouponMsg:empty { display: none; }
.bp-agree { font-size: .88rem; }
.bp-total { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin: 6px 0 12px; border-radius: calc(12px * var(--rk)); background: var(--bg2); font-size: .9rem; }
.bp-total > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bp-total > div > span { color: var(--muted); }
.bp-total [hidden] { display: none !important; }
.bp-disc b { color: var(--t-green); }
.bp-grand { padding-top: 8px; border-top: 1px dashed var(--border); }
.bp-grand span { color: var(--text) !important; font-weight: 700; }
.bp-grand b { font-size: 1.3rem; color: var(--accent); }
.bp-fab { display: none; }
.bp-box { padding: 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 12px; }
.bp-box > .bx-list { margin-bottom: 0; }
.bp-box .bx-item { box-shadow: none; }
.bp-desc { padding: 12px 14px; border-radius: calc(12px * var(--rk)); background: color-mix(in srgb, var(--primary) 7%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); font-size: .9rem; line-height: 1.55; color: var(--text); }
.bp-empty { text-align: center; padding: 24px 10px; }
.bp-terms { text-align: left; max-width: 480px; }
.bp-terms-text { max-height: 50vh; overflow-y: auto; margin-top: 12px; font-size: .9rem; line-height: 1.55; color: var(--text); }

.ck-cart { display: flex; flex-direction: column; gap: 8px; }
.ck-empty { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px dashed var(--border); border-radius: calc(12px * var(--rk)); color: var(--muted); font-size: .86rem; }
.ck-empty .ico { width: 22px; height: 22px; flex: 0 0 auto; }
.ck-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico info del" "ico qty line"; gap: 6px 10px; align-items: center; padding: 10px; border-radius: calc(12px * var(--rk)); background: var(--bg2); border: 1px solid var(--border); }
.ck-row > .bx-ico { grid-area: ico; align-self: start; }
.ck-info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }
.ck-info b { font-size: .9rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-warn { color: var(--t-yellow); display: flex; align-items: center; gap: 4px; }
.ck-warn .ico { width: 13px; height: 13px; }
.ck-qty { grid-area: qty; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 99px; overflow: hidden; width: max-content; background: var(--card); }
.ck-qty button { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text); font-size: 1.05rem; cursor: pointer; }
.ck-qty button:disabled { opacity: .35; cursor: default; }
.ck-qty input { width: 42px; height: 30px; padding: 0; border: 0; border-radius: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.ck-qty input::-webkit-outer-spin-button, .ck-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ck-qty input:focus { box-shadow: none; }
.ck-line { grid-area: line; text-align: right; color: var(--accent); font-size: .92rem; }
.ck-del { grid-area: del; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; justify-self: end; }
.ck-del:hover { color: var(--t-red); background: rgba(239, 68, 68, .12); }
.ck-del .ico { width: 16px; height: 16px; }
.ck-subtotal { display: flex; justify-content: space-between; padding: 4px 2px 0; font-size: .9rem; }
.ck-subtotal span { color: var(--muted); }

.bo-filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.bo-st { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; --tc: #3b82f6; background: color-mix(in srgb, var(--tc) 16%, transparent); color: color-mix(in srgb, var(--tc) 70%, #fff); }
.bo-blue { --tc: #3b82f6; } .bo-yellow { --tc: #eab308; } .bo-orange { --tc: #f97316; } .bo-green { --tc: #22c55e; } .bo-red { --tc: #ef4444; }
.bo-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.bo-wrap > .card { margin: 0; }
.bo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.bo-head h2 { margin: 0 0 2px; font-size: 1.2rem; }
.bo-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.bo-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; font-size: .8rem; color: var(--muted); }
.bo-step span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border); background: var(--bg2); font-weight: 800; z-index: 1; }
.bo-step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--border); }
.bo-step.is-done span { background: #22c55e; border-color: #22c55e; color: #fff; }
.bo-step.is-done:not(:last-child)::after { background: #22c55e; }
.bo-step.is-now span { border-color: var(--primary2); color: var(--primary2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary2) 20%, transparent); }
.bo-step.is-now b { color: var(--text); }
.bo-update { padding: 14px; margin-bottom: 16px; border-radius: calc(12px * var(--rk)); border: 1px solid rgba(249, 115, 22, .4); background: rgba(249, 115, 22, .07); }
.bo-update h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.bo-items { margin-top: 6px; }
.bo-items th, .bo-items td.right { white-space: nowrap; }
.bo-sum { margin-bottom: 12px; }
.bo-proof { margin: 12px 0; display: grid; gap: 8px; }
.bo-proof img { display: block; max-width: 100%; max-height: 420px; border-radius: calc(10px * var(--rk)); border: 1px solid var(--border); background: var(--bg2); }
.bo-info { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: calc(10px * var(--rk)); background: var(--bg2); }
.bo-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.bo-actions form { margin: 0; }
.bo-side h3 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.bo-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.bo-timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; --tc: #3b82f6; }
.bo-timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 0 3px var(--card); }
.bo-timeline li b { font-size: .9rem; }
.bo-timeline p { margin: 2px 0 0; color: var(--text); }

@media (max-width: 960px) {
  .bp-layout, .bo-wrap { grid-template-columns: minmax(0, 1fr); }
  .bp-side { position: static; max-height: none; overflow: visible; scroll-margin-top: 76px; }
  .bp-fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90; padding: 12px 18px; border: 0; border-radius: 99px; background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); cursor: pointer; transition: transform .2s, opacity .2s; }
  .bp-fab[hidden], .bp-fab.away { transform: translateY(140%); opacity: 0; pointer-events: none; display: inline-flex; }
  .bp-fab .ico { width: 18px; height: 18px; }
  .bp-fab span { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--on-primary); color: var(--primary2); font-size: .78rem; display: inline-grid; place-items: center; }
}
@media (max-width: 720px) {
  .bx-list { --cols: var(--cols-m, 2); --gap: 10px; --min-w: 0px; }
  .bx-list-icon { --cols: 1; --gap: 8px; }
  .bx-item h3 { font-size: .9rem; }
  .bx-image .bx-thumb { margin: 8px 8px 0; }
  .bx-image .bx-body { padding: 10px; gap: 6px; }
  .bx-image .bx-act .btn { padding: 8px 6px; font-size: .8rem; }
  .bx-add-ico { width: 40px; height: 40px; }
  .bx-price .price { font-size: .95rem; }
  .bx-icon { padding: 10px; gap: 10px; }
  .bx-ico { width: 42px; height: 42px; }
  .bx-ico .ico { width: 22px; height: 22px; }
  .bx-side { gap: 2px; }
  .bx-side .bx-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; white-space: nowrap; }
  .bx-side .bx-price .price { font-size: .9rem; }
  .bp-head h1 { font-size: 1.15rem; }
  .bp-box { padding: 10px; gap: 10px; }
  .bp-desc { padding: 10px 12px; font-size: .86rem; }
  .bo-head { flex-direction: column; }
  .bo-step b { font-size: .72rem; }
}

/* ---------- Tin tức / Hướng dẫn ---------- */
.post-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.post-n { opacity: .7; font-size: .8em; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 18px; }
.post-card { display: flex; flex-direction: column; color: var(--text); transition: border-color .15s, transform .15s; }
.post-card:hover { border-color: var(--primary2); transform: translateY(-2px); }
.post-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg2); display: grid; place-items: center; overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb > span:first-child .ico { width: 40px; height: 40px; color: var(--muted); }
.post-cat { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 99px; background: var(--primary); color: var(--on-primary); font-size: .75rem; font-weight: 700; }
.post-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-body h3 { margin: 0; font-size: 1rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-body p { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; }
.post-meta span, .post-meta a { display: inline-flex; align-items: center; gap: 4px; }
.post-meta .ico { width: 14px; height: 14px; }
.post-wrap { max-width: 820px; margin: 0 auto 24px; }
.post-head h1 { margin: 6px 0 10px; font-size: clamp(1.4rem, 3.4vw, 2rem); line-height: 1.3; }
.post-cat-link { display: inline-block; padding: 3px 12px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary2); font-size: .8rem; font-weight: 700; }
.post-cover { width: 100%; border-radius: var(--radius); margin: 16px 0; aspect-ratio: 16 / 9; object-fit: cover; }
.post-toc { padding: 12px 16px; margin: 16px 0; }
.post-toc summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.post-toc ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.post-toc li.lv3 { margin-left: 16px; list-style: circle; }
.post-content { font-size: 1.02rem; line-height: 1.8; overflow-wrap: anywhere; }
.post-content h2 { font-size: 1.35rem; margin: 28px 0 10px; scroll-margin-top: 80px; }
.post-content h3 { font-size: 1.15rem; margin: 22px 0 8px; scroll-margin-top: 80px; }
.post-content p { margin: 0 0 14px; }
.post-content ul, .post-content ol { padding-left: 22px; margin: 0 0 14px; }
.post-content li { margin-bottom: 6px; }
.post-content a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.post-content img { max-width: 100%; height: auto; border-radius: calc(10px * var(--rk)); }
.post-content blockquote { margin: 0 0 14px; padding: 10px 16px; border-left: 4px solid var(--primary); background: var(--bg2); border-radius: 0 10px 10px 0; }
.post-table { overflow-x: auto; margin: 0 0 14px; }
.post-content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.post-content th { background: var(--bg2); }
.post-content a.post-card-link { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--text); text-decoration: none; }
.post-content a.post-card-link:hover { border-color: var(--primary2); }
.post-card-link img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; margin: 0; flex-shrink: 0; }
.pcl-ico { font-size: 1.6rem; }
.pcl-body { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.4; }
.pcl-body small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcl-price { color: var(--accent); font-weight: 800; white-space: nowrap; }
.pcl-go { color: var(--primary-ink); font-weight: 700; white-space: nowrap; font-size: .9rem; }
.post-faq { margin-top: 28px; }
.post-faq details { padding: 12px 16px; margin-bottom: 10px; }
.post-faq summary { cursor: pointer; font-weight: 700; }
.post-faq details p { margin: 10px 0 0; line-height: 1.7; }
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; gap: 12px; }
  .pcl-go { display: none; }
}

/* ---------- Nút / thanh Hỗ trợ ---------- */
.sp { position: fixed; z-index: 45; --sp-w: min(290px, calc(100vw - 72px)); font-size: .92rem; }
.sp-btn { border: 0; cursor: pointer; color: #fff; background: var(--sp-c); display: flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; box-shadow: 0 8px 22px color-mix(in srgb, var(--sp-c) 45%, transparent); }
.sp-btn .ico { width: 24px; height: 24px; }
.sp-panel { width: var(--sp-w); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); padding: 14px; }
.sp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 2px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sp-head b { display: block; font-size: 1.02rem; }
.sp-head small { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-top: 3px; }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.sp-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; display: grid; place-items: center; }
.sp-x:hover { background: var(--bg2); color: var(--text); }
.sp-x .ico { width: 18px; height: 18px; }
.sp-items { display: grid; gap: 4px; max-height: min(60vh, 420px); overflow-y: auto; }
.sp-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--text); transition: background .15s; }
.sp-item:hover { background: var(--bg2); }
.sp-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.sp-ic .ico { width: 22px; height: 22px; }
.sp-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sp-tx b { font-size: .95rem; }
.sp-tx small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kiểu nút tròn ở góc */
.sp-corner .sp-btn { width: 58px; height: 58px; border-radius: 50%; position: relative; }
.sp-corner .sp-btn::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--sp-c); opacity: 0; animation: sp-pulse 2.4s ease-out infinite; }
.sp-corner.open .sp-btn::after { animation: none; }
@keyframes sp-pulse { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.sp-corner .sp-panel { position: absolute; opacity: 0; visibility: hidden; transform: translateY(8px) scale(.97); transition: opacity .2s, transform .2s, visibility .2s; }
.sp-corner.open .sp-panel { opacity: 1; visibility: visible; transform: none; }
.sp-br { right: 16px; bottom: 18px; } .sp-bl { left: 16px; bottom: 18px; }
.sp-tr { right: 16px; top: 120px; } .sp-tl { left: 16px; top: 120px; }
.sp-br .sp-panel { right: 0; bottom: calc(100% + 12px); transform-origin: bottom right; }
.sp-bl .sp-panel { left: 0; bottom: calc(100% + 12px); transform-origin: bottom left; }
.sp-tr .sp-panel { right: 0; top: calc(100% + 12px); transform-origin: top right; }
.sp-tl .sp-panel { left: 0; top: calc(100% + 12px); transform-origin: top left; }

/* Kiểu thanh bên: thu lại chỉ còn tab dính cạnh màn hình */
.sp-side { top: 50%; display: flex; align-items: center; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.sp-side.sp-right { right: 0; transform: translate(var(--sp-w), -50%); }
.sp-side.sp-left { left: 0; flex-direction: row-reverse; transform: translate(calc(-1 * var(--sp-w)), -50%); }
.sp-side.open { transform: translate(0, -50%); }
.sp-side .sp-btn { flex-direction: column; padding: 14px 9px; gap: 8px; }
.sp-side .sp-btn span { writing-mode: vertical-rl; letter-spacing: .5px; font-size: .85rem; }
.sp-side.sp-left .sp-btn span { transform: rotate(180deg); }
.sp-side.sp-right .sp-btn { border-radius: 14px 0 0 14px; }
.sp-side.sp-left .sp-btn { border-radius: 0 14px 14px 0; }
.sp-side .sp-btn .ico { width: 22px; height: 22px; }
.sp-side.sp-right .sp-panel { border-radius: 18px 0 0 18px; border-right: 0; }
.sp-side.sp-left .sp-panel { border-radius: 0 18px 18px 0; border-left: 0; }
@media (max-width: 720px) {
  .sp-dev-pc { display: none !important; }
  .sp-br, .sp-bl { bottom: 84px; }
  .sp-tr, .sp-tl { top: 140px; }
  .sp-corner .sp-btn { width: 52px; height: 52px; }
}
@media (min-width: 721px) { .sp-dev-mobile { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .sp-side, .sp-corner .sp-panel { transition: none; } .sp-corner .sp-btn::after { animation: none; } }

/* ---------- Chat trực tiếp (khách) — màu & bo góc theo Cài đặt giao diện của khách ---------- */
.ch-fab, .ch-panel { --ch-c: var(--primary); }
.sp-ic-chat { background: var(--primary); color: var(--on-primary); }
.ch-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); line-height: 1; }
.ch-badge[hidden] { display: none; }
.sp-item-badge { position: static; margin-left: auto; flex-shrink: 0; border: 0; }
.sp-btn { position: relative; }
.ch-fab { position: fixed; bottom: 20px; z-index: 46; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; background: var(--primary); color: var(--on-primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .4); transition: transform .15s; }
.ch-fab:hover { transform: scale(1.06); }
.ch-fab .ico { width: 26px; height: 26px; }
.ch-fab.ch-br { right: 20px; }
.ch-fab.ch-bl { left: 20px; }
.ch-panel { position: fixed; bottom: 20px; z-index: 120; width: 370px; height: min(600px, calc(100vh - 40px)); height: min(600px, calc(100dvh - 40px)); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); display: none; flex-direction: column; overflow: hidden; font-size: .93rem; border-radius: calc(18px * var(--rk)); }
.ch-panel.open { display: flex; }
.ch-panel.ch-br { right: 20px; }
.ch-panel.ch-bl { left: 20px; }
.ch-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--primary); color: var(--on-primary); flex-shrink: 0; }
.ch-av { width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--on-primary) 16%, transparent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.ch-ht { flex: 1; min-width: 0; }
.ch-ht b { display: block; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-ht small { display: flex; align-items: center; gap: 6px; opacity: .9; font-size: .78rem; }
.ch-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .3); }
.ch-x { border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ch-x:hover { background: rgba(255, 255, 255, .28); }
.ch-body { flex: 1; overflow-y: auto; padding: 14px 12px 6px; overscroll-behavior: contain; background: var(--bg2); }
.ch-list { display: flex; flex-direction: column; gap: 6px; }
.ch-row { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.ch-row.me { align-self: flex-end; align-items: flex-end; }
.ch-row.them { align-self: flex-start; align-items: flex-start; }
.ch-name { font-size: .72rem; color: var(--muted); padding: 0 6px; display: flex; align-items: center; gap: 4px; }
.ch-ai { background: color-mix(in srgb, var(--ch-c) 22%, transparent); color: var(--text); border-radius: 4px; padding: 0 4px; font-size: .62rem; font-weight: 800; }
.ch-b { padding: 8px 12px; border-radius: 16px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.ch-row.them .ch-b { background: var(--card2); border-bottom-left-radius: 5px; }
.ch-row.me .ch-b { background: var(--ch-c); color: #fff; border-bottom-right-radius: 5px; }
.ch-b a { color: inherit; text-decoration: underline; }
.ch-t { font-size: .66rem; color: var(--muted); padding: 0 6px; }
.ch-img img { display: block; max-width: 220px; max-height: 260px; border-radius: 12px; object-fit: cover; cursor: zoom-in; }
.ch-sys { align-self: center; max-width: 90%; text-align: center; font-size: .78rem; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.ch-seen { align-self: flex-end; font-size: .68rem; color: var(--muted); padding: 0 6px; margin-top: -2px; }
.ch-typing { display: inline-flex; gap: 4px; padding: 10px 12px; margin: 6px 0 4px; background: var(--card2); border-radius: 16px; border-bottom-left-radius: 5px; }
.ch-typing[hidden] { display: none; }
.ch-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chDot 1.2s infinite; }
.ch-typing span:nth-child(2) { animation-delay: .15s; }
.ch-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.ch-ref { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); color: var(--text); text-decoration: none; max-width: 260px; }
.ch-ref:hover { border-color: var(--ch-c); }
.ch-ref-ic { width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--ch-c) 20%, transparent); color: var(--ch-c); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ch-ref b { display: block; font-size: .85rem; }
.ch-ref small { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.ch-foot { border-top: 1px solid var(--border); background: var(--card); flex-shrink: 0; position: relative; }
.ch-compose { display: flex; align-items: flex-end; gap: 4px; padding: 8px; }
.ch-compose textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; min-height: 40px; padding: 9px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font: inherit; line-height: 1.35; outline: none; }
.ch-compose textarea:focus { border-color: var(--ch-c); }
.ch-tool, .ch-send { width: 38px; height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 10px; flex-shrink: 0; margin: 0; }
.ch-tool:hover { color: var(--ch-c); background: var(--bg2); }
.ch-send { color: var(--ch-c); }
.ch-left { font-size: .74rem; color: var(--muted); padding: 6px 12px 0; }
.ch-left a { color: var(--ch-c); }
.ch-orders { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .3); padding: 6px; }
.ch-orders[hidden] { display: none; }
.ch-o-head { font-size: .78rem; color: var(--muted); padding: 4px 8px 6px; }
.ch-o-empty { padding: 14px; text-align: center; color: var(--muted); font-size: .85rem; }
.ch-o { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: 8px 10px; border-radius: 10px; cursor: pointer; font: inherit; }
.ch-o:hover { background: var(--bg2); }
.ch-o b { font-size: .84rem; margin-right: 6px; }
.ch-o span { font-size: .8rem; }
.ch-o small { display: block; color: var(--muted); font-size: .72rem; }
.ch-start, .ch-login { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ch-start p, .ch-login p { margin: 0; font-size: .85rem; color: var(--muted); }
.ch-start input:not(.ch-hp) { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); font: inherit; }
.ch-start small { color: var(--muted); font-size: .78rem; text-align: center; }
.ch-start small a, .ch-login a:not(.btn) { color: var(--ch-c); }
.ch-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ch-login div { display: flex; gap: 8px; }
.ch-login .btn { flex: 1; justify-content: center; }
.ch-note { padding: 14px; text-align: center; color: var(--muted); font-size: .85rem; }
.ch-toast { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); max-width: 90%; background: rgba(15, 13, 26, .92); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: .82rem; text-align: center; z-index: 2; }
.ch-lb { position: fixed; inset: 0; z-index: 130; background: rgba(0, 0, 0, .88); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.ch-lb img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.ch-lb button { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: #000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-backdrop { position: fixed; inset: 0; z-index: 119; background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); display: none; }
.ch-backdrop.open { display: block; }
.ch-panel.ch-center { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 48px)); height: min(760px, calc(100vh - 48px)); height: min(760px, calc(100dvh - 48px)); border-radius: calc(20px * var(--rk)); }
.ch-panel.ch-center .ch-body { padding: 18px 22px 8px; }
.ch-panel.ch-center .ch-row { max-width: 72%; }
.ch-panel.ch-center .ch-img img { max-width: 320px; max-height: 340px; }
html.ch-lock:has(.ch-backdrop.open), html.ch-lock:has(.ch-backdrop.open) body { overflow: hidden; }
@media (max-width: 560px) {
  .ch-panel, .ch-panel.ch-br, .ch-panel.ch-bl, .ch-panel.ch-center { inset: 0; width: auto; height: 100%; border-radius: 0; border: 0; transform: none; }
  .ch-backdrop.open { display: none; }
  html.ch-lock, html.ch-lock body { overflow: hidden; }
  .ch-fab { bottom: 16px; width: 52px; height: 52px; }
  .ch-fab.ch-br { right: 16px; } .ch-fab.ch-bl { left: 16px; }
  .ch-compose textarea { font-size: 16px; }
}

/* ---------- Chi tiết tài khoản (trang sản phẩm) ---------- */
.acd-sec { background: var(--card2); border: 1px solid var(--border); border-radius: calc(14px * var(--rk)); padding: 12px; }
.acd-sec + .acd-sec { margin-top: 12px; }
.acd-sec .acd-item { background: var(--card); }
.acd-item.acd-hide { display: none; }
.acd-more { display: block; width: 100%; margin-top: 10px; padding: 8px 12px; border-radius: calc(10px * var(--rk)); border: 1px dashed var(--border); background: transparent; color: var(--primary-ink); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.acd-more:hover { background: var(--bg2); }
.acd-more[hidden] { display: none; }
.acd-sec h3 { display: flex; align-items: center; gap: 8px; font-size: .98rem; margin: 0 0 10px; }
.acd-sec h3 small { font-size: .74rem; color: var(--muted); background: var(--bg2); padding: 1px 9px; border-radius: 99px; }
.acd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px; }
.acd-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 9px; border-radius: calc(12px * var(--rk)); background: var(--card2); border: 1px solid var(--border); text-align: center; min-width: 0; }
.acd-item b { font-size: .76rem; font-weight: 600; line-height: 1.25; width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.acd-ic { width: 64px; height: 64px; border-radius: calc(12px * var(--rk)); overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; color: #fff; }
.acd-ic img { width: 100%; height: 100%; object-fit: cover; }
.acd-item.r5 .acd-ic { background: linear-gradient(160deg, #a5662f, #e3a64f); }
.acd-item.r4 .acd-ic { background: linear-gradient(160deg, #5e4aa0, #9a78d6); }
.acd-badge { position: absolute; top: 4px; right: 4px; font-size: .68rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; background: rgba(0, 0, 0, .62); color: #fff; }
@media (max-width: 560px) { .acd-sec { padding: 10px 8px; } .acd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; } .acd-ic { width: 52px; height: 52px; } .acd-item { padding: 6px 3px 7px; } .acd-item b { font-size: .7rem; } }

/* ---------- Bộ lọc tìm kiếm trang danh mục ---------- */
.sf { padding: 16px; margin-bottom: 18px; position: relative; z-index: 6; overflow: visible; }
.sf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px 14px; }
.sf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sf-field > label { font-size: .86rem; font-weight: 700; color: var(--text-strong); }
.sf-field select, .sf-field input { width: 100%; min-width: 0; }
.sf-search { position: relative; }
.sf-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.sf-search input { padding-left: 38px; }
.sf-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sf-mode { display: inline-flex; gap: 4px; padding: 4px; border-radius: calc(12px * var(--rk)); background: var(--bg2); }
.sf-mode button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: .84rem; padding: 7px 12px; border-radius: calc(9px * var(--rk)); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.sf-mode button .ico { width: 16px; height: 16px; }
.sf-mode button.on { background: var(--card2); color: var(--accent); }
.sf-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.sf-btns .ico { width: 16px; height: 16px; }
.ms { position: relative; }
.ms-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; font: inherit; color: var(--muted); background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; min-height: 44px; }
.ms.has .ms-btn { color: var(--text); }
.ms.open .ms-btn { border-color: var(--accent); }
.ms-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-btn .ico { width: 16px; height: 16px; flex-shrink: 0; transition: transform .15s; }
.ms.open .ms-btn .ico { transform: rotate(180deg); }
.ms-panel { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ms-panel[hidden] { display: none; }
.ms-search { position: relative; border-bottom: 1px solid var(--border); }
.ms-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.ms-search input { width: 100%; border: 0; border-radius: 0; background: transparent; padding: 11px 12px 11px 36px; }
.ms-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.ms-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; border-radius: calc(8px * var(--rk)); cursor: pointer; }
.ms-row:hover { background: var(--bg2); }
.ms-row img, .ms-noimg { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; background: var(--bg2); flex-shrink: 0; }
.ms-ck { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border); flex-shrink: 0; position: relative; }
.ms-row.on .ms-ck { background: var(--accent); border-color: var(--accent); }
.ms-row.on .ms-ck::after { content: ''; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ms-empty { padding: 14px; text-align: center; color: var(--muted); font-size: .86rem; }
.sf-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: var(--muted); font-size: .88rem; }
.sf-more[hidden] { display: none; }
.sf-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: sfspin .8s linear infinite; }
@keyframes sfspin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .sf-foot { flex-direction: column; align-items: stretch; } .sf-mode { justify-content: center; } .sf-btns .btn { flex: 1; justify-content: center; } }

/* Thẻ Acc VIP có dữ liệu HoYoLAB: dòng icon nhân vật / vũ khí tự chạy ngang + 4 thông tin dạng chấm */
.product-card.has-acc .product-title { font-size: var(--pc-title, 14.4px); min-height: 2.5em; }
.product-card.has-acc .price-box .price { font-size: var(--pc-price, 16px); }
.pc-roll { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 10px), transparent); }
.product-card .card-body > .pc-roll + .pc-roll { margin-top: -4px !important; }
.pc-track { display: flex; width: max-content; }
.pc-ic { flex: 0 0 auto; width: var(--pc-ic, 27px); height: var(--pc-ic, 27px); margin-right: 4px; border-radius: calc(6px * var(--rk)); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 800; color: #fff; background: linear-gradient(160deg, #8a8fa3, #b7bccb); }
.pc-ic.r5 { background: linear-gradient(160deg, #a5662f, #e3a64f); }
.pc-ic.r4 { background: linear-gradient(160deg, #5e4aa0, #9a78d6); }
.pc-ic img { width: 100%; height: 100%; object-fit: cover; }
.pc-roll.run .pc-track { animation: pcroll var(--dur, 30s) linear infinite; will-change: transform; }
.pc-roll.off .pc-track, a.product-card:hover .pc-roll .pc-track { animation-play-state: paused; }
@keyframes pcroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .pc-roll.run .pc-track { animation: none; } }
.product-card .attrs.attrs-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; padding: 0; background: none; border: 0; font-size: var(--pc-info, 11.5px); }
.product-card .attrs.attrs-acc li { justify-content: flex-start; gap: 4px; }
.product-card .attrs.attrs-acc li::before { content: '•'; color: var(--muted); }
.product-card .attrs.attrs-acc span::after { content: ':'; }
.product-card .attrs.attrs-acc b { text-align: left; }
@media (max-width: 560px) { .pc-ic { width: var(--mb-ic, 21px); height: var(--mb-ic, 21px); margin-right: 3px; border-radius: calc(5px * var(--rk)); font-size: .6rem; } .product-card .card-body > .pc-roll + .pc-roll { margin-top: -6px !important; } .product-card .attrs.attrs-acc { grid-template-columns: auto auto; justify-content: space-between; gap: 1px 6px; font-size: var(--mb-info, 9.3px); } .product-card .attrs.attrs-acc li { gap: 3px; } .product-card.has-acc .product-title { font-size: var(--mb-title, 11.8px); min-height: 2.4em; } .product-card.has-acc .price-box .price { font-size: var(--mb-price, 12.5px); } }
.pc-roll.static { overflow-x: auto; scrollbar-width: none; }
.pc-roll.static::-webkit-scrollbar { display: none; }

/* Nền trang (admin -> Giao diện -> Nền trang) */
.site-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.site-bg-img, .site-bg-v { position: absolute; inset: 0; width: 100%; height: 100%; background: center / cover no-repeat; object-fit: cover; }
.site-bg.blur .site-bg-img, .site-bg.blur .site-bg-v { filter: blur(var(--b)); transform: scale(1.05); }
.site-bg-v { opacity: 0; transition: opacity .6s; }
.site-bg-v.on { opacity: 1; }
.site-bg-o { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--o)); }

/* Nguồn hàng API (trang khách) */
.as-page { --as-name: var(--as-name-pc, 15px); --as-desc: var(--as-desc-pc, 13px); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 720px) { .as-page { --as-name: var(--as-name-mb, 14px); --as-desc: var(--as-desc-mb, 12px); gap: 12px; } }
.as-intro { margin: 0; }
.as-cat { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.as-cat-h { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.as-cat-h .muted { margin-left: auto; font-weight: 500; }
.as-cat-h img { border-radius: 8px; object-fit: contain; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.as-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; min-width: 0; box-shadow: none; background: var(--card2); line-height: var(--as-lh, 1.4); }
.as-item h3 { margin: 0; font-size: var(--as-name); line-height: var(--as-lh, 1.4); }
.as-item.is-out { opacity: .65; }
.as-desc { margin: 0; font-size: var(--as-desc); line-height: var(--as-lh, 1.4); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.as-desc.open { -webkit-line-clamp: unset; }
.as-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: calc(var(--as-desc) * .95); color: var(--muted); }
.as-meta span { display: inline-flex; align-items: center; gap: 4px; }
.as-meta svg { width: 13px; height: 13px; }
.as-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.as-price .price { font-size: calc(var(--as-name) + 1px); }
@media (max-width: 720px) { .as-cat { padding: 12px; } .as-grid { grid-template-columns: 1fr; gap: 8px; } .as-item { padding: 10px 12px; } }
.as-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 6, 15, .65); backdrop-filter: blur(3px); }
.as-modal[hidden] { display: none; }
.as-box { position: relative; width: 100%; max-width: 420px; padding: 20px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 32px); overflow-y: auto; }
.as-box h3 { margin: 0 30px 0 0; font-size: 1.1rem; }
.as-box p { margin: 0; }
.as-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.as-qty { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; }
.as-qty input { text-align: center; font-size: 1.1rem; font-weight: 700; }
.as-qty .btn { padding: 0; font-size: 1.3rem; }
.as-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.as-quick button { flex: 1 1 auto; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card2); color: var(--text); cursor: pointer; font: inherit; font-size: .82rem; }
.as-sum { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--card2); }
.as-sum div { display: flex; justify-content: space-between; gap: 10px; }
.as-sum .price { font-size: 1.15rem; }
.as-data { max-height: 360px; overflow: auto; white-space: pre; font-size: 12px; }
.as-st-checking, .as-st-processing { background: rgba(234, 179, 8, .15); color: var(--t-yellow); }
.as-st-completed { background: rgba(34, 197, 94, .15); color: var(--t-green); }
.as-st-refunded { background: rgba(239, 68, 68, .15); color: var(--t-red); }
.as-box [hidden] { display: none !important; }

/* Đơn hàng API */
.as-order { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.as-order-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.as-order-head h2 { margin: 0; font-size: 1.15rem; }
.as-kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.as-kv > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--card2); min-width: 0; }
.as-kv span { font-size: .75rem; color: var(--muted); }
.as-kv b { font-size: .92rem; overflow-wrap: anywhere; }
.as-kv-wide { grid-column: 1 / -1; }
.as-order .alert { margin: 0; }
.as-keep { display: flex; gap: 8px; align-items: flex-start; }
.as-keep svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
.as-datas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.as-dbox { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card2); }
.as-dhead { display: flex; flex-direction: column; gap: 2px; }
.as-dhead b { display: inline-flex; align-items: center; gap: 6px; }
.as-dhead small { overflow-wrap: anywhere; }
.as-data { margin: 0; max-height: 300px; overflow: auto; white-space: pre; font-size: 12px; line-height: 1.5; padding: 10px; border-radius: 8px; background: var(--bg2); }
.as-dact { display: flex; gap: 8px; flex-wrap: wrap; }
.as-dact .btn { flex: 1 1 auto; justify-content: center; }
@media (max-width: 720px) {
  .as-order { padding: 12px; gap: 10px; }
  .as-order-head h2 { font-size: 1rem; }
  .as-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .as-kv > div { padding: 6px 8px; }
  .as-kv b { font-size: .85rem; }
  .as-datas { grid-template-columns: 1fr; gap: 10px; }
  .as-dbox { padding: 10px; }
  .as-data { max-height: 170px; font-size: 11px; }
}

/* =====================================================================
   Tiêu đề + số liệu theo cấp (Admin -> Giao diện -> Thẻ sản phẩm)
   Cấp 1 game · 2 danh mục · 3 acc / reroll / dịch vụ cày thuê · 4 gói. Biến --alN / --jcN do card-ui.js xuất.
   ===================================================================== */
.game-card h3 { text-align: var(--al1, left); }
.game-card .card-stats { justify-content: var(--jc1, flex-start); }
.cat-card h3, .cat-card .card-desc { text-align: var(--al2, left); }
.cat-card .card-stats { justify-content: var(--jc2, flex-start); }
.product-card .product-title, .bx-cat h3 { text-align: var(--al3, left); }
.product-card .card-stats, .bx-cat .card-stats { justify-content: var(--jc3, flex-start); }
.bx-pkg h3, .bx-pkg .bx-desc { text-align: var(--al4, left); }
.bx-pkg .bx-sub, .bx-pkg .bx-eta, .bx-pkg .bx-foot { justify-content: var(--jc4, flex-start); }
/* Đầu trang (Acc VIP / Reroll / Nạp game / gói Cày thuê): điện thoại cho dòng phụ xuống hàng riêng, không mở đầu bằng dấu chấm */
@media (max-width: 720px) { .bp-head h1 > .muted { flex-basis: 100%; } .bp-head h1 .sep { display: none; } }
/* Thẻ dịch vụ cày thuê dùng chung bố cục thẻ danh mục: tên -> số liệu -> "Chỉ từ ... giá" */
.bx-cat .price-row { margin: 0; align-items: center; }
.bx-cat.bx-image .bx-body > .card-stats { margin-top: auto; }
.bx-cat.bx-image .bx-body > .card-stats + .bx-foot { margin-top: 0; }
/* Ẩn tiêu đề + tắt số liệu: khung ôm sát ảnh, không để khoảng trống */
.game-card.is-bare { padding-bottom: 10px; }
.game-card.is-bare .card-body { padding: 0; gap: 0; }
@media (max-width: 720px) {
  .game-card.is-bare, .cat-card.is-bare { padding-bottom: 7px; }
  .cat-card.is-bare .card-body { display: none; }
}
/* Nút mũi tên thẻ Acc VIP: cỡ theo "Nút mũi tên" trong Thẻ sản phẩm */
.product-card.has-acc .btn-view { width: calc(var(--pc-btn, 13px) * 2.9); height: calc(var(--pc-btn, 13px) * 2.9); }
.product-card.has-acc .btn-view .ico { width: calc(var(--pc-btn, 13px) * 1.5); height: calc(var(--pc-btn, 13px) * 1.5); }
@media (max-width: 560px) {
  .product-card.has-acc .btn-view { width: calc(var(--mb-btn, 11.2px) * 2.9); height: calc(var(--mb-btn, 11.2px) * 2.9); }
  .product-card.has-acc .btn-view .ico { width: calc(var(--mb-btn, 11.2px) * 1.5); height: calc(var(--mb-btn, 11.2px) * 1.5); }
}
