:root {
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --green-light: #e8f5e9;
  --text: #1c1f1c;
  --muted: #5f6b5f;
  --bg: #f6f7f4;
  --card: #ffffff;
  --border: #dfe4dc;
  --danger: #c62828;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 1.6rem; margin: 8px 0; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
a { color: var(--green-dark); }
.muted { color: var(--muted); font-size: .92rem; }
.small { font-size: .9rem; }
.center { text-align: center; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--green); color: #fff;
}
.topbar a, .topbar .link { color: #fff; text-decoration: none; font-weight: 500; }
.topbar nav { display: flex; gap: 16px; align-items: center; }
.brand { font-size: 1.15rem; font-weight: 700; }
form.inline { display: inline; margin: 0; }

footer { text-align: center; padding: 24px 16px 100px; color: var(--muted); font-size: .85rem; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 16px 0;
}

.alert {
  background: #fff3e0; border: 1px solid #ffcc80; border-radius: var(--radius);
  padding: 12px 14px; margin: 12px 0;
}

button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
button.primary, .button.primary { background: var(--green); border-color: var(--green); color: #fff; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.wide { width: 100%; margin-top: 12px; }
button.link { background: none; border: none; min-height: auto; padding: 0; font-weight: 500; text-decoration: underline; }
button.danger { color: var(--danger); }

input[type=email], textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; margin: 6px 0 10px;
}

.products { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.product {
  display: grid; grid-template-columns: 92px 1fr; grid-template-areas: "thumb info" "thumb stepper";
  column-gap: 14px; row-gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: border-color .15s, background .15s;
}
.product.in-cart { border-color: var(--green); background: var(--green-light); }
.product .info { grid-area: info; display: flex; flex-direction: column; align-self: end; }
.product .info strong { font-size: 1.05rem; }
.product .price { font-weight: 600; margin-top: 2px; }
.product .stepper { grid-area: stepper; justify-self: end; align-self: start; }

.thumb {
  grid-area: thumb; width: 92px; height: 92px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .emoji { font-size: 52px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .15)); }
.tint-0 { background: linear-gradient(135deg, #fff3e0, #ffe0b2); }
.tint-1 { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.tint-2 { background: linear-gradient(135deg, #fce4ec, #f8bbd0); }
.tint-3 { background: linear-gradient(135deg, #fffde7, #fff59d); }
.tint-4 { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
.tint-5 { background: linear-gradient(135deg, #f3e5f5, #e1bee7); }

@media (min-width: 720px) {
  main:has(.products) { max-width: 980px; }
  .products { grid-template-columns: 1fr 1fr; }
}

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .step { width: 44px; min-height: 44px; padding: 0; font-size: 1.4rem; border-radius: 50%; }
.stepper .qty { min-width: 64px; text-align: center; font-weight: 700; white-space: nowrap; }

.checkout-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
.checkout-bar strong { font-size: 1.2rem; }

.lines { list-style: none; padding: 0; margin: 0; }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.total { font-size: 1.1rem; text-align: right; }

.radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.radio span { display: flex; flex-direction: column; }
.radio input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--green); }
label.block { display: block; margin-top: 12px; }

.login-buttons { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.provider { width: 100%; }
.provider.google { border-color: #c6c6c6; }
.provider.facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.provider.apple { background: #000; border-color: #000; color: #fff; }

.order-status { text-align: center; padding: 24px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.big-number { font-size: 6rem; font-weight: 800; line-height: 1; color: var(--green-dark); }
.status-ready { background: var(--green); color: #fff; border-color: var(--green); }
.status-ready .big-number, .status-ready .muted { color: #fff; }
.status-cancelled { opacity: .7; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.actions form { margin: 0; }

.order-list { list-style: none; padding: 0; }
.order-list a {
  display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; column-gap: 12px;
  padding: 12px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text);
}
.order-list .num { grid-row: span 2; font-size: 1.5rem; font-weight: 800; color: var(--green-dark); align-self: center; }
.order-list strong { grid-row: span 2; align-self: center; }

body.poster { text-align: center; padding: 32px; background: #fff; }
.poster h1 { font-size: 3rem; }
.poster-qr { width: 60vmin; max-width: 420px; }
.poster .url { font-size: 1.5rem; font-weight: 700; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 32px; width: 32px; object-fit: contain; border-radius: 8px; background: #fff; padding: 2px; }

.store-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.store-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 18px 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
}
.store-card:hover { border-color: var(--green); }
.store-card-logo { width: 88px; height: 88px; object-fit: contain; border-radius: 16px; }
.store-card-logo.placeholder, .logo-preview.placeholder {
  display: flex; align-items: center; justify-content: center; background: var(--green-light); font-size: 40px; color: var(--muted);
}

.alert.success { background: var(--green-light); border-color: #a5d6a7; }
.links a { margin: 0 2px; }
input[type=text], input[type=file] {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; margin: 6px 0 10px; background: #fff;
}
label.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.logo-row form { margin: 0; }
.logo-preview { width: 96px; height: 96px; object-fit: contain; border-radius: 16px; border: 1px solid var(--border); font-size: 14px; }
.seller-list { list-style: none; padding: 0; margin: 8px 0 16px; }
.seller-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.seller-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.seller-form input { margin: 0; }
@media (max-width: 560px) { .seller-form { grid-template-columns: 1fr; } }
.danger-zone { border-color: #ef9a9a; }
.danger-button { background: var(--danger); border-color: var(--danger); color: #fff; }
.poster-logo { width: 140px; height: 140px; object-fit: contain; }

.cast-launcher { width: 64px; height: 64px; cursor: pointer; }
.cast-launcher google-cast-launcher { display: block; width: 64px; height: 64px; --connected-color: #2e7d32; --disconnected-color: #2e7d32; }
