:root {
  --bg: #fafafa;
  --card: #fff;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #52525b;
  --accent: #059669;
  --accent-hover: #047857;
  --danger: #dc2626;
  --radius: 0.75rem;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

header.site {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}
nav.top a {
  font-size: 0.875rem;
  color: var(--muted);
  margin-left: 1rem;
}
nav.top a:hover {
  color: var(--text);
}
.btn {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--text);
  color: #fff;
}
.btn-primary:hover {
  background: #27272a;
  color: #fff;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-hover);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
}

.alert {
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-warn {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #78350f;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.alert-ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #064e3b;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.lead {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.5rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-img {
  aspect-ratio: 4 / 3;
  background: #f4f4f5;
  position: relative;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-img .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.7rem;
  color: #a1a1aa;
}
.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}
.card-code {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f4f4f5;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  align-self: flex-start;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.price {
  font-size: 0.9rem;
  font-weight: 600;
}
.price-note {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
}
.add-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.add-form input[type="number"] {
  width: 2.75rem;
  font-size: 0.75rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

table.cart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.cart th,
table.cart td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.cart th {
  background: #f4f4f5;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
table.cart tr:last-child td {
  border-bottom: none;
}
.cart-qty {
  width: 3.5rem;
  font-size: 0.8rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
}

.form {
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0;
  background: var(--card);
}
.form legend {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0 0.35rem;
}
.form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.form input,
.form textarea {
  width: 100%;
  font-size: 0.875rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  font-family: inherit;
}
.form textarea {
  min-height: 5rem;
  resize: vertical;
}
.row2 {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 480px) {
  .row2 {
    grid-template-columns: 1fr 1fr;
  }
}

footer.site {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
