:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111f;
  color: #f8fafc;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #16365d 0, #07111f 38%); }
button, input { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 20px 14px; background: rgba(7, 17, 31, .86);
  border-bottom: 1px solid rgba(148, 163, 184, .13); backdrop-filter: blur(18px);
}
.eyebrow { margin: 0 0 2px; color: #38bdf8; font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.03em; }
.icon-button { width: 42px; height: 42px; border: 1px solid #29405e; border-radius: 14px; background: #132238; color: #e2e8f0; font-size: 1.5rem; }
.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { width: min(760px, 100%); margin: 0 auto; padding: 18px 16px calc(32px + env(safe-area-inset-bottom)); }
.search { display: flex; gap: 10px; align-items: center; padding: 0 15px; border: 1px solid #29405e; border-radius: 16px; background: #101f33; color: #7dd3fc; }
.search input { width: 100%; padding: 14px 0; border: 0; outline: 0; background: transparent; color: #fff; }
.search input::placeholder { color: #8091a8; }
.summary { display: flex; justify-content: space-between; padding: 14px 3px 12px; color: #91a4bc; font-size: .78rem; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { overflow: hidden; min-width: 0; border: 1px solid #223752; border-radius: 20px; background: linear-gradient(155deg, #14263d, #0d1a2b); box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.product-media { display: grid; place-items: center; aspect-ratio: 1.35; overflow: hidden; background: linear-gradient(135deg, #183b61, #10243d); font-size: 2.7rem; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 13px; }
.product-info h2 { min-height: 2.5em; margin: 0 0 10px; overflow: hidden; color: #f8fafc; font-size: .94rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price { margin: 0 0 7px; color: #38bdf8; font-size: .98rem; font-weight: 800; }
.stock { margin: 0; color: #4ade80; font-size: .74rem; }
.stock.out { color: #fb7185; }
.state { padding: 58px 24px; text-align: center; color: #94a3b8; }
.state-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 18px; background: #132842; color: #38bdf8; font-size: 1.8rem; font-weight: 900; }
.state h2 { margin: 0 0 8px; color: #f8fafc; font-size: 1.05rem; }
.state p { margin: 0 auto 20px; max-width: 320px; line-height: 1.6; }
.primary-button { border: 0; border-radius: 12px; padding: 11px 22px; background: #0ea5e9; color: white; font-weight: 750; }
.skeleton { aspect-ratio: .88; border-radius: 20px; background: linear-gradient(100deg, #102138 30%, #193553 50%, #102138 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
