:root {
  --bg: #f4f6f4;
  --card: #ffffff;
  --text: #17201b;
  --muted: #66746c;
  --accent: #0b7a53;
  --accent-dark: #075f40;
  --border: #d7ded9;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 800; color: var(--accent); text-decoration: none; }
nav a { margin-left: 16px; color: var(--text); text-decoration: none; }
.container { max-width: 1180px; margin: 24px auto; padding: 0 16px; }
.catalog-head { margin-bottom: 18px; }
.catalog-head h1 { margin-bottom: 6px; }
.catalog-head p { color: var(--muted); margin-top: 0; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.card-body { min-height: 210px; }
.media-wrap {
  position: relative;
}
.product-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #e8ece9;
}
.media-placeholder {
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  color: var(--text);
  border: 1px dashed var(--border);
}
.media-placeholder span {
  color: var(--muted);
  font-size: 14px;
}
.media-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(23, 32, 27, .82);
  color: #fff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
}
.description p { margin: 4px 0; }
.price { font-size: 20px; font-weight: 700; }
.stock, .muted { color: var(--muted); }
.card-actions {
  display: grid;
  gap: 8px;
}
button, .button-link {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
button:hover, .button-link:hover { background: var(--accent-dark); }
.button-link.secondary {
  background: #eef3ef;
  color: var(--text);
  border: 1px solid var(--border);
}
.button-link.secondary:hover {
  background: #dfe8e2;
}
button:disabled { opacity: .5; cursor: not-allowed; }
table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
.checkout { display: grid; gap: 10px; max-width: 520px; }
input, textarea, select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.error { color: #dc2626; }
