/* ============ ShopAcc - giao diện khách ============ */
:root {
  --bg: #0f0d1a;
  --bg2: #171428;
  --card: #1d1933;
  --card2: #252042;
  --border: #2f2952;
  --text: #ece9ff;
  --muted: #9a93c2;
  --primary: #7c3aed;
  --primary2: #a855f7;
  --accent: #f59e0b;
  --accent2: #f97316;
  --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 30px rgba(0, 0, 0, .35);
  --card-end: #1a1630;
  --text-strong: #fff;
  --on-primary: #fff;
  --primary-soft: color-mix(in srgb, var(--primary2) 55%, #fff);
  --glow1: color-mix(in srgb, var(--primary) 32%, var(--bg));
  --glow2: color-mix(in srgb, var(--primary2) 16%, var(--bg));
  --topbar-bg: color-mix(in srgb, var(--bg) 88%, transparent);
  --catbar-bg: color-mix(in srgb, var(--bg2) 72%, 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: radial-gradient(1200px 600px at 10% -10%, var(--glow1) 0%, transparent 60%), radial-gradient(900px 500px at 110% 10%, var(--glow2) 0%, transparent 60%), var(--bg);
  background-attachment: fixed; color: var(--text); line-height: 1.55; font-size: 15px;
}
a { color: var(--primary2); text-decoration: none; }
a:hover { color: var(--primary-soft); }
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: linear-gradient(135deg, var(--primary), var(--primary2)); color: var(--on-primary); }
.btn-primary:hover { color: var(--on-primary); }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1a1000; }
.btn-accent:hover { color: #1a1000; }
.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; }
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 ---------- */
.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: var(--red); color: #fff; font-size: .62rem; padding: 1px 5px; border-radius: calc(4px * var(--rk)); vertical-align: top; font-weight: 700; }
.notice { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 25%, transparent), rgba(245, 158, 11, .2)); border-bottom: 1px solid var(--border); font-size: .9rem; }
.marquee { overflow: hidden; white-space: nowrap; padding: 8px 0; }
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 22s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- 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: linear-gradient(180deg, var(--card), var(--card-end)); 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(-4px); border-color: var(--primary2); box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 25%, transparent); }
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: linear-gradient(135deg, #ef4444, #f97316); }
.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); 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; background: linear-gradient(135deg, var(--primary-soft), var(--primary2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.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(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.game-card h3, .cat-card h3 { margin-bottom: 8px; }
.game-card { border-top: 3px solid var(--c, var(--primary)); }
.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: linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, transparent), 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 { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.coupon { display: flex; background: var(--card); border: 1px dashed var(--accent); border-radius: calc(14px * var(--rk)); overflow: hidden; }
.coupon-value { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1a1000; font-weight: 900; font-size: 1.35rem; min-width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; position: relative; }
.coupon-value small { font-size: .7rem; letter-spacing: 2px; }
.coupon-info { padding: 12px 14px; flex: 1; }
.coupon-code { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.coupon-code code { font-size: 1.05rem; font-weight: 800; color: var(--accent); }
.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: #fff; }
.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(148, 163, 184, .15); color: #cbd5e1; }
.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); }

/* ---------- 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: #fff; }
.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 { color: var(--text); margin: 0 0 10px; }
.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; background: linear-gradient(135deg, var(--primary2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.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; max-width: 520px; }
.popup-box img { border-radius: calc(14px * var(--rk)); }
.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; }
  .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(2, 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(--primary2); }
.logo-mark .ico { width: 30px; height: 30px; color: var(--primary2); }
.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; }

/* ---------- Ô thống kê trên thẻ game / danh mục (đủ chỗ cho số hàng nghìn) ---------- */
.stat-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-box { min-width: 0; background: color-mix(in srgb, var(--primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--primary2) 28%, transparent); border-radius: calc(10px * var(--rk)); padding: 7px 9px; text-align: center; }
.stat-box.sold { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .28); }
.stat-label { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.stat-label .ico { width: 13px; height: 13px; }
.stat-box b { display: block; font-size: clamp(.9rem, 2.4vw, 1.05rem); line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--text-strong); }
.stat-box.sold b { color: var(--t-green); }
.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; } .stat-label { font-size: .66rem; } .stat-box { padding: 6px 4px; } }

/* ---------- Ô 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(--primary2); }
}

/* ---------- Thẻ sản phẩm: mã góc trên trái, giá trong khung + nút Xem ngay ---------- */
.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(10, 8, 25, .72); backdrop-filter: blur(4px); 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: stretch; }
.price-box { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border-radius: calc(10px * var(--rk)); background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); }
.price-box .price { font-size: 1.05rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-box del { font-size: .74rem; margin: 0; line-height: 1.2; }
.btn-view { padding: 8px 14px; font-size: .88rem; border-radius: calc(10px * var(--rk)); }
@media (max-width: 720px) {
  .buy-row { grid-template-columns: 1fr; }
  .price-box { align-items: center; text-align: center; }
  .btn-view { width: 100%; }
}

/* ---------- Ả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); }
.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: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(249, 115, 22, .06)); border: 1px solid rgba(245, 158, 11, .35); }
.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: .74rem; 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(--primary2); }
.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(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .product-grid-4 { grid-template-columns: repeat(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(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-body > .btn, .cat-card .card-body > .btn { 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); border: 1px solid var(--border); font-size: .74rem; 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 { padding: 5px 10px; }
.product-card .price-box .price { font-size: 1rem; overflow: visible; text-overflow: clip; }
.product-card .btn-view { padding: 7px 12px; font-size: .82rem; border-radius: calc(9px * var(--rk)); }

@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: .68rem; padding: 6px 8px; gap: 3px; }
  /* Danh mục: bỏ "Chỉ từ", chỉ còn nút Xem sản phẩm */
  .cat-price { display: none !important; }
  .game-card .btn, .cat-card .btn { padding: 8px 10px; font-size: .82rem; border-radius: calc(9px * var(--rk)); }
  /* Giá + nút Xem cùng 1 hàng, thu nhỏ */
  .buy-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
  .price-box { align-items: flex-start; text-align: left; padding: 4px 8px; border-radius: calc(8px * var(--rk)); }
  .price-box .price { font-size: .86rem; }
  .price-box del { font-size: .64rem; }
  .btn-view { width: auto; padding: 6px 10px; font-size: .78rem; border-radius: calc(8px * var(--rk)); }
}
@media (max-width: 420px) { .hide-xs { display: none; } }
@media (max-width: 720px) {
  .product-card .price-box { padding: 4px 8px; }
  .product-card .price-box .price { font-size: .86rem; }
  .product-card .btn-view { padding: 6px 10px; font-size: .78rem; border-radius: calc(8px * var(--rk)); }
}

/* =====================================================================
   Ả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(--primary-soft) 28%, 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-soft) 55%, 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: 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 --- */
html[data-bg="slate"] { --bg: #0b1120; --bg2: #111827; --card: #162033; --card2: #1e293b; --card-end: #131c2e; --border: #293548; --muted: #94a3b8; --text: #e2e8f0; }
html[data-bg="gray"]  { --bg: #0c0c0f; --bg2: #141418; --card: #1b1b20; --card2: #25252c; --card-end: #18181d; --border: #303038; --muted: #a1a1aa; --text: #ececf0; }
html[data-bg="zinc"]  { --bg: #09090b; --bg2: #111113; --card: #18181b; --card2: #222226; --card-end: #151517; --border: #2c2c31; --muted: #a1a1aa; --text: #f4f4f5; }
html[data-bg="stone"] { --bg: #0f0d0b; --bg2: #171412; --card: #1f1b18; --card2: #29241f; --card-end: #1b1815; --border: #36302a; --muted: #a8a29e; --text: #f5f5f4; }
/* --- Nền sáng --- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4fd; --bg2: #eeeaf9; --card: #ffffff; --card2: #f1eefb; --card-end: #fbfaff; --border: #e1dbf3; --muted: #6b6590; --text: #1e1a33;
  --text-strong: #0b0b12; --shadow: 0 6px 22px rgba(30, 26, 51, .08);
  --primary-soft: color-mix(in srgb, var(--primary) 80%, #000);
  --glow1: color-mix(in srgb, var(--primary) 14%, var(--bg)); --glow2: color-mix(in srgb, var(--primary2) 8%, var(--bg));
  --t-green: #15803d; --t-red: #b91c1c; --t-blue: #1d4ed8; --t-yellow: #a16207;
}
html[data-theme="light"][data-bg="slate"] { --bg: #f1f5f9; --bg2: #e8eef5; --card: #fff; --card2: #eef2f7; --card-end: #fafcfe; --border: #dbe3ec; --muted: #64748b; --text: #0f172a; }
html[data-theme="light"][data-bg="gray"]  { --bg: #f4f4f5; --bg2: #ececee; --card: #fff; --card2: #f0f0f2; --card-end: #fbfbfc; --border: #e2e2e6; --muted: #6b7280; --text: #18181b; }
html[data-theme="light"][data-bg="zinc"]  { --bg: #fafafa; --bg2: #f0f0f1; --card: #fff; --card2: #f4f4f5; --card-end: #fcfcfc; --border: #e4e4e7; --muted: #71717a; --text: #09090b; }
html[data-theme="light"][data-bg="stone"] { --bg: #f7f5f3; --bg2: #eeebe7; --card: #fff; --card2: #f3f0ec; --card-end: #fcfbfa; --border: #e7e2dc; --muted: #78716c; --text: #1c1917; }
html[data-theme="light"] .card { box-shadow: var(--shadow); }
html[data-theme="light"] .price-box { background: rgba(245, 158, 11, .12); }
html[data-theme="light"] .price, html[data-theme="light"] .hl { color: #c2410c; }
html[data-theme="light"] .pd-price { background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(249, 115, 22, .06)); }
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; }
.popup-box img { width: 100%; aspect-ratio: var(--ar, 1 / 1); 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; } }
