/* ti-cari QR Menü — müşteri menüsü (mockup E1–E4'ten alınmış değerler) */
:root {
  --brand: #1E5B4A;
  --on-brand: #FFFDF8;
  --bg: #FFFDF8;
  --ink: #1F1A17;
  --ink-2: #3A2F28;
  --muted: #6B5F57;
  --line: #E6DFD5;
  --line-2: #D9D2C8;
  --chip: #F1EBE2;
  --sheet-chip: #F6F1E9;
  --warn: #C2410C;
  --warn-dark: #9A3412;
  --warn-bg: #FFF1E6;
  --ok-bg: #E8F3EE;
  --unknown: #57534E;
  --font-head: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html.lock, html.lock body { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
}
a { color: var(--brand); }
a:hover { color: #143F33; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
#main:focus { outline: none; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 8px; }

.ico { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; }

.page { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.main-col { flex: 1; display: flex; flex-direction: column; }
.loading { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ---- Üst bant (E1) ---- */
.top { background: var(--brand); color: var(--on-brand); }
.top-in { max-width: 560px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 20px 16px; display: flex; flex-direction: column; gap: 4px; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top h1 { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.top-sub { font-size: 13px; opacity: .9; }
.lang {
  width: 44px; height: 44px; border-radius: 22px; flex: none;
  border: 1px solid color-mix(in srgb, var(--on-brand) 40%, transparent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.note-bar { background: var(--chip); color: var(--ink-2); font-size: 12px; font-weight: 700; padding: 8px 20px; display: flex; align-items: center; gap: 8px; }
.note-bar.preview { background: #FEF3C7; }
.note-bar .ico { font-size: 16px; }

/* ---- Alerjen filtresi çubuğu ---- */
.fbar-wrap { padding: 12px 16px 0; }
.fbar {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 14px;
  border-radius: 12px; background: var(--warn-bg); border: 1.5px solid var(--warn);
  text-decoration: none; color: var(--ink);
}
.fbar .ico { font-size: 20px; color: var(--warn); }
.fbar-t { display: flex; flex-direction: column; line-height: 1.25; }
.fbar-t b { font-size: 13px; }
.fbar-t span { font-size: 12px; color: var(--muted); }
.fbar.is-empty { background: #fff; border: 1.5px dashed var(--line-2); }
.fbar.is-empty .ico { color: var(--brand); }

/* ---- Kategori sekmeleri ---- */
.tabs { display: flex; gap: 8px; padding: 12px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; flex: none;
}
.tab[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; }

/* ---- Ürün kartları (E1) ---- */
.list { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 8px 16px 16px; }
.card {
  display: flex; flex-direction: column; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: var(--ink);
}
.card.is-warn { border: 1.5px solid var(--warn); }
.card.is-trace { border: 1.5px dashed var(--warn-dark); }
.card.is-unknown { border: 1.5px solid var(--unknown); }
.strip { color: #fff; font-size: 12px; font-weight: 700; padding: 6px 14px; }
.is-warn > .strip { background: var(--warn); }
.is-trace > .strip { background: var(--warn-dark); }
.is-unknown > .strip { background: var(--unknown); }
.card-body { display: flex; gap: 12px; padding: 12px 14px; }
.thumb { width: 68px; height: 68px; border-radius: 10px; flex: none; object-fit: cover; background: #D9C3A8; }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; }
.name { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.25; }
.price { font-weight: 700; font-size: 15px; white-space: nowrap; }
.meta { font-size: 12px; color: var(--muted); }
.meta b { color: var(--ink); }
.ok-line { font-size: 12px; color: var(--brand); font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; background: var(--warn); color: #fff; white-space: nowrap;
}
.badge .ico { font-size: 12px; }
.badge.trace { background: #fff; color: var(--warn-dark); border: 1.5px dashed var(--warn-dark); padding: 1.5px 6.5px; }
.pending-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--chip); color: var(--ink-2);
}
.pending-pill .ico { font-size: 14px; }
.hidden-note { padding: 0 16px 8px; font-size: 12px; color: var(--muted); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }

/* ---- Alt bilgi ---- */
.foot { border-top: 1px solid var(--line); background: var(--bg); padding: 6px 16px calc(14px + env(safe-area-inset-bottom)); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.foot-link { font-size: 12px; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.foot-note { font-size: 11px; color: var(--muted); text-align: right; line-height: 1.35; }
.foot-note a { color: var(--brand); font-weight: 700; }
.foot-meta { font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 4px; }
.demo-tag { background: var(--ink); color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .6px; padding: 2px 8px; border-radius: 999px; }

/* ---- Alt sayfa / E2 ---- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(31, 26, 23, .55); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; background: var(--bg);
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; overflow: hidden;
}
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 4px; flex: none; }
.sheet-head h2 { font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.round {
  width: 44px; height: 44px; border-radius: 22px; background: var(--chip); border: 0; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; flex: none;
}
.round .ico { font-size: 22px; }
.sheet-body { overflow-y: auto; padding: 0 0 4px; flex: 1; }
.sheet-lead { padding: 0 20px 12px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.grid { padding: 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; cursor: pointer;
}
.opt.on { border: 1.5px solid var(--warn); background: var(--warn-bg); font-weight: 700; padding: 3.5px 11.5px; }
.opt input { width: 20px; height: 20px; accent-color: var(--warn); flex: none; margin: 0; }
.nuts { margin: 10px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--sheet-chip); display: flex; flex-direction: column; gap: 6px; }
.nuts-t { font-size: 12px; font-weight: 700; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  min-height: 44px; font-size: 12px; font-weight: 600; padding: 0 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line-2); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: #fff; font-weight: 700; }
.opts { margin: 10px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.trace-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 4px; font-weight: 600; font-size: 13px; cursor: pointer; }
.trace-row input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin: 0; }
.seg { display: flex; gap: 8px; }
.btn {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-weight: 700; font-size: 13px; padding: 0 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center;
}
.seg .btn { flex: 1; }
.seg .btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sheet-foot { display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); flex: none; border-top: 1px solid var(--line); background: var(--bg); }
.sheet-foot .btn { min-height: 48px; font-size: 14px; flex: 1; }
.sheet-foot .primary { flex: 2; background: var(--warn); border-color: var(--warn); color: #fff; font-weight: 800; }

/* ---- Ürün detayı (E3) ---- */
.hero { height: 220px; background: #D9C3A8; position: relative; flex: none; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.back {
  position: absolute; left: 16px; top: calc(16px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 22px;
  background: var(--bg); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; z-index: 2;
}
.back .ico { font-size: 24px; }
.detail { padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.d-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.d-top h1 { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.2; }
.d-sub { font-size: 13px; color: var(--muted); }
.d-price { font-family: var(--font-head); font-size: 20px; font-weight: 800; white-space: nowrap; }
.alert {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-bg); border: 1.5px solid var(--warn); font-size: 13px; line-height: 1.35;
}
.alert .ico { font-size: 22px; color: var(--warn); }
.alert.trace { border: 1.5px dashed var(--warn-dark); }
.alert.trace .ico { color: var(--warn-dark); }
.alert.unknown { background: var(--chip); border-color: var(--unknown); }
.alert.unknown .ico { color: var(--unknown); }
.alert-stack { display: flex; flex-direction: column; gap: 8px; }
.macros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.mac {
  padding: 10px 4px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
}
.mac b { font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.mac span { font-size: 11px; color: var(--muted); }
.mac.kcal { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.mac.kcal b { font-size: 20px; font-weight: 800; }
.mac.kcal span { color: var(--on-brand); }
.mac-note { font-size: 11px; color: var(--muted); margin-top: -4px; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec h2 { font-family: var(--font-head); font-size: 14px; font-weight: 700; }
.sec p { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.badges.big { gap: 8px; }
.badges.big .badge { font-size: 12px; padding: 7px 12px; gap: 6px; }
.badges.big .badge .ico { font-size: 14px; }
.badges.big .badge.trace { font-weight: 700; padding: 5.5px 10.5px; }
.diet { display: flex; gap: 8px; flex-wrap: wrap; }
.diet span { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; background: var(--chip); color: var(--muted); min-height: 32px; display: inline-flex; align-items: center; }
.diet .yes { background: var(--ok-bg); color: var(--brand); }
.diet .warn { background: var(--warn-bg); color: var(--warn-dark); }
.pending-box { padding: 14px; border-radius: 12px; background: var(--chip); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.pending-box b { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.pending-box .ico { font-size: 20px; }
.pending-box p { font-size: 13px; color: var(--ink-2); }
.dfoot { padding: 10px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.35; }

/* ---- 14 alerjen (E4) ---- */
.ihead { padding: calc(16px + env(safe-area-inset-top)) 20px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.ihead h1 { font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.ilead { padding: 14px 20px 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.ilist { flex: 1; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.irow { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); min-height: 44px; font-size: 13px; }
.irow .code {
  width: 56px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 800; padding: 4px 0; border-radius: 999px; background: var(--warn); color: #fff;
}
.irow .code .ico { font-size: 12px; }
.irow.trace { background: #FFF8F2; border: 1.5px dashed var(--warn-dark); }
.irow.trace .code { background: #fff; color: var(--warn-dark); border: 1.5px dashed var(--warn-dark); }
.ifoot { padding: 6px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ifoot .foot-link { font-size: 12px; }
.ifoot span { font-size: 11px; color: var(--muted); }
.ext { gap: 4px; }
.ext .ico { font-size: 14px; }

/* ---- Hata sayfaları ---- */
.err { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px; text-align: center; }
.err .ico { font-size: 56px; color: var(--muted); }
.err h1 { font-family: var(--font-head); font-size: 24px; font-weight: 800; }
.err p { color: var(--ink-2); max-width: 32ch; font-size: 14px; line-height: 1.5; }
.err .btn { background: var(--brand); border-color: var(--brand); color: var(--on-brand); padding: 0 24px; margin-top: 4px; }
.err-brand { color: var(--muted); font-size: 12px; }

@media (min-width: 600px) {
  .hero { height: 260px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab, .btn, .chip, .opt { transition: background-color .12s, border-color .12s; }
}
