:root {
  --ink: #1c2333;
  --muted: #5b6478;
  --accent: #e07b1f;
  --accent-dark: #b85f10;
  --bg: #f6f5f2;
  --card: #ffffff;
  --line: #e3e0d8;
  --ok: #1e7d46;
  --low: #b3540a;
  --out: #9a2a2a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.wrap { max-width: 1024px; margin: 0 auto; padding: 0 16px; }
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-header h1 { margin: 0; font-size: 1.35rem; }
.site-name { font-size: 1.35rem; font-weight: 700; }
.site-name a { color: #fff; text-decoration: none; }
a.cart-btn { text-decoration: none; }
.sub { margin: 2px 0 0; color: #c8cede; font-size: 0.9rem; }
.cart-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}
.cart-count { background: #fff; color: var(--accent-dark); border-radius: 999px; padding: 0 8px; font-weight: 700; }
.notice, .banner {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
}
.notice { background: #e8f4ec; border: 1px solid #bfe0cc; }
.banner { background: #fdf1e0; border: 1px solid #f0d5ab; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  padding: 18px 0 30px;
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-photo { aspect-ratio: 4 / 3; background: #eceae4; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-photo { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1rem; line-height: 1.3; }
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.section-title { margin: 20px 0 0; font-size: 1.15rem; }
a.primary { text-decoration: none; display: inline-block; text-align: center; }
.product-main { padding: 18px 0 30px; max-width: 720px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--accent-dark); }
.price { margin: 0; font-weight: 700; font-size: 1.1rem; }
.price s { color: var(--muted); font-weight: 400; font-size: 0.95rem; margin-left: 6px; }
.price.big { font-size: 1.4rem; }
.badge { align-self: flex-start; font-size: 0.8rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: #e8f4ec; color: var(--ok); }
.badge.low { background: #fdf1e0; color: var(--low); }
.badge.out { background: #fbe9e9; color: var(--out); }
.primary {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: auto;
}
.primary:hover { background: var(--accent-dark); }
.primary:disabled { background: #c9c9c9; cursor: not-allowed; }
.empty { color: var(--muted); text-align: center; padding: 28px 0; }
.site-footer { border-top: 1px solid var(--line); padding: 18px 0 30px; color: var(--muted); font-size: 0.9rem; }
.site-footer a { color: var(--muted); }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 38, 0.55);
  z-index: 20;
  overflow-y: auto;
  padding: 18px 10px;
}
.sheet {
  background: #fff;
  border-radius: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}
.sheet h2 { margin-top: 0; }
.close {
  position: absolute;
  top: 10px; right: 10px;
  background: #f0eee8; border: 0; border-radius: 999px;
  width: 34px; height: 34px; cursor: pointer; font-size: 1rem;
}
.detail-photo img { width: 100%; border-radius: 12px; display: block; }
.thumbs { display: flex; gap: 8px; margin: 10px 0; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.thumb.sel { border-color: var(--accent); }
.desc { color: #333c52; line-height: 1.5; white-space: pre-wrap; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.qty-row .primary { margin-top: 0; flex: 1; }
.qty-btn {
  width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 1.1rem; cursor: pointer;
}
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cl-title { font-size: 0.95rem; }
.cl-controls { display: flex; align-items: center; gap: 6px; }
.cl-remove { background: none; border: 0; cursor: pointer; color: var(--muted); }
.fulfil { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.email-label { display: block; margin: 10px 0; font-size: 0.92rem; }
.email-label input {
  display: block; width: 100%; margin-top: 5px;
  padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
}
.totals { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.totals > div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 1.15rem; }
.taxnote { color: var(--muted); font-size: 0.85rem; }
#checkout-btn { width: 100%; margin-top: 10px; }
.checkout-msg { background: #fdf1e0; border: 1px solid #f0d5ab; border-radius: 10px; padding: 12px; }
