:root {
  --bg: #f3eee6;
  --banner: #f6f0e4;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #e6dccb;
  --card: #fffdf9;
  --green: #1c6b45;
  --green-dark: #155437;
  --mint: #e7f6ee;
  --mint-strong: #d7f3e4;
  --pill: #e5f6ec;
  --amber: #9a5b16;
  --amber-bg: #f8edd8;
  --ok: #1c6b45;
  --ok-bg: #e5f6ec;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.04);
  --radius: 18px;
  --max: 1120px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 17px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
}

img { max-width: 100%; }

a { color: var(--green); }

h1, h2, h3, .brand-name, .card h2, .product h1 {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

button:hover, .btn:hover { background: var(--green-dark); }

button.ghost, a.ghost {
  background: #fff;
  color: var(--ink);
  border-color: #ddd4c6;
}

button.ghost:hover, a.ghost:hover { background: #faf7f2; }

button:disabled {
  background: #efeae2;
  color: #8a8378;
  border-color: #e4ddd2;
  cursor: default;
}

.banner {
  background: var(--banner);
  text-align: center;
  padding: 10px 16px;
  font-size: 1rem;
  color: #3d3832;
}

.wrap {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
}

header {
  padding: 14px 0 6px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-name { font-size: 1.35rem; }

nav {
  display: flex;
  align-items: center;
  gap: 6px 14px;
}

.navlink {
  text-decoration: none;
  color: var(--ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 650;
}

.navlink.on {
  background: var(--pill);
  color: var(--green);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

main { padding: 8px 0 36px; }

.hero, .panel, .card, .pay-box, .note {
  background: var(--card);
  border: 1px solid #efe6d8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero { padding: 28px 26px 24px; margin-bottom: 16px; }

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  max-width: 18ch;
}

.hero p { margin: 0; max-width: 62ch; font-size: 1.05rem; }

.search {
  width: 100%;
  margin: 8px 0 12px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #e7dece;
  background: #fff;
}

.filters { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-bottom: 8px; }

.filter {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 48px;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #e4d9c8;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
}

.category-hint {
  margin: 4px 0 0;
  color: var(--muted);
}

.category-empty {
  margin: 0 0 14px;
}

.filter.on {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.count { color: var(--muted); margin: 8px 0 14px; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card { overflow: hidden; display: flex; flex-direction: column; }
.card[hidden] { display: none; }

.card img, .thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #efe8dc;
  display: block;
}

.card .body, .pad { padding: 14px 16px 16px; }

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 1rem;
  line-height: 1.3;
  white-space: normal;
  font-weight: 700;
}

.card h2 {
  font-size: 1.15rem;
  margin: 8px 0 6px;
}

.price { font-weight: 750; margin: 0 0 12px; font-size: 1.05rem; }

.actions { display: flex; gap: 8px; margin-top: auto; }

.actions .btn, .actions button { flex: 1; }

.narrow { width: min(720px, 100%); margin: 0 auto; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}

.product-card { overflow: hidden; }

.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #efe8dc; }

.product-card .pad h1 { margin: 8px 0; font-size: clamp(1.6rem, 3vw, 2.1rem); }

.product-card .price { font-size: 1.35rem; }

.description { white-space: pre-wrap; margin: 0 0 14px; }

.note {
  background: var(--mint);
  border-color: #d5eadf;
  padding: 14px 16px;
  margin: 0 0 14px;
}

.stack { display: grid; gap: 10px; }

label { display: block; font-weight: 750; margin: 12px 0 6px; }

.hint { color: var(--muted); font-weight: 450; margin: -2px 0 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="file"], textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e3d8c6;
  background: #fff;
}

textarea { min-height: 96px; resize: vertical; }

.panel { padding: 18px 18px 20px; margin-bottom: 14px; }

.panel h2 { margin: 0 0 8px; font-size: 1.45rem; }

.line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.line img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #efe8dc;
}

.line .grow { flex: 1; min-width: 0; }

.line h3 { margin: 0 0 4px; font-size: 1.05rem; font-family: "Source Sans 3", "Segoe UI", sans-serif; font-weight: 700; letter-spacing: 0; }

.remove {
  background: none;
  border: 0;
  color: var(--amber);
  font-weight: 750;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
}

.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 750;
  font-size: 1.15rem;
  margin: 12px 0 4px;
}

.muted { color: var(--muted); }

.msg {
  background: #fff7ea;
  border: 1px solid #f0ddb8;
  color: #6d4a12;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}

.msg.ok {
  background: var(--ok-bg);
  border-color: #cfe8da;
  color: var(--green-dark);
}

.qr-slot {
  margin: 12px auto;
  width: min(320px, 100%);
  aspect-ratio: 1;
  border-radius: 16px;
  border: 2px dashed #d9cfc0;
  background: repeating-linear-gradient(
    -45deg,
    #f7f1e7,
    #f7f1e7 14px,
    #efe6d8 14px,
    #efe6d8 28px
  );
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  font-weight: 700;
}

.qr-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
}

.amount { text-align: center; }
.amount .label { color: var(--muted); margin: 0; }
.amount strong { display: block; font-size: 2.2rem; font-family: "Source Serif 4", Georgia, serif; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--amber-bg);
  color: var(--amber);
  font-weight: 750;
}

.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.no { background: #f8e8e4; color: #8d3b28; }

.order {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.order:first-of-type { padding-top: 4px; }

.order-top, .row-between {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.order h3 { margin: 0; font-size: 1.15rem; }

.who { margin: 6px 0; }

.full { width: 100%; }

footer {
  padding: 8px 0 40px;
  color: #3f3a34;
}

footer p { margin: 0 0 6px; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }

.file-row { display: grid; gap: 8px; margin-top: 8px; }

@media (min-width: 700px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { max-width: 22ch; }
}

@media (min-width: 1040px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
  .hero h1 { max-width: none; }
}

@media (max-width: 640px) {
  .brand { order: 1; margin-right: 0; }
  .cart-link { order: 2; margin-left: auto; }
  nav { order: 3; flex-basis: 100%; }
}
