* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}
.wrap-narrow {
  max-width: 480px;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.header h1 {
  margin: 0;
  font-size: 1.5rem;
}
.auth-box {
  font-size: 0.9rem;
}
.auth-box button {
  margin-left: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 {
  margin-top: 0;
  font-size: 1.2rem;
}
.hidden {
  display: none;
}
.error {
  color: #c00;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
button, .btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
}
button.primary, .btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
button.primary:hover, .btn.primary:hover {
  background: #1d4ed8;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
#loginForm button {
  margin-top: 0.25rem;
}
.cart-card {
  margin-bottom: 1.5rem;
}
#cartList {
  min-height: 2rem;
  margin-bottom: 0.5rem;
}
.cart-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
}
.cart-remove {
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.85rem;
}
#cartTotal {
  font-weight: 600;
  margin-bottom: 0.75rem;
}
#checkoutBtn {
  margin-top: 0.25rem;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.filters input {
  width: auto;
  max-width: 120px;
  margin-bottom: 0;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.product-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}
.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #eee;
}
.product-card .body {
  padding: 0.75rem;
  flex: 1;
}
.product-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.product-card .price {
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 0.5rem;
}
.product-card button {
  width: 100%;
  margin-top: auto;
}
.result-card {
  text-align: center;
  padding: 2rem;
}
.result-card h2 {
  color: #16a34a;
}
.result-card a {
  display: inline-block;
  margin-top: 1rem;
  text-decoration: none;
}
.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #666;
}
.footer code {
  background: #eee;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
