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

:root {
  --bg-primary: #111113;
  --bg-secondary: #18181b;
  --bg-card: #1c1c1f;
  --bg-card-hover: #232326;
  --bg-elevated: #27272a;
  --bg-input: #1e1e21;
  --border: #27272a;
  --border-light: #3f3f46;
  --border-subtle: #222225;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: rgba(99, 102, 241, 0.1);
  --accent-glow: rgba(99, 102, 241, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --blue: #3b82f6;
  --purple: #a855f7;
  --rarity-consumer: #b0c3d9;
  --rarity-industrial: #5e98d9;
  --rarity-milspec: #4b69ff;
  --rarity-restricted: #8847ff;
  --rarity-classified: #d32ce6;
  --rarity-covert: #eb4b4b;
  --rarity-gold: #e4ae39;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.35);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}


.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(17, 17, 19, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1.5rem;
}

.navbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.cart-btn:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--border-light);
}

.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}


.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


.hero {
  padding: 4rem 2rem 1.5rem;
  text-align: center;
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 0.75rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}


.stats-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-item .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}


.toolbar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.5rem 2rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  position: relative;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.sort-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.item-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* ===== ITEMS GRID ===== */
.items-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.5rem 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

/* ===== ITEM CARD ===== */
.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.item-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}

.item-card .item-image-wrap {
  padding: 1.25rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.02) 0%, transparent 70%);
}

.item-card .item-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform var(--transition);
}

.item-card:hover .item-image-wrap img {
  transform: scale(1.08);
}

.item-card .float-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.item-card .item-info {
  padding: 0.5rem 1rem 1rem;
}

.item-card .item-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-card .item-name {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 4px 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.item-card .item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-card .item-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.item-card .add-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.item-card .add-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.item-card .add-btn.added {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ===== STATTRAK BADGE ===== */
.stattrak-badge {
  display: inline-block;
  background: rgba(255, 165, 0, 0.12);
  color: #ffa500;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* ===== WEAR BADGE ===== */
.wear-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* ===== CHECKOUT PAGE ===== */
.checkout-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  min-height: calc(100vh - 60px);
}

.checkout-header {
  margin-bottom: 2rem;
}

.checkout-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  letter-spacing: -0.5px;
}

.checkout-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.invoice-id {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.invoice-id span {
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

/* Checkout Left - Embedded Payment */
.checkout-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 480px;
  overflow: hidden;
}

/* Checkout Right - Cart Panel */
.checkout-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
}

.cart-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.cart-panel-header {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}

.cart-panel-header:hover {
  background: var(--bg-elevated);
}

.cart-panel-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-panel-header-total {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-panel-chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.cart-panel-collapsible {
  overflow: hidden;
}

.cart-panel-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
}

.cart-panel-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.cart-panel-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  transition: all var(--transition);
}

.cart-panel-item:hover {
  background: var(--bg-elevated);
}

.cart-panel-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.cart-panel-remove:hover {
  color: var(--red);
  background: var(--red-dim);
}

.cart-panel-item img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  flex-shrink: 0;
}

.cart-panel-item-details {
  flex: 1;
  min-width: 0;
}

.cart-panel-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-panel-item-type {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.cart-panel-item-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-hover);
  white-space: nowrap;
}

.cart-panel-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-panel-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cart-panel-total-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== EMPTY CART ===== */
.empty-cart {
  text-align: center;
  padding: 6rem 2rem;
}

.empty-cart-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.15;
}

.empty-cart h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.3px;
}

.empty-cart p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-dim);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  backdrop-filter: blur(12px);
}

.toast.show {
  transform: translateY(0);
}

.toast .toast-icon {
  color: var(--green);
  font-size: 1rem;
}

/* ===== LOADING SKELETON ===== */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-bar {
  height: 2px;
  background: var(--border);
}

.skeleton-image {
  height: 150px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  margin: 12px 16px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.price { width: 40%; margin-bottom: 16px; height: 16px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== NO RESULTS ===== */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.no-results h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.no-results p {
  font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero {
    padding: 2.5rem 1.5rem 1rem;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 0.5rem 1rem 3rem;
  }

  .navbar {
    padding: 0 1rem;
  }

  .nav-links {
    gap: 2px;
  }

  .toolbar {
    padding: 0.5rem 1rem;
  }

  .search-box {
    min-width: 150px;
  }

  .checkout-page {
    padding: 1.5rem 1rem;
  }

  .item-count {
    display: none;
  }

  .stats-bar {
    gap: 1rem;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .items-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-card {
  animation: fadeInUp 0.35s ease forwards;
  opacity: 0;
}

.item-card:nth-child(1) { animation-delay: 0.02s; }
.item-card:nth-child(2) { animation-delay: 0.04s; }
.item-card:nth-child(3) { animation-delay: 0.06s; }
.item-card:nth-child(4) { animation-delay: 0.08s; }
.item-card:nth-child(5) { animation-delay: 0.10s; }
.item-card:nth-child(6) { animation-delay: 0.12s; }
.item-card:nth-child(7) { animation-delay: 0.14s; }
.item-card:nth-child(8) { animation-delay: 0.16s; }
.item-card:nth-child(9) { animation-delay: 0.18s; }
.item-card:nth-child(10) { animation-delay: 0.20s; }
.item-card:nth-child(11) { animation-delay: 0.22s; }
.item-card:nth-child(12) { animation-delay: 0.24s; }
.item-card:nth-child(13) { animation-delay: 0.26s; }
.item-card:nth-child(14) { animation-delay: 0.28s; }
.item-card:nth-child(15) { animation-delay: 0.30s; }
.item-card:nth-child(16) { animation-delay: 0.32s; }
.item-card:nth-child(17) { animation-delay: 0.34s; }
.item-card:nth-child(18) { animation-delay: 0.36s; }
.item-card:nth-child(19) { animation-delay: 0.38s; }
.item-card:nth-child(20) { animation-delay: 0.40s; }
.item-card:nth-child(n+21) { animation-delay: 0.42s; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--accent);
}
