/* ================================================================
   QR Menü — müşteri arayüzü
   Renkler yönetim panelindeki "Tema" ayarlarından gelir (--bg, --accent ...)
   ================================================================ */
:root {
  --bg: #0f0d0b;
  --surface: #1a1714;
  --text: #f5efe6;
  --muted: #a99d8f;
  --accent: #d4a373;
  --accent2: #e76f51;
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --surface-2: color-mix(in srgb, var(--surface) 70%, var(--text) 6%);
  --radius: 20px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }

.app { max-width: 600px; margin: 0 auto; position: relative; min-height: 100vh; }
@media (min-width: 640px) {
  body { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg)); }
  .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(0,0,0,.4); background: var(--bg); }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: 62vh;
  min-height: 62svh;
  display: flex;
  align-items: flex-end;
  padding: calc(40px + var(--safe-top)) 24px 56px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -1; background: var(--bg); }
.hero-bg.has-image { background-size: cover; background-position: center; transform: scale(1.08); animation: heroZoom 18s var(--ease) infinite alternate; }
.hero-bg.has-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.35) 40%, var(--bg) 100%); }
.hero-bg.has-image .blob { display: none; }
@keyframes heroZoom { to { transform: scale(1); } }

.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; will-change: transform; }
.b1 { width: 340px; height: 340px; background: var(--accent); top: -80px; left: -100px; animation: float1 14s ease-in-out infinite; }
.b2 { width: 280px; height: 280px; background: var(--accent2); top: 20%; right: -120px; opacity: .35; animation: float2 17s ease-in-out infinite; }
.b3 { width: 260px; height: 260px; background: color-mix(in srgb, var(--accent) 50%, #ffffff); bottom: -120px; left: 30%; opacity: .18; animation: float3 20s ease-in-out infinite; }
.hero-bg:not(.has-image)::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--bg) 100%);
}
@keyframes float1 { 50% { transform: translate(60px, 50px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(-50px, 40px) scale(.9); } }
@keyframes float3 { 50% { transform: translate(-40px, -50px) scale(1.15); } }

.hero-inner { width: 100%; animation: rise .9s var(--ease) both; }
.hero-logo:empty { display: none; }
.hero-logo img { width: 76px; height: 76px; border-radius: 22px; object-fit: cover; margin-bottom: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 13vw, 68px);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent) 60%, var(--text) 90%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 8s linear infinite;
}
@keyframes shine { to { background-position: -200% center; } }
.hero-tagline { color: var(--muted); margin: 0 0 22px; font-size: 17px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.chip-table { background: var(--accent); color: var(--bg); border-color: transparent; }
button.chip:active { transform: scale(.96); }

.scroll-hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); width: 22px; height: 34px; border: 2px solid var(--line); border-radius: 12px; }
.scroll-hint span { position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------------- Üst çubuk ---------------- */
.topbar {
  position: fixed; top: 0; left: 50%; z-index: 30;
  width: 100%; max-width: 600px;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-top)) 16px 10px 20px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  transform: translate(-50%, -100%);
  transition: transform .4s var(--ease);
}
.topbar.show { transform: translate(-50%, 0); }
.topbar-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-btn { height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; font-weight: 800; letter-spacing: .04em; margin-right: 4px; }
.lang-btn:active { background: var(--line); }
.vprice { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 800; color: var(--accent); font-size: 15px; }
.vprice small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.vprice + .vprice::before { content: '·'; color: var(--muted); margin-right: 4px; }
.promo-daily { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.sheet-sub { margin: 4px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet-list li span.accent { color: var(--accent); font-weight: 800; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.icon-btn:active { background: var(--line); }

/* ---------------- Arama ---------------- */
.search-wrap { padding: 0 16px; margin-top: -26px; position: relative; z-index: 2; }
.search {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 52px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 12px 30px rgba(0,0,0,.25); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--muted); opacity: .8; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 50%; background: var(--line); color: var(--text); }

/* ---------------- Kategori şeridi ---------------- */
.cats {
  position: sticky; top: calc(60px + var(--safe-top)); z-index: 20;
  margin-top: 14px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, top .4s var(--ease);
}
.cats.stuck { border-bottom-color: var(--line); }
body:not(.topbar-visible) .cats { top: 0; }
.cats-track {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  scrollbar-width: none; scroll-behavior: smooth; position: relative;
}
.cats-track::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); white-space: nowrap;
  transition: color .25s, background .25s, border-color .25s, transform .2s;
}
.cat-btn:active { transform: scale(.95); }
.cat-btn.active { color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------------- Bölümler ---------------- */
#content { padding: 8px 0 24px; }
.section { padding: 28px 0 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 20px; margin-bottom: 14px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title .emoji { font-size: 24px; }
.section-sub { color: var(--muted); font-size: 13px; font-weight: 600; }

/* Yatay kaydırmalı şeritler */
.rail {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 20px 16px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; scroll-margin-left: 20px; }

/* Kampanya kartı */
.promo {
  flex: none; width: min(82vw, 400px);
  position: relative; border-radius: 24px; padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 200%;
  animation: borderFlow 6s ease infinite;
  text-align: left;
}
@keyframes borderFlow { 50% { background-position: 100% 100%; } }
.promo-inner {
  height: 100%; border-radius: 22px; overflow: hidden; position: relative;
  background: var(--surface);
  display: flex; flex-direction: column;
}
.promo-img { height: 150px; position: relative; overflow: hidden; }
.promo-img img { width: 100%; height: 100%; object-fit: cover; }
.promo-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.promo-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  padding: 6px 10px; border-radius: 10px;
  background: var(--accent2); color: #fff; font-weight: 800; font-size: 13px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent2) 50%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
.promo-badge.inline { position: static; align-self: flex-start; transform-origin: left center; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.promo-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0; }
.promo-items { display: flex; flex-wrap: wrap; gap: 6px; }
.promo-items span { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.promo-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 14px; margin-right: 8px; }
.price-new { font-size: 24px; font-weight: 800; color: var(--accent); }
.countdown { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.countdown::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* Öne çıkan kartı */
.feat {
  flex: none; width: min(62vw, 260px); text-align: left;
  border-radius: var(--radius); overflow: hidden; position: relative;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--ease);
}
.feat:active { transform: scale(.97); }
.feat-img { aspect-ratio: 4 / 5; position: relative; overflow: hidden; }
.feat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.feat-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.75)); }
.feat-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; z-index: 1; color: #fff; }
.feat-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.15; margin: 0 0 4px; }
.feat-price { font-weight: 800; color: var(--accent); font-size: 16px; }
.feat-star { position: absolute; top: 12px; right: 12px; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--accent); font-size: 15px; }

/* Görseli olmayan ürünler için zarif yer tutucu */
.ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--accent2) 25%, transparent), transparent 55%),
    var(--surface-2);
}
.ph span { font-size: 42px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
.item .ph span { font-size: 30px; }

/* Ürün satırı */
.list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; gap: 14px; align-items: stretch; width: 100%; text-align: left;
  padding: 12px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .25s;
}
.item:active { transform: scale(.985); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.item-name { font-weight: 700; font-size: 16px; line-height: 1.3; margin: 0; }
.item-desc { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.item-price { font-weight: 800; color: var(--accent); font-size: 16px; }
.item-thumb { flex: none; width: 96px; height: 96px; border-radius: 14px; overflow: hidden; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; text-transform: capitalize; background: var(--surface-2); color: var(--muted); }
.tag-popüler, .tag-populer { background: color-mix(in srgb, var(--accent2) 18%, transparent); color: var(--accent2); }
.tag-yeni { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.tag-vegan { background: rgba(110, 190, 120, .16); color: #7fd08a; }

.empty { text-align: center; color: var(--muted); padding: 60px 24px; }
.empty b { display: block; font-size: 40px; margin-bottom: 10px; }

/* Kaydırınca beliren animasyon */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Görseller yumuşak yüklensin */
img.lazy { opacity: 0; transition: opacity .5s ease; }
img.lazy.loaded { opacity: 1; }

/* ---------------- Alt bilgi ---------------- */
.footer { padding: 40px 20px calc(40px + var(--safe-bottom)); text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 20px; }
.footer-name { font-family: var(--font-display); font-size: 26px; color: var(--text); margin: 0 0 6px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.footer-links a, .footer-links button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.footer small { display: block; margin-top: 18px; opacity: .6; font-size: 12px; }

/* ---------------- Ürün detayı ---------------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .35s ease; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 41;
  width: 100%; max-width: 600px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding-bottom: calc(24px + var(--safe-bottom));
  transform: translate(-50%, 100%);
  transition: transform .45s var(--ease);
  overscroll-behavior: contain;
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255,255,255,.35); z-index: 2; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; font-size: 24px; line-height: 1; background: rgba(0,0,0,.4); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-img { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 28px 28px 0 0; }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; }
.sheet-img.short { aspect-ratio: 16 / 7; }
.sheet-content { padding: 22px 22px 8px; }
.sheet-pad { padding-top: 56px; }
.sheet-content h2 { font-family: var(--font-display); font-size: 30px; line-height: 1.1; margin: 0 0 10px; }
.sheet-content p { color: var(--muted); margin: 0 0 16px; }
.sheet-price { font-size: 28px; font-weight: 800; color: var(--accent); }
.sheet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.sheet-list { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.sheet-list li { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.sheet-list li span:last-child { color: var(--muted); }

/* ---------------- Bildirim ---------------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 60; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; transition: all .35s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- Yükleniyor ---------------- */
.skeleton { padding: 20px; }
.sk { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s ease-in-out infinite; border-radius: 16px; }
.sk-title { height: 28px; width: 50%; margin: 18px 0 14px; }
.sk-row { display: flex; gap: 14px; }
.sk-card { height: 220px; flex: 1; }
.sk-item { height: 110px; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Hareket hassasiyeti olan kullanıcılar için animasyonları azalt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
