/* ============================================================
   KeyHub - Gaming Dark Theme
   Modern, fast, responsive. No framework. Pure CSS.
   ============================================================ */

:root {
  --bg: #0b0f19;
  --bg-2: #111827;
  --bg-3: #1a2234;
  --card: #141c2e;
  --card-hover: #1b2540;
  --border: #24304a;
  --text: #e6e9f2;
  --text-dim: #9aa4bd;
  --muted: #6b7590;
  --accent: #7c3aed;
  --accent-2: #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(168, 85, 247, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; transition: color .2s; }
a:hover { color: var(--text); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #2b3a5a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Layout ---------- */
.container { max-width: 1220px; margin: 0 auto; padding: 0 20px; }
.page { padding: 30px 0 70px; min-height: 60vh; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: .5px;
}
.logo-badge {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); display: grid; place-items: center;
  font-size: 18px; box-shadow: 0 4px 16px var(--accent-glow);
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.logo span { display: inline-block; transform-style: preserve-3d; animation: logo3d 3.5s ease-in-out infinite; }
.logo span em { font-style: normal; }
.logo span em.logo-w { color: #fff; text-shadow: 0 0 10px rgba(168, 85, 247, .5), 0 2px 4px rgba(0, 0, 0, .6); }
.logo span em.logo-g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
@keyframes logo3d {
  0%, 100% { transform: perspective(320px) rotateY(-10deg) rotateX(4deg) translateZ(0); }
  50% { transform: perspective(320px) rotateY(10deg) rotateX(-4deg) translateZ(6px); }
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a.nav-item {
  color: var(--text-dim); font-weight: 500; padding: 8px 13px;
  border-radius: 9px; font-size: 14.5px; transition: all .2s;
}
.nav-links a.nav-item:hover, .nav-links a.nav-item.active {
  color: var(--text); background: rgba(124, 58, 237, 0.12);
}
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 11px; font-weight: 600; font-size: 14px;
  border: none; transition: all .2s; white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 4px 18px var(--accent-glow); }
.btn-primary:hover { filter: brightness(1.12); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--text); background: rgba(124, 58, 237, 0.08); }
.btn-ghost { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Cart icon w/ badge */
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700;
  border-radius: 20px; display: grid; place-items: center; padding: 0 5px;
  border: 2px solid var(--bg);
}

/* Bell notifications */
.bell { position: relative; }
.bell-dot {
  position: absolute; top: 0; right: 0; width: 9px; height: 9px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--bg);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); }
  70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--text); font-size: 17px;
  transition: all .2s; position: relative;
}
.icon-btn:hover { background: rgba(124, 58, 237, 0.15); border-color: var(--accent); }

/* User chip */
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 30px; background: rgba(255,255,255,.04); border: 1px solid var(--border); cursor: pointer; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 700; }
.user-chip .u-info { line-height: 1.15; }
.user-chip .u-name { font-size: 13px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .u-bal { font-size: 11.5px; color: var(--warning); font-weight: 600; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 13px;
  box-shadow: var(--shadow); padding: 7px; z-index: 120; animation: pop .16s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 9px; color: var(--text);
  background: none; border: none; font-size: 14px; font-weight: 500; text-align: left; transition: all .15s;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: rgba(124, 58, 237, 0.12); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-menu .logout { color: var(--danger); }
.dropdown-menu .logout:hover { background: rgba(239, 68, 68, 0.12); }

/* Mobile menu */
.hamburger { display: none; }

/* ---------- Buttons: general ---------- */

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 84px 0 70px; text-align: center;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(700px 300px at 50% 0%, var(--accent-glow), transparent 70%),
    linear-gradient(180deg, rgba(124,58,237,.08), transparent);
}
.hero h1 {
  font-size: clamp(30px, 5.4vw, 54px); font-weight: 800; line-height: 1.2;
  margin-bottom: 16px; letter-spacing: .3px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); font-size: clamp(15px, 2.4vw, 18px); max-width: 640px; margin: 0 auto 30px; }
.hero .btn-lg { animation: float 5s ease-in-out infinite; }

/* ---------- Sections ---------- */
.section { margin-top: 44px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title { font-size: 23px; font-weight: 800; position: relative; padding-left: 15px; }
.section-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 22px; border-radius: 4px; background: var(--grad);
}

/* ---------- Cards / Products ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Horizontal launcher-style product card */
.product-card {
  position: relative;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  min-height: 95px;
  padding: 12px 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #232936 0%, #1F2430 100%);
  border: 1px solid rgba(124, 58, 237, .28);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow), 0 8px 22px rgba(0, 0, 0, .45);
}

/* Left: square image frame */
.pc-thumb {
  width: 70px; height: 70px;
  background: #fff;
  border-radius: 12px;
  display: grid; place-items: center;
  overflow: hidden;
  padding: 6px;
}
.pc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pc-thumb .thumb-fallback { font-size: 34px; }

/* Middle: name / price / badges (stacked, never overlapping) */
.pc-info {
  min-width: 0;
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.pc-name {
  font-size: 18px; font-weight: 700; color: #fff; text-transform: uppercase;
  line-height: 1.15; letter-spacing: .2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.pc-price { font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap; line-height: 1; }
.pc-old { font-size: 12.5px; color: #8891a7; text-decoration: line-through; font-weight: 500; margin-left: 8px; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-badge {
  display: inline-flex; align-items: center;
  padding: 1px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: #fff; white-space: nowrap; width: fit-content;
}
.pc-badge-purple { background: #5b21b6; border: 1px solid #a78bfa; }
.pc-badge-green { background: #14532d; border: 1px solid #2dd4bf; }
.pc-badge-red { background: #4a0d0d; border: 1px solid #f87171; color: #fecaca; }

/* Right: glowing dot + fixed-width action column (always aligned) */
.pc-side {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
}
.pc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7, 0 0 16px rgba(168, 85, 247, .6);
  animation: pcPulse 2.4s ease-in-out infinite;
}
@keyframes pcPulse { 0%, 100% { opacity: .85; } 50% { opacity: .35; } }
.pc-buy {
  width: 96px; height: 34px; padding: 0;
  border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(168, 85, 247, .55);
  background: rgba(124, 58, 237, .12); color: #d8b4fe;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .3s ease;
}
.pc-buy:hover { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 0 14px var(--accent-glow); }
.pc-cart {
  width: 96px; height: 30px; padding: 0;
  border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .06); color: #fff; font-size: 14px;
  display: grid; place-items: center;
  transition: all .3s ease;
}
.pc-cart:hover { background: rgba(255, 255, 255, .14); }

/* ---------- Feature highlights ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; transition: all .25s;
}
.feature:hover { border-color: var(--accent); transform: translateY(-4px); }
.feature .f-icon {
  width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 14px;
  background: rgba(124,58,237,.14); color: var(--accent-2);
  display: grid; place-items: center; font-size: 23px;
}
.feature h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
.feature p { font-size: 13px; color: var(--text-dim); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; max-width: 760px; margin: 0 auto;
}
.contact-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 18px; text-align: center;
  transition: all .25s; color: inherit; text-decoration: none;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 24px var(--accent-glow); }
.contact-card .f-icon {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 15px;
  background: rgba(0,163,255,.16); color: #00a3ff;
  display: grid; place-items: center; font-size: 26px;
}
.contact-card:nth-child(2) .f-icon { background: rgba(0,163,255,.16); color: #00a3ff; }
.contact-card h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }
.contact-card p { font-size: 13px; color: var(--text-dim); word-break: break-word; }

/* ---------- News ---------- */
.news-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; transition: all .25s;
}
.news-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.news-card .n-date { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.news-card h3 { font-size: 15.5px; margin-bottom: 7px; }
.news-card p { font-size: 13px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Forms ---------- */
.auth-wrap { max-width: 440px; margin: 30px auto; }
.auth-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 32px 28px; box-shadow: var(--shadow);
}
.auth-card h2 { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 17px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, .select, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  background: var(--bg-2); border: 1.5px solid var(--border); color: var(--text);
  font-size: 14.5px; outline: none; transition: all .2s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 15px; display: none; }
.form-error.show { display: block; animation: pop .18s; }
.form-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #86efac; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 15px; display: none; }
.form-success.show { display: block; }
.switch-link { text-align: center; margin-top: 17px; font-size: 14px; color: var(--text-dim); }
.switch-link a { font-weight: 600; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.cart-item {
  display: flex; align-items: center; gap: 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 13px;
}
.cart-item .ci-thumb { width: 66px; height: 66px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: linear-gradient(135deg,#1e2a44,#141c2e); display: grid; place-items: center; }
.cart-item .ci-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .ci-thumb .thumb-fallback { font-size: 24px; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.cart-item .ci-price { color: var(--warning); font-weight: 700; font-size: 14px; }
.qty-ctl { display: inline-flex; align-items: center; gap: 2px; margin-top: 7px; }
.qty-ctl button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-weight: 700; font-size: 15px; transition: all .15s; }
.qty-ctl button:hover { border-color: var(--accent); color: var(--accent-2); }
.qty-ctl span { min-width: 34px; text-align: center; font-weight: 700; }
.cart-item .ci-remove { color: var(--muted); background: none; border: none; font-size: 18px; transition: all .15s; }
.cart-item .ci-remove:hover { color: var(--danger); transform: scale(1.15); }

.summary-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: sticky; top: 82px;
}
.summary-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; color: var(--text-dim); }
.sum-row.total { border-top: 1px dashed var(--border); margin-top: 9px; padding-top: 14px; font-size: 17px; font-weight: 800; color: var(--text); }
.sum-row.total span:last-child { color: var(--warning); font-size: 21px; }
.discount-input { display: flex; gap: 9px; margin: 13px 0; }
.discount-input .input { flex: 1; }
.discount-msg { font-size: 12.5px; margin-top: -6px; margin-bottom: 8px; }
.discount-msg.ok { color: var(--success); }
.discount-msg.bad { color: var(--danger); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(5,8,15,.7);
  backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 18px;
  max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 26px;
  box-shadow: var(--shadow); animation: pop .2s;
}
.modal h3 { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.modal-close { position: absolute; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; }
.modal-close-btn { background: none; border: none; color: var(--muted); font-size: 20px; transition: all .15s; }
.modal-close-btn:hover { color: var(--danger); transform: scale(1.1); }

/* ---------- Buy confirm modal ---------- */
.buy-confirm .bc-product { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
.buy-confirm .bc-thumb { width: 64px; height: 64px; flex-shrink: 0; background: #fff; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.buy-confirm .bc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.buy-confirm .bc-thumb .thumb-fallback { font-size: 26px; }
.buy-confirm .bc-name { font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.buy-confirm .bc-price { color: var(--warning); font-weight: 800; font-size: 17px; margin-top: 4px; }
.buy-confirm .bc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.buy-confirm .bc-label { color: var(--text-dim); font-size: 14px; }
.buy-confirm .bc-stock { color: var(--text-dim); font-size: 13px; }
.buy-confirm .bc-summary { border: 1px solid var(--border); border-radius: 14px; padding: 6px 14px; margin-bottom: 18px; }
.buy-confirm .bc-line { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; }
.buy-confirm .bc-line + .bc-line { border-top: 1px dashed var(--border); }
.buy-confirm .bc-line span:first-child { color: var(--text-dim); }
.buy-confirm .bc-line span:last-child { font-weight: 700; }
.buy-confirm .cart-confirm-list { margin-bottom: 16px; }
.buy-confirm .cart-confirm-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.buy-confirm .cart-confirm-item .bc-thumb { width: 48px; height: 48px; }
.buy-confirm .cart-confirm-item .bc-info { flex: 1; min-width: 0; }
.buy-confirm .cart-confirm-item .bc-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buy-confirm .cart-confirm-item .bc-price { font-size: 14px; margin-top: 2px; }
.buy-confirm .cart-confirm-item .qty-ctl { margin-top: 6px; }
.buy-confirm .ci-line-total { font-weight: 800; color: var(--text); white-space: nowrap; }

/* ---------- Wallet / Tables ---------- */
.balance-hero {
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(168,85,247,.06));
  border: 1px solid rgba(124,58,237,.4); border-radius: 18px; padding: 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.balance-label { color: var(--text-dim); font-size: 14px; }
.balance-value { font-size: 36px; font-weight: 800; color: var(--warning); }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }

.deposit-wrap { max-width: 620px; margin: 0 auto; }
.deposit-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; margin-bottom: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.deposit-panel .section-title { text-align: center; }
.tab-btn {
  padding: 9px 18px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--text-dim); font-weight: 600; font-size: 13.5px; transition: all .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px var(--accent-glow); }

.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.amount-chip {
  padding: 9px 16px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 13.5px; cursor: pointer; transition: all .2s;
}
.amount-chip:hover { border-color: var(--accent); color: var(--accent); }
.amount-chip.active { background: var(--grad); border-color: transparent; color: #fff; }

.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap th, .table-wrap td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table-wrap th { background: var(--bg-2); color: var(--text-dim); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tbody tr { transition: background .15s; }
.table-wrap tbody tr:hover { background: rgba(124,58,237,.05); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.pill-success { background: rgba(34,197,94,.15); color: var(--success); }
.pill-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.pill-danger { background: rgba(239,68,68,.15); color: var(--danger); }
.pill-info { background: rgba(59,130,246,.15); color: var(--info); }
.pill-muted { background: rgba(154,164,189,.15); color: var(--text-dim); }

/* ---------- Notifications ---------- */
.notif-item {
  display: flex; gap: 13px; padding: 15px 16px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 11px;
  transition: all .2s; cursor: pointer;
}
.notif-item:hover { border-color: var(--accent); }
.notif-item.unread { border-left: 3px solid var(--accent); background: rgba(124,58,237,.07); }
.notif-icon { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px; }
.notif-item .ni-title { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; }
.notif-item .ni-content { font-size: 13px; color: var(--text-dim); }
.notif-item .ni-time { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 40px; padding: 44px 0 26px;
}
.footer-logo { gap: 12px; font-size: 30px; }
.footer-logo .logo-badge { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }
.footer-logo .logo-badge img { border-radius: 14px; }

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 30px; }
.footer-col h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 9px; }
.footer-col a:hover { color: var(--accent-2); }
.footer-desc { font-size: 13px; color: var(--text-dim); margin-top: 12px; max-width: 300px; }
.social-links { display: flex; gap: 9px; margin-top: 14px; }
.social-links a {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.05);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-dim); font-size: 15px; transition: all .2s;
}
.social-links a:hover { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-3px); }
.copyright { border-top: 1px solid var(--border); padding-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-2); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 11px; padding: 13px 18px; min-width: 260px; max-width: 340px;
  box-shadow: var(--shadow); font-size: 14px; animation: slideIn .25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.hide { opacity: 0; transform: translateX(30px); transition: all .3s; }

/* ---------- Skeleton / loading ---------- */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 70px 0; color: var(--text-dim); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state .e-icon { font-size: 52px; margin-bottom: 14px; opacity: .6; }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- Announcement bar ---------- */
.announce-bar {
  background: linear-gradient(90deg, rgba(124,58,237,.2), rgba(168,85,247,.12));
  border-bottom: 1px solid rgba(124,58,237,.3); color: var(--text);
  font-size: 13.5px; font-weight: 500;
  overflow: hidden; white-space: nowrap;
  padding: 8px 0;
}
.announce-track { display: flex; width: max-content; }
.announce-group { display: inline-flex; align-items: center; animation: announceScroll 22s linear infinite; }
.announce-item { padding-right: 3em; }
@keyframes announceScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent-2); }

/* ---------- Profile ---------- */
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.profile-side {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 20px; text-align: center; position: sticky; top: 82px;
}
.profile-side .big-avatar {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 14px; object-fit: cover;
  background: var(--grad); display: grid; place-items: center; font-size: 34px; color: #fff; font-weight: 800;
}
.profile-side h3 { font-size: 17px; margin-bottom: 3px; }
.profile-side .p-mail { font-size: 13px; color: var(--muted); margin-bottom: 16px; word-break: break-all; }
.profile-side .stat-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px dashed var(--border); font-size: 13.5px; }
.profile-side .stat-row span:first-child { color: var(--text-dim); }
.profile-side .stat-row span:last-child { font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cart-layout, .profile-grid { grid-template-columns: 1fr; }
  .profile-side, .summary-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hamburger { display: grid; }
  .nav-links {
    position: fixed; top: 61px; left: 0; right: 0; z-index: 99;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 14px;
    transform: translateY(-130%); transition: transform .25s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a.nav-item { padding: 12px 14px; font-size: 15px; }
  .nav-actions .hide-m { display: none; }
  .user-chip .u-info { display: none; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .page { padding: 20px 0 50px; }
  .balance-value { font-size: 28px; }
  .table-wrap { overflow-x: auto; }
  .table-wrap table { min-width: 620px; }
  #toast-wrap { left: 16px; right: 16px; }
  .toast { min-width: 0; width: 100%; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .product-card { grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 12px; min-height: 84px; }
  .pc-thumb { width: 52px; height: 52px; border-radius: 10px; }
  .pc-thumb .thumb-fallback { font-size: 24px; }
  .pc-name { font-size: 14px; min-height: 2.3em; }
  .pc-price { font-size: 14px; }
  .pc-badges { gap: 5px; }
  .pc-badge { font-size: 10px; padding: 1px 8px; }
  .pc-side { gap: 6px; }
  .pc-buy { width: 88px; height: 30px; font-size: 11px; }
  .pc-cart { width: 88px; height: 26px; font-size: 13px; }
  .cart-item { flex-wrap: wrap; }
}
