:root {
  --forest: #1f3d2b;
  --moss: #3e6b48;
  --sand: #f5efe4;
  --card: #ffffff;
  --ink: #1d231f;
  --muted: #5d6a61;
  --line: #e2dccf;
  --accent: #d9822b;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--sand);
  color: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
}

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--forest);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 28px; }
.top h1 { margin: 0; font-size: 18px; letter-spacing: 0.2px; }
.tag { margin: 0; font-size: 12px; opacity: 0.8; }
.cart-link {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.14);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

main { max-width: 720px; margin: 0 auto; padding: 16px; }

.hero {
  background: linear-gradient(135deg, var(--moss), var(--forest));
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 20px;
}
.hero h2 { margin: 0 0 4px; font-size: 22px; }
.hero p { margin: 0; }
.hero strong { background: var(--accent); padding: 1px 6px; border-radius: 6px; }

.section-title { font-size: 18px; margin: 0 0 10px; }

.products { display: grid; gap: 12px; margin-bottom: 24px; }
@media (min-width: 560px) { .products { grid-template-columns: 1fr 1fr; } }

.product {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.product-art {
  flex: 0 0 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: var(--sand);
  border-radius: 10px;
}
.product-info { flex: 1; min-width: 0; }
.product h3 { margin: 0; font-size: 16px; }
.product p { margin: 2px 0 8px; color: var(--muted); font-size: 14px; }
.product-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; }

button {
  font: inherit;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.add { background: var(--moss); color: #fff; padding: 8px 12px; font-size: 14px; font-weight: 600; }
.add:active { transform: scale(0.97); }

.cart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.line-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-price { font-weight: 600; min-width: 64px; text-align: right; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.step { width: 28px; height: 28px; background: var(--sand); font-weight: 700; }
.empty { color: var(--muted); padding: 8px 0; }

.coupon label { font-size: 14px; font-weight: 600; }
.coupon-row { display: flex; gap: 8px; margin-top: 6px; }
.coupon input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-transform: uppercase;
}
.coupon button { background: var(--forest); color: #fff; padding: 0 16px; font-weight: 600; }
.coupon-msg { min-height: 20px; margin: 6px 0 0; font-size: 14px; color: var(--moss); }

.totals { margin: 12px 0 16px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-size: 20px; font-weight: 700; }
#discount { color: var(--moss); }

.pay {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}
.pay:disabled { opacity: 0.5; cursor: default; }

.confirm {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 30, 24, 0.55);
}
.confirm[hidden] { display: none; }
.confirm-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}
.confirm-card h2 { margin: 0 0 6px; }
.confirm-card button { margin-top: 12px; background: var(--forest); color: #fff; padding: 10px 24px; font-weight: 600; }
