:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #f472b6;
  --border: #334155;
  --card: #1e293b;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}

.controls input, .controls select {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.controls input { flex: 1 1 220px; min-width: 180px; }
.controls select { flex: 0 1 160px; }

.controls input:focus, .controls select:focus {
  border-color: var(--accent);
}

.stats {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  flex: 1;
  padding: 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow), 0 0 20px rgba(56,189,248,0.15);
}

.card .thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #0b1220;
  display: block;
}

.card-body {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-body .name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 0.5rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.stock {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(56,189,248,0.15);
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(244,114,182,0.15);
  color: var(--accent2);
  cursor: pointer;
}

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

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.hidden { display: none; }

footer {
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  header h1 { font-size: 1.4rem; }
}
