:root {
  --bg: #08080d;
  --surface: #12121a;
  --surface2: #1a1a26;
  --border: rgba(255,255,255,0.06);
  --text: #e8e8ed;
  --text2: #8b8b9e;
  --accent: #EE4D2D;
  --accent2: #FF6B35;
  --accent-glow: rgba(238,77,45,0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,13,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(238,77,45,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 8px rgba(238,77,45,0.4));
}

.logo h1 {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.tagline {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.3px;
}

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

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

#search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}

#search-input::placeholder {
  color: var(--text2);
}

/* ===== MAIN ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: 60vh;
}

.stats-bar {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
}

.stats-bar span {
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--border);
  display: inline-block;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(238,77,45,0.3);
  box-shadow: 0 12px 40px -8px rgba(238,77,45,0.15), 0 4px 16px rgba(0,0,0,0.3);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface2);
  display: block;
}

.product-image-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--surface2) 0%, #1e1e2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.5;
}

.product-info {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.product-id {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}

.product-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-top: auto;
}

.product-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}

.empty-icon { font-size: 56px; margin-bottom: 16px; }

.empty-state h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  color: var(--text2);
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  text-align: center;
}

footer p {
  font-size: 13px;
  color: var(--text2);
}

.footer-sub {
  margin-top: 6px;
  font-size: 11px;
}

.footer-sub a {
  color: var(--accent);
  text-decoration: none;
}

.footer-sub a:hover { text-decoration: underline; }

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

.product-card {
  animation: fadeUp 0.4s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.02s; }
.product-card:nth-child(2) { animation-delay: 0.04s; }
.product-card:nth-child(3) { animation-delay: 0.06s; }
.product-card:nth-child(4) { animation-delay: 0.08s; }
.product-card:nth-child(5) { animation-delay: 0.10s; }
.product-card:nth-child(6) { animation-delay: 0.12s; }
.product-card:nth-child(7) { animation-delay: 0.14s; }
.product-card:nth-child(8) { animation-delay: 0.16s; }
.product-card:nth-child(9) { animation-delay: 0.18s; }
.product-card:nth-child(10) { animation-delay: 0.20s; }
.product-card:nth-child(11) { animation-delay: 0.22s; }
.product-card:nth-child(12) { animation-delay: 0.24s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
  }
  .search-box {
    flex: 1;
    width: 100%;
  }
  .logo h1 { font-size: 16px; }
  .logo-icon { font-size: 28px; }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-name { font-size: 12px; }
  .product-info { padding: 10px 12px 12px; }
  .product-btn { font-size: 11px; padding: 8px 12px; }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
