:root {
  --bull: #d90916;      /* logo kırmızısı */
  --horn: #a80d12;      /* logodaki koyu boğa tonu */
  --ink: #1d1616;       /* logo konturu */
  --flour: #fbf3ea;     /* sayfa zemini */
  --plate: #ffffff;     /* ürün görselinin oturduğu tabak */
  --muted: #6e5e58;
  --ok: #24813a;
  --display: 'Alfa Slab One', Georgia, serif;
  --body: 'Figtree', system-ui, sans-serif;
  --stroke: 2.5px solid var(--ink);
  --pop: 3px 3px 0 var(--ink);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--flour);
  color: var(--ink);
  font: 500 16px/1.45 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

/* Logodaki gibi beyaz, siyah konturlu, hafif yükselen yazı. Sadece masa numarasında. */
.masa-title {
  margin: 0;
  font: 400 clamp(56px, 19vw, 96px)/0.95 var(--display);
  color: #fff;
  -webkit-text-stroke: 9px var(--ink);
  paint-order: stroke fill;
  transform: rotate(-5deg);
  letter-spacing: 0.01em;
}

/* Butonlar: logodaki harfler gibi konturlu çıkartma */
.btn {
  border: var(--stroke);
  border-radius: 999px;
  box-shadow: var(--pop);
  font-weight: 800;
  padding: 10px 18px;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { font-size: 18px; padding: 15px 24px; }
.btn-sm { font-size: 14px; padding: 7px 14px; box-shadow: 2px 2px 0 var(--ink); }
.btn-block { display: block; width: 100%; }
.btn-white { background: #fff; color: var(--ink); }
.btn-red { background: var(--bull); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; box-shadow: none; }
.btn-text {
  background: none; border: 0; color: #fff; font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; padding: 12px;
}

/* 1. Karşılama */
.welcome {
  min-height: 100svh;
  background: var(--bull);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 32px 20px calc(24px + env(safe-area-inset-bottom));
  gap: 10px;
}
.welcome-logo { width: 168px; height: auto; margin-bottom: 4px; }
.welcome-shop { margin: 0; font-weight: 800; font-size: 18px; }
.welcome .masa-title { margin: 6px 0 18px; }
.welcome-lead { margin: 0 0 18px; max-width: 30ch; font-size: 18px; font-weight: 600; }
.welcome-fine { margin: 8px 0 0; max-width: 34ch; font-size: 13px; opacity: 0.85; }

/* 2. Menü */
.top {
  background: var(--bull);
  color: #fff;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: var(--stroke);
}
.top-logo { width: 52px; height: auto; }
.top-text { display: flex; flex-direction: column; line-height: 1.1; }
.top-shop { font-weight: 700; font-size: 14px; opacity: 0.9; }
.top-masa {
  font: 400 30px/1 var(--display);
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill;
}

.geo-strip {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: #fff3c4;
  border: var(--stroke);
  border-radius: 14px;
}
.geo-strip p { margin: 0; flex: 1; font-size: 14px; font-weight: 600; }

.cats {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px;
  background: var(--flour);
  border-bottom: 1.5px solid rgba(29, 22, 22, 0.12);
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 7px 14px;
  font-weight: 700; font-size: 14px;
  white-space: nowrap;
}
.cat[aria-current='true'] { background: var(--ink); color: #fff; }

.menu { padding: 8px 16px 120px; }
.loading, .empty { color: var(--muted); padding: 32px 0; text-align: center; }
.cat-section { scroll-margin-top: 64px; }
.cat-heading { font: 400 28px/1.1 var(--display); margin: 26px 0 14px; color: var(--bull); }

/* Görselli ürün: pizza tabakta, tabak kırmızı halkanın üstünde (logodaki çember) */
.card {
  background: var(--plate);
  border: var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 50% 54%, #fff 0 46%, var(--bull) 46.5% 55%, #fff 55.5%);
}
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 4px 16px 16px; }
.item-name { font: 400 22px/1.15 var(--display); margin: 0 0 4px; overflow-wrap: anywhere; }
.item-desc {
  margin: 0 0 12px; color: var(--muted); font-size: 14px; max-width: 60ch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.item-desc.open { -webkit-line-clamp: unset; line-clamp: none; }

.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; }
.size {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding: 7px 4px;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.15;
}
.size b { font-size: 14px; }
.size span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.size[aria-pressed='true'] { background: var(--bull); color: #fff; }
.size[aria-pressed='true'] span { color: #fff; }

/* Görselsiz/küçük ürün: sade satır */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1.5px dashed rgba(29, 22, 22, 0.25);
}
.row-thumb { width: 56px; height: 56px; flex: none; object-fit: contain; background: #fff; border-radius: 12px; border: 2px solid var(--ink); }
.row-main { flex: 1; min-width: 0; }
.row .item-name { font-size: 18px; margin: 0; }
.row .item-desc { margin: 2px 0 0; font-size: 13px; }
.row-price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.add-round {
  flex: none; width: 40px; height: 40px;
  border: var(--stroke); border-radius: 50%;
  background: var(--bull); color: #fff;
  font-size: 24px; font-weight: 800; line-height: 1;
  box-shadow: 2px 2px 0 var(--ink);
}

.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--flour) 70%, rgba(251, 243, 234, 0));
}
.cart-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  background: var(--bull); color: #fff;
  border: var(--stroke); border-radius: 999px; box-shadow: var(--pop);
  padding: 10px 20px 10px 10px;
  font-weight: 800; font-size: 17px;
}
.cart-count {
  min-width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--ink); border: 2px solid var(--ink);
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.cart-count.bump { animation: bump 0.3s ease-out; }
.cart-label { flex: 1; text-align: left; }
.cart-total { font-variant-numeric: tabular-nums; }
@keyframes bump { 50% { transform: scale(1.3) rotate(-8deg); } }

/* 3. Adisyon kâğıdı (sepet ve durum) */
.ticket {
  background: #fff;
  border: var(--stroke);
  border-radius: 6px 6px var(--radius) var(--radius);
  padding: 22px 18px 20px;
  position: relative;
  -webkit-mask: radial-gradient(circle 7px at 50% 0, #0000 98%, #000) 0 0 / 22px 100%;
          mask: radial-gradient(circle 7px at 50% 0, #0000 98%, #000) 0 0 / 22px 100%;
}
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket h2 { font: 400 26px/1.1 var(--display); margin: 0; }
.close { border: 0; background: none; font-size: 32px; line-height: 1; padding: 4px 8px; }

.sheet {
  border: 0; padding: 0; margin: auto auto 0;
  width: 100%; max-width: 520px;
  background: transparent;
  max-height: 92svh;
}
.sheet::backdrop { background: rgba(29, 22, 22, 0.55); }
.sheet[open] { animation: sheet-in 0.22s ease-out; }
.sheet .ticket { border-radius: 6px 6px 0 0; border-bottom: 0; max-height: 92svh; overflow-y: auto; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

.lines { list-style: none; margin: 16px 0; padding: 0; border-top: 2px dashed var(--ink); }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1.5px dashed rgba(29, 22, 22, 0.3); }
.line-name { font-weight: 700; }
.line-size { color: var(--muted); font-size: 14px; font-weight: 500; }
.line-price { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.stepper { justify-self: start; display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.stepper button { width: 36px; height: 32px; border: 0; background: #fff; font-size: 20px; font-weight: 800; }
.stepper output { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.lines-readonly .line { grid-template-columns: auto 1fr; }
.lines-readonly .line-qty { font-weight: 800; }

.note-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
textarea {
  width: 100%; resize: none;
  border: 2px solid var(--ink); border-radius: 12px;
  padding: 10px 12px; font: 500 16px/1.4 var(--body); background: var(--flour);
}
.ticket-total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 2px; font-size: 18px; font-weight: 700; }
.ticket-total strong { font: 400 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.pay-note { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #ffe2df; border: 2px solid var(--bull); font-weight: 600; font-size: 14px; }

/* 4. Durum */
.status {
  min-height: 100svh;
  background: var(--bull);
  padding: 28px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
  justify-content: center;
}
.ticket-status { box-shadow: 5px 5px 0 var(--ink); border-radius: 6px 6px var(--radius) var(--radius); text-align: center; }
.status-masa { margin: 0 0 6px; font-weight: 800; color: var(--muted); }
.status-title { margin: 6px 0 6px; }
.status-text { margin: 0 auto 14px; max-width: 32ch; color: var(--muted); }

/* Mutfak damgası: siparişin durumunu tek bakışta gösterir */
.stamp {
  width: 104px; height: 104px; margin: 4px auto 6px;
  border-radius: 50%;
  border: 4px solid currentColor;
  display: grid; place-items: center;
  font: 400 13px/1 var(--display);
  transform: rotate(-12deg);
}
.stamp::after { content: attr(data-label); }
.stamp[data-state='bekliyor'] { color: var(--muted); border-style: dashed; animation: spin 6s linear infinite; }
.stamp[data-state='yazildi'] { color: var(--ok); animation: stamp-in 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.stamp[data-state='hata'] { color: var(--bull); animation: stamp-in 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes spin { to { transform: rotate(348deg); } }
@keyframes stamp-in { from { transform: scale(1.8) rotate(-12deg); opacity: 0; } }

.steps { list-style: none; display: flex; justify-content: center; gap: 8px; padding: 0; margin: 0 0 4px; }
.steps li {
  padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  border: 2px solid rgba(29, 22, 22, 0.25); color: var(--muted);
}
.steps li.done { border-color: var(--ink); background: var(--ink); color: #fff; }
.steps[hidden] { display: none; }
.lines-readonly { text-align: left; }

@media (min-width: 640px) {
  .app, .status { max-width: 560px; margin: 0 auto; }
  .cart-bar { max-width: 560px; margin: 0 auto; }
  .sheet { margin: auto; }
  .sheet .ticket { border-radius: 6px 6px var(--radius) var(--radius); border-bottom: var(--stroke); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Malzeme çıkarma: mutfağa yapılandırılmış olarak gider */
.remove { margin: 0 0 12px; border: 2px dashed var(--ink); border-radius: 12px; padding: 0 12px; }
.remove summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style: none; }
.remove summary::-webkit-details-marker { display: none; }
.remove summary::after { content: '+'; float: right; font-weight: 800; }
.remove[open] summary::after { content: '−'; }
.remove-list { display: grid; gap: 2px; padding-bottom: 8px; }
.chk { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 600; }
.chk input { width: 22px; height: 22px; accent-color: var(--bull); flex: none; }
.line-without { display: block; color: var(--bull); font-size: 14px; font-weight: 700; }

/* 3D / masada gör */
#ar-viewer { width: 100%; height: 300px; margin: 14px 0 6px; background: radial-gradient(circle at 50% 55%, #fff 0 42%, var(--flour) 70%); border-radius: 14px; border: 2px solid var(--ink); --poster-color: transparent; }
#ar-launch { margin: 8px 0 10px; }
.ar-loading { position: absolute; inset: 0; pointer-events: none; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; padding: 0 20px; }
.ar-spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(29, 22, 22, 0.15); border-top-color: var(--red, #d90b14); animation: ar-spin 0.8s linear infinite; }
.ar-loading.failed .ar-spin { display: none; }
@keyframes ar-spin { to { transform: rotate(360deg); } }
.ar-hint { margin: 4px 0 8px; color: var(--muted); font-size: 14px; }
.btn-ghost { background: #fff; color: var(--ink); margin-bottom: 10px; }

.doughs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }

/* Arama + kategori + tercih: tek yapışkan çubuk */
.filters { position: sticky; top: 0; z-index: 6; background: var(--flour); border-bottom: 1.5px solid rgba(29, 22, 22, 0.12); padding-top: 10px; }
.cats { position: static; top: auto; border-bottom: 0; padding: 10px 16px 6px; background: transparent; }
.search { padding: 0 16px; }
.search input { width: 100%; border: var(--stroke); border-radius: 999px; padding: 11px 18px; font: 600 16px/1.2 var(--body); background: #fff; color: var(--ink); }
.search input::placeholder { color: var(--muted); font-weight: 500; }
.filters.searching .cats, .filters.searching .tags { display: none; }
.tags { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 10px; }
.tags::-webkit-scrollbar { display: none; }
.tag { flex: none; border: 2px solid var(--ink); border-radius: 999px; background: transparent; padding: 4px 12px; font-weight: 700; font-size: 13px; }
.tag[aria-pressed='true'] { background: var(--bull); border-color: var(--bull); color: #fff; }
.result-count { margin: 14px 0 10px; color: var(--muted); font-weight: 700; }
.cat-section { scroll-margin-top: 150px; }

.pills { display: flex; gap: 6px; margin: 0 0 8px; }
.pill { font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: #fff3c4; border: 1.5px solid var(--ink); }

.remove-title { margin: 6px 0 2px; font-weight: 800; font-size: 14px; }
.chk em { margin-left: auto; font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-add { display: block; color: var(--ok); font-size: 14px; font-weight: 700; }
.line-slot { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.line-slot b { color: var(--ink); }
.btn-link { justify-self: start; background: none; border: 0; padding: 4px 0; font-weight: 800; color: var(--bull); text-decoration: underline; text-underline-offset: 3px; }

/* Kampanya: pizza seçimi */
.combo-sub { margin: 8px 0 4px; color: var(--muted); font-size: 14px; }
.slot { border-top: 2px dashed var(--ink); padding: 14px 0 6px; }
.slot-title { margin: 0 0 8px; font: 400 20px/1.15 var(--display); }
.pick-list { margin-bottom: 10px; }
.pick-list summary { cursor: pointer; font-weight: 800; padding: 6px 0; }
.picks { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px 2px 4px 0; }
.pick { display: flex; align-items: center; gap: 10px; border: 2px solid var(--ink); border-radius: 12px; padding: 6px 10px; background: #fff; min-height: 56px; }
.pick:has(input:checked) { background: #ffe2df; border-color: var(--bull); }
.pick input { accent-color: var(--bull); width: 20px; height: 20px; flex: none; }
.pick img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.pick-name { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pick em { font-style: normal; font-weight: 800; font-size: 14px; white-space: nowrap; }

/* Müdavim hediyesi ve öneriler */
.gift { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; background: #fff3c4; border: var(--stroke); border-radius: 14px; }
.gift-text { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; }
.gift-text b { font-size: 16px; }
.line-gift .line-price { color: var(--ok); }
.suggest { margin: 0 0 14px; }
.suggest-title { margin: 0 0 8px; font-weight: 800; }
.suggest-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.suggest-list::-webkit-scrollbar { display: none; }
.suggest-item { flex: none; width: 132px; display: grid; justify-items: center; gap: 2px; border: 2px solid var(--ink); border-radius: 14px; background: #fff; padding: 8px 6px; text-align: center; position: relative; }
.suggest-item img { width: 56px; height: 56px; object-fit: contain; }
.suggest-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.suggest-price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.suggest-plus { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--bull); color: #fff; font-weight: 800; line-height: 24px; }
