/* =============================================================================
   Esnafhan QR Menü — docs/QR-MENU.md §11.
   Yazı tipi YEREL (sistem yığını): masada 3G'de ilk açılış < 2 sn hedefi, web fontu indirilmez.
   Marka rengi --brand işletmenin tema renginden gelir (app.js yazar); koda renk gömülmez.
   Yön için mantıksal özellikler (margin-inline, padding-inline…) — Arapça (sağdan sola) Faz 1c'de
   yalnız dir="rtl" ile gelsin.
   ============================================================================= */
:root {
    --brand: #C0392B;
    --brand-ink: #FFFFFF;
    --ink: #1B1B1F;
    --muted: #5F6368;
    --line: #E6E6EA;
    --bg: #FFFFFF;
    --soft: #F6F6F8;
    --red: #B3261E;
    --red-bg: #FDECEA;
    --amber: #8A5A00;
    --amber-bg: #FFF4D6;
    --grey-bg: #EEEEF1;
    --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

#app { max-width: 760px; margin-inline: auto; padding-bottom: 40px; }

.loading, .notFound { padding: 64px 24px; text-align: center; color: var(--muted); }
.notFound h1 { color: var(--ink); font-size: 1.3rem; margin: 0 0 8px; }

/* ---- Üst bölüm ---- */
.cover { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; background: var(--soft); }
.head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.head .logo { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; background: var(--soft); }
.head .titleBox { flex: 1; min-width: 0; }
.head h1 { font-size: 1.35rem; margin: 0; line-height: 1.2; }
.head .lang { flex: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; background: var(--bg);
    font: inherit; font-size: .9rem; color: var(--ink); }
.head .table { display: inline-block; margin-top: 4px; font-size: .8rem; font-weight: 600; padding: 2px 10px;
    border-radius: 999px; background: var(--brand); color: var(--brand-ink); }

.tools { display: flex; gap: 8px; padding: 6px 16px 10px; }
.btn { border: 0; border-radius: 12px; padding: 10px 16px; background: var(--brand); color: var(--brand-ink);
    font-weight: 600; cursor: pointer; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn .count { display: inline-block; min-width: 20px; margin-inline-start: 6px; padding: 0 6px; border-radius: 999px;
    background: var(--brand); color: var(--brand-ink); font-size: .8rem; }

/* ---- Kategori çipleri (yapışkan) ---- */
.chips { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
    background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 14px;
    font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Filtre özeti ---- */
.filterNote { margin: 10px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--soft); font-size: .9rem; }

/* ---- Liste ---- */
section.cat { padding: 6px 16px 0; scroll-margin-top: 60px; }
section.cat h2 { font-size: 1.15rem; margin: 18px 0 6px; }
.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer;
    background: none; border-inline: 0; border-top: 0; width: 100%; text-align: start; }
.item .text { flex: 1; min-width: 0; }
.item .name { font-weight: 650; }
.item .desc { color: var(--muted); font-size: .9rem; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: .85rem; }
.item .price { font-weight: 700; }
.item .kcal { color: var(--muted); }
.item .thumb { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; flex: none; background: var(--soft); }
/* İçeren ürün soluklaşır AMA uyarı rozeti tam renkte kalır — asıl mesaj odur. */
.item.dim .name, .item.dim .desc, .item.dim .price, .item.dim .kcal, .item.dim .an, .item.dim .thumb { opacity: .45; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 999px;
    background: var(--soft); color: var(--ink); }
.badge.brand { background: var(--brand); color: var(--brand-ink); }
.badge.contains { background: var(--red-bg); color: var(--red); }
.badge.maycontain { background: var(--amber-bg); color: var(--amber); }
.badge.noinfo { background: var(--grey-bg); color: var(--muted); }

/* Alerjen numaraları (ürün satırı): numara + kısa ad, yalnız renk DEĞİL — metin de var. */
.an { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; padding: 1px 7px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted); }
.an b { color: var(--ink); }

/* ---- Alt paneller ---- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end;
    justify-content: center; }
.sheetBox { width: 100%; max-width: 760px; max-height: 88vh; overflow-y: auto; background: var(--bg);
    border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheetHead { display: flex; align-items: flex-start; gap: 12px; }
.sheetHead h2 { flex: 1; margin: 4px 0 8px; font-size: 1.25rem; }
.close { border: 0; background: var(--soft); width: 36px; height: 36px; border-radius: 50%; font-size: 1.4rem;
    line-height: 1; cursor: pointer; flex: none; }
.hint { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.checks { display: grid; grid-template-columns: 1fr; gap: 2px; }
.checks label { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line);
    cursor: pointer; }
.checks input { width: 20px; height: 20px; accent-color: var(--brand); }
.sheetActions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.detailImg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; margin-bottom: 12px; background: var(--soft); }
.detail p { margin: 6px 0; }
.detail h3 { font-size: 1rem; margin: 16px 0 6px; }
.prices { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.prices div { display: flex; justify-content: space-between; font-weight: 600; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.fact { background: var(--soft); border-radius: 12px; padding: 8px 10px; }
.fact small { display: block; color: var(--muted); font-size: .75rem; }
.fact b { font-size: 1.05rem; }
.alist { list-style: none; padding: 0; margin: 0; }
.alist li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.noInfoBox { background: var(--grey-bg); border-radius: 12px; padding: 12px; color: var(--ink); }

/* ---- Alt bilgi ---- */
footer.foot { padding: 20px 16px; color: var(--muted); font-size: .85rem; }
footer.foot p { margin: 6px 0; }
footer.foot a { color: var(--muted); }
footer.foot .made { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; text-decoration: none; }
footer.foot .made img { height: 18px; width: auto; }
