:root {
  --green-900: #0f4d26;
  --green-800: #145c2e;
  --green-700: #1b6b35;
  --green-100: #e3f1e6;
  --green-50: #f1f8f2;
  --lime: #7cc242;
  --lime-dark: #5ea52a;
  --bg: #f3f6f2;
  --card: #ffffff;
  --text: #1c2a1f;
  --muted: #5f6f63;
  --line: #e2e8e2;
  --red: #d32f2f;
  --red-bg: #fdecec;
  --amber: #f9a825;
  --amber-bg: #fff6d9;
  --purple: #5b2c9d;
  --purple-bg: #f1ebfa;
  --orange: #ef6c1f;
  --orange-bg: #fff1e8;
  --amber-deep: #8a5200;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(15, 77, 38, 0.05), 0 4px 14px rgba(15, 77, 38, 0.06);
  --nav-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--green-800); }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); }
.screen { padding: 12px 16px 24px; }

/* ---------- header ---------- */
.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; gap: 12px; }
.logo { height: 68px; width: auto; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; box-shadow: var(--shadow);
}
.lang-btn .flag { font-size: 18px; line-height: 1; }
.greeting { padding: 8px 16px 4px; }
.greeting h1 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -0.4px; }
.greeting p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- market summary ---------- */
.market { margin: 12px 16px 0; background: #e9f3ec; border: 1px solid #d3e5d8; border-radius: var(--radius); padding: 12px 12px 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.market-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.market-head h2 { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--green-900); letter-spacing: 0.8px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.market-head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(124, 194, 66, 0.25); }
.market-head span { font-size: 11px; color: var(--green-800); background: rgba(255,255,255,0.75); border-radius: 999px; padding: 3px 9px; font-weight: 600; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat {
  background: var(--card); border-radius: 13px; padding: 9px 8px; display: flex; align-items: center; gap: 7px; box-shadow: 0 1px 2px rgba(15, 77, 38, 0.06);
  border: 1.5px solid #dbe8de; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 56px; -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.stat:active { transform: scale(0.97); }
.stat.active { background: var(--green-900); border-color: var(--green-900); box-shadow: 0 4px 12px rgba(15, 77, 38, 0.28); }
.stat.active b, .stat.active small { color: #fff; }
.stat.active small { font-weight: 700; opacity: 0.9; }
.stat .icon { font-size: 20px; }
.stat b { display: block; font-size: 22px; line-height: 1; font-weight: 800; letter-spacing: -0.5px; color: var(--green-900); }
.stat small { font-size: 10.5px; color: var(--muted); display: block; margin-top: 3px; font-weight: 700; letter-spacing: 0.2px; }

/* ---------- search & chips ---------- */
.search { margin: 12px 16px 0; position: relative; }
.search input {
  width: 100%; padding: 14px 44px 14px 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  font-size: 16px; box-shadow: 0 1px 2px rgba(15, 77, 38, 0.05); outline: none;
}
.search input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(124, 194, 66, 0.25); }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; font-size: 20px; color: var(--muted); padding: 6px 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 10px 14px; border-radius: 999px; border: 1px solid #dfe6df; background: var(--card);
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.chip.active { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.status-chips { padding-top: 6px; }
.chip.status { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border-color: var(--green-100); background: var(--green-50); }
.chip.status .n { background: rgba(15, 77, 38, 0.1); color: var(--green-900); border-radius: 999px; padding: 2px 7px; font-size: 12px; }
.chip.status.active { background: var(--lime); color: var(--green-900); border-color: var(--lime-dark); box-shadow: 0 2px 6px rgba(94, 165, 42, 0.3); }
.chip.status.active .n { background: rgba(255, 255, 255, 0.7); }

/* ---------- product cards ---------- */
.products { display: flex; flex-direction: column; gap: 12px; padding: 8px 16px 0; }
.product {
  display: grid; grid-template-columns: 42% 1fr; background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid #e4eae4; min-height: 172px;
}
.product .photo { position: relative; background: #eaf0e8; }
.product .photo img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1; }
/* several photos: native horizontal swipe, one photo per snap point */
.product .photo .gallery {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain;
}
.product .photo .gallery::-webkit-scrollbar { display: none; }
.product .photo .gallery img { flex: 0 0 100%; height: 100%; aspect-ratio: auto; scroll-snap-align: center; scroll-snap-stop: always; }
.product .photo .dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.product .photo .dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.6); box-shadow: 0 1px 3px rgba(0,0,0,0.45); transition: width 0.15s, background 0.15s; }
.product .photo .dots span.on { width: 16px; border-radius: 3px; background: #fff; }
.product .photo .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 64px; }
.badge {
  position: absolute; top: 8px; left: 8px; padding: 4px 8px; border-radius: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  color: #fff; background: var(--orange); box-shadow: 0 1px 3px rgba(0,0,0,0.22);
}
.badge.new { background: var(--purple); }
.product .info { padding: 11px 12px 12px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.product h3 { margin: 0; font-size: 16.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1px; line-height: 1.15; color: var(--green-900); }
.product .desc { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.35px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
/* origin: where the produce comes from, easy to spot without stealing the card */
.origin {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; background: #fff; border: 1px solid #cfe3d4; color: var(--green-800);
  font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; line-height: 1.5;
}
.sheet-head .desc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.3px; }
.price-line { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.price { font-size: 25px; font-weight: 800; letter-spacing: -0.7px; color: var(--green-900); line-height: 1.05; }
.price-unit { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.delta { font-size: 11.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.3px; text-transform: uppercase; align-self: flex-start; }
.delta.down { color: #b42318; background: var(--red-bg); }
.delta.up { color: var(--green-800); background: var(--green-100); }
.delta.steady { color: var(--muted); background: #eff2ef; }
.delta.hot { color: #b3480f; background: var(--orange-bg); }
.unit-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 5px 0 3px; }
.unit-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 9px; border: 1.5px solid var(--green-700);
  background: #fff; color: var(--green-900); font-size: 12.5px; font-weight: 800; letter-spacing: 0.3px; line-height: 1; /* shown exactly as the admin typed it */
}
.unit-badge.active { background: var(--green-900); border-color: var(--green-900); color: #fff; box-shadow: 0 2px 5px rgba(15, 77, 38, 0.22); }
button.unit-badge.active::before { content: '✓'; font-size: 12px; }
.unit-badge.single { box-shadow: none; }
.unit-badge.mini { padding: 3px 8px; font-size: 11px; border-radius: 7px; border-width: 1px; }
.pallet-deal {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; margin: 4px 0; padding: 7px 10px 7px 12px; border-radius: 12px;
  border: 1px solid #f3cf6a; background: #fff8e3; box-shadow: inset 3px 0 0 var(--amber); color: var(--amber-deep); font-size: 11.5px; font-weight: 700; line-height: 1.25;
}
.pallet-deal .pd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pallet-deal .pd-title { font-size: 11.5px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; }
.pallet-deal .pd-save { background: var(--orange); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap; }
.pallet-deal .pd-total { color: var(--green-900); border-top: 1px dashed #ecd28a; padding-top: 3px; margin-top: 1px; }
.pallet-deal .pd-total b { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.pallet-deal b { color: var(--green-900); font-size: 12.5px; }
.pallet-deal:active { transform: scale(0.98); }
.unit-option .pd-save-inline { color: var(--red); font-weight: 800; }
.unit-option.pallet { border-color: var(--amber); background: var(--amber-bg); }
.unit-option.pallet.active { border-color: var(--green-900); background: var(--green-50); }
.btn-add {
  margin-top: auto; align-self: stretch; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 12px; border-radius: 13px; border: none; background: var(--green-900); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.1px;
  box-shadow: 0 2px 6px rgba(15, 77, 38, 0.22); transition: transform 0.08s ease;
}
.btn-add:active { transform: scale(0.97); }
.btn-add .qty-pill { background: var(--lime); color: var(--green-900); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.96); border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(15, 77, 38, 0.06);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px calc(6px + var(--safe-bottom)); z-index: 20;
}
.nav-inner { max-width: 560px; margin: 0 auto; display: contents; }
.nav button { border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 12px; color: var(--muted); font-size: 12px; font-weight: 700; position: relative; }
.nav button.active { color: var(--green-900); background: var(--green-50); }
.nav button .ic { font-size: 22px; line-height: 1; }
.nav .count { position: absolute; top: 2px; right: calc(50% - 26px); background: var(--red); color: #fff; font-size: 11px; min-width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 5px; font-weight: 800; }

/* ---------- generic ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 15px 18px; border-radius: 14px; border: none; font-weight: 800; font-size: 16px; width: 100%; }
.btn-primary { background: var(--green-900); color: #fff; box-shadow: 0 3px 8px rgba(15, 77, 38, 0.3); }
.btn-primary:disabled { opacity: 0.6; }
.btn-secondary { background: var(--green-50); color: var(--green-900); border: 1px solid var(--green-100); }
.btn-ghost { background: transparent; color: var(--muted); padding: 10px; }
.btn-lime { background: var(--lime); color: var(--green-900); }
.section-title { font-size: 22px; font-weight: 800; margin: 8px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 700; font-size: 14px; }
.field label small { color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select {
  width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(124, 194, 66, 0.25); }
.field .error { color: var(--red); font-size: 13px; font-weight: 600; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px);
  background: var(--green-900); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 40; opacity: 0; transition: opacity 0.2s; pointer-events: none; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; }

/* ---------- bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 12px 16px calc(20px + var(--safe-bottom)); max-height: 92vh; overflow-y: auto; animation: up 0.2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet .handle { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.sheet-head img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; }
.sheet-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.sheet h4 { margin: 12px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.unit-options { display: grid; gap: 8px; }
.unit-option { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; text-align: left; }
.unit-option.active { border-color: var(--green-900); background: var(--green-50); }
.unit-option b { font-size: 16px; }
.unit-option small { display: block; color: var(--muted); font-size: 12px; }
.unit-option .p { font-size: 18px; font-weight: 800; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 14px; }
.stepper button { width: 56px; height: 56px; border-radius: 16px; border: 1px solid var(--line); background: var(--green-50); font-size: 28px; font-weight: 800; color: var(--green-900); }
.stepper input { width: 90px; height: 56px; text-align: center; font-size: 26px; font-weight: 800; border: 1px solid var(--line); border-radius: 14px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- cart ---------- */
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.cart-item .name { font-weight: 800; font-size: 15px; }
.cart-item .meta { color: var(--muted); font-size: 13px; }
.cart-item .line { font-weight: 800; font-size: 16px; text-align: right; }
.mini-stepper { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.mini-stepper button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--green-50); font-size: 18px; font-weight: 800; color: var(--green-900); }
.mini-stepper span { min-width: 28px; text-align: center; font-weight: 800; }
.mini-stepper .rm { border: none; background: transparent; color: var(--red); font-size: 13px; font-weight: 700; width: auto; padding: 0 6px; }
.totals { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 0; font-size: 18px; }
.totals b { font-size: 26px; font-weight: 800; }
.sticky-cta { position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + 8px); margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--green-800); font-weight: 700; margin-bottom: 10px; list-style: none; }
details.more summary::before { content: '+ '; }
details.more[open] summary::before { content: '– '; }

/* ---------- orders ---------- */
.order-card { margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-head b { font-size: 16px; }
.status { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-new { background: #e3f2fd; color: #0d47a1; }
.status-confirmed { background: var(--green-100); color: var(--green-900); }
.status-preparing { background: var(--amber-bg); color: #8a5a00; }
.status-out_for_delivery { background: #ede7f6; color: var(--purple); }
.status-delivered { background: var(--green-900); color: #fff; }
.status-cancelled { background: var(--red-bg); color: var(--red); }
.order-items { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.order-items li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.order-items li:last-child { border-bottom: none; }

/* ---------- success ---------- */
.success { text-align: center; padding: 30px 16px; }
.success .check { width: 88px; height: 88px; border-radius: 50%; background: var(--lime); color: var(--green-900); font-size: 48px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.success h2 { margin: 0 0 6px; font-size: 26px; }
.success .num { font-size: 20px; font-weight: 800; color: var(--green-900); margin: 10px 0 20px; }

@media (min-width: 600px) {
  .app { box-shadow: 0 0 40px rgba(0,0,0,0.08); background: var(--bg); }
  .nav { left: 50%; transform: translateX(-50%); max-width: 560px; border-radius: 16px 16px 0 0; }
}

/* ---------- full-screen photo viewer ---------- */
.product .photo { cursor: zoom-in; }
body.viewer-open { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 60; background: #0b0f0c; color: #fff; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); animation: viewer-in 0.15s ease-out;
}
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; flex: 0 0 auto; }
.viewer-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12); color: #fff; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.viewer-back:active { background: rgba(255,255,255,0.28); }
.viewer-count { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.8); font-variant-numeric: tabular-nums; padding-right: 6px; }
.viewer-track {
  flex: 1 1 auto; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-x;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track.zoomed { overflow-x: hidden; touch-action: none; }
.viewer-slide { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.viewer-slide img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.viewer-dots { display: flex; justify-content: center; gap: 7px; padding: 14px 0 4px; flex: 0 0 auto; }
.viewer-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.35); transition: width 0.15s, background 0.15s; }
.viewer-dots span.on { width: 22px; border-radius: 4px; background: #fff; }
.viewer-info { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 16px 16px; text-align: center; }
.viewer-info b { font-size: 18px; font-weight: 800; }
.viewer-info span { font-size: 15px; color: rgba(255,255,255,0.8); }
.viewer-info strong { color: var(--lime); font-weight: 800; }

/* order lookup results: compact rows that open on tap */
details.order-card > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
details.order-card > summary::-webkit-details-marker { display: none; }
.order-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.order-sub b { font-size: 16px; }
.order-toggle { display: inline-block; margin-top: 6px; color: var(--green-800); font-weight: 700; }
details.order-card[open] > summary .order-toggle { display: none; }

/* share a product: one small, secondary control under "Add to order" */
.share-link { align-self: flex-end; margin-top: 2px; padding: 4px 6px; min-height: 30px; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.share-link:active { background: var(--green-50); color: var(--green-900); }
.focus-banner { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--green-100); border: 1px solid #c9e3cf; border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--green-900); }
.focus-banner button { border: none; background: var(--green-900); color: #fff; font: inherit; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.product.focus { box-shadow: 0 0 0 3px var(--lime), var(--shadow); }

/* ---------- list / grid toggle ---------- */
.search-row { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; }
.search-row .search { flex: 1; margin: 0; min-width: 0; }
.view-toggle { display: inline-flex; flex: 0 0 auto; background: var(--card); border: 1.5px solid #dfe7df; border-radius: 12px; padding: 3px; gap: 2px; }
.view-toggle button { width: 40px; height: 40px; border: none; background: transparent; color: var(--muted); border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.view-toggle button.active { background: var(--green-900); color: #fff; }
.view-toggle button:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; }

/* ---------- grid view: the same cards, photo on top, compact ---------- */
.products.grid-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.products.grid-view > .focus-banner, .products.grid-view > .empty { grid-column: 1 / -1; }
.products.grid-view .product { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
.products.grid-view .product .photo { aspect-ratio: 1 / 1; }
.products.grid-view .product .photo img { height: 100%; }
.products.grid-view .product .photo .fallback { font-size: 46px; }
.products.grid-view .badge { top: 6px; left: 6px; padding: 3px 6px; font-size: 9.5px; }
.products.grid-view .product .info { padding: 8px 9px 9px; gap: 3px; }
.products.grid-view .product h3 { font-size: 13.5px; line-height: 1.2; overflow-wrap: anywhere; }
.products.grid-view .product .desc { font-size: 10.5px; letter-spacing: 0.2px; }
.products.grid-view .product .desc > span:not(.origin) { display: none; } /* the description (still in the Add sheet); the origin stays */
.products.grid-view .price { font-size: 19px; }
.products.grid-view .unit-badges { gap: 4px; margin: 3px 0 2px; }
.products.grid-view .unit-badge { padding: 5px 8px; font-size: 11.5px; min-height: 32px; }
.products.grid-view .pallet-deal { padding: 6px 7px; }
.products.grid-view .pallet-deal .pd-total b { font-size: 13px; }
.products.grid-view .btn-add { min-height: 42px; padding: 8px 6px; font-size: 13px; gap: 4px; margin-top: auto; }
.products.grid-view .share-link { align-self: center; font-size: 11.5px; min-height: 28px; }
@media (min-width: 600px) {
  .products.grid-view { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* wide screens: only the grid breaks out of the 560px app column (header, cart and nav stay as they are) */
@media (min-width: 900px) {
  .products.grid-view { width: min(1180px, calc(100vw - 64px)); margin-left: 50%; transform: translateX(-50%); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 1200px) {
  .products.grid-view { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
