/* ============================================
   Z2X.tech — Base & Layout
   ============================================ */
:root {
  --bg: #0b0b14;
  --bg-elev: #13131f;
  --bg-card: #181826;
  --bg-card-hover: #1f1f30;
  --border: #26263a;
  --border-light: #303048;
  --text: #f5f5fa;
  --text-dim: #a0a0b8;
  --text-muted: #6b6b85;
  --primary: #7c3aed;
  --primary-hover: #8b4cf0;
  --primary-glow: rgba(124, 58, 237, 0.4);
  --accent: #22d3ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --grad: linear-gradient(135deg, #7c3aed 0%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(34, 211, 238, 0.15));
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --container: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}
.section--alt {
  background: var(--bg-elev);
}
.section__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
}
.section__head h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section__link {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
}
.section__link:hover { color: var(--primary); }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn--primary:hover {
  background: var(--primary-hover);
  color: white;
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn--ghost:hover {
  background: var(--bg-card);
  color: var(--text);
}
.btn--lg {
  padding: 16px 32px;
  font-size: 16px;
}
.btn--block {
  width: 100%;
}

/* Top bar */
.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 36px;
  flex-wrap: wrap;
}
.topbar__sep { color: var(--text-muted); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text); }
.logo__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: white;
  font-size: 20px;
  font-weight: 800;
}
.logo__text { color: var(--text); }
.logo__dot { color: var(--primary); }

.search {
  flex: 1;
  max-width: 560px;
  display: flex;
  position: relative;
}
.search input {
  flex: 1;
  padding: 12px 48px 12px 16px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.search button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.search button:hover {
  background: var(--primary);
  color: white;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header__link {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.header__link:hover { color: var(--text); }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.cart-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}
.cart-count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Category nav */
.catnav {
  border-top: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav__inner {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  white-space: nowrap;
}
.catnav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.catnav__link:hover {
  background: var(--bg-card);
  color: var(--text);
}
.catnav__link.active {
  background: var(--primary);
  color: white;
}
