/* ============================================================
   SWIFTCART — global.css
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap");

/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== TOKENS ===== */
:root {
  --bg: #06080f;
  --surface: #0c1018;
  --surface2: #121a24;
  --surface3: #1a2434;
  --border: #1c2838;
  --border2: #263348;
  --text: #edf0f8;
  --text2: #7888a0;
  --text3: #3c4e62;
  --orange: #ff4d2d;
  --orange2: #ff6a4e;
  --orange-dim: rgba(255, 77, 45, 0.1);
  --orange-glow: rgba(255, 77, 45, 0.2);
  --green: #22d97a;
  --green-dim: rgba(34, 217, 122, 0.08);
  --red: #ef4444;
  --amber: #f5a623;
  --blue: #3b82f6;
  --radius: 14px;
  --radius-sm: 8px;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}
body {
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 256px;
  opacity: 0.5;
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 28px;
  background: rgba(6, 8, 15, 0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 0 14px var(--orange-glow);
}
.logo-text {
  font-family: "Syne", sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color 0.18s;
}
.search:focus-within {
  border-color: var(--border2);
}
.search-icon {
  color: var(--text3);
  font-size: 14px;
  flex-shrink: 0;
}
.search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  padding: 9px 0;
}
.search input::placeholder {
  color: var(--text3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  font-size: 12px;
  font-weight: 400;
  color: var(--text2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-links a:hover {
  color: var(--text);
  background: var(--surface2);
}
.nav-links a.active {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
}

.nav-cart {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface2);
  text-decoration: none;
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.18s;
  position: relative;
}
.nav-cart:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border2);
  color: var(--text2);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
  }
  .nav-toggle {
    display: flex;
  }
  .search,
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    gap: 4px;
  }
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  letter-spacing: 0.02em;
}
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 16px var(--orange-glow);
}
.btn-primary:hover {
  background: var(--orange2);
  box-shadow: 0 8px 24px var(--orange-glow);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover {
  border-color: var(--text3);
  color: var(--text);
}
.btn-green {
  background: var(--green);
  color: #041a0e;
  font-weight: 600;
}
.btn-green:hover {
  opacity: 0.88;
}
.btn-dark {
  background: var(--surface3);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-dark:hover {
  color: var(--text);
}
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
}
.btn-full {
  width: 100%;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.badge-green {
  background: var(--green-dim);
  border: 1px solid rgba(34, 217, 122, 0.25);
  color: var(--green);
}
.badge-red {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
}
.badge-amber {
  background: rgba(245, 166, 35, 0.08);
  border: 1px solid rgba(245, 166, 35, 0.25);
  color: var(--amber);
}
.badge-blue {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue);
}
.badge-muted {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
}
.badge-orange {
  background: var(--orange-dim);
  border: 1px solid rgba(255, 77, 45, 0.25);
  color: var(--orange);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 8px;
}
.stat-value {
  font-family: "Syne", sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-delta {
  font-size: 11px;
  color: var(--green);
}
.stat-delta.neg {
  color: var(--red);
}

/* ===== MISC ===== */
.star {
  color: var(--orange);
}
.text-muted {
  color: var(--text2);
}
.text-small {
  font-size: 12px;
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.08em;
}

/* ===== FADE-UP ===== */
.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  transition-delay: var(--d, 0s);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}
