:root {
  --bg: #fbf6ef;
  --kart: #ffffff;
  --yazi: #1f1a17;
  --soluk: #7a6f66;
  --cizgi: #ece3d8;
  --tostos: #d6331f;
  --tostos-acik: #fdebe7;
  --dukkan: #4b4fd1;
  --dukkan-acik: #ebebfc;
  --yesil: #1e8a4c;
  --yesil-acik: #e3f5ea;
  --sari: #b7791f;
  --sari-acik: #fdf3df;
  --golge: 0 1px 2px rgba(40, 25, 10, .06), 0 4px 14px rgba(40, 25, 10, .06);
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--yazi);
  font: 15px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.gizli { display: none !important; }
.soluk { color: var(--soluk); }
.kucuk { font-size: 13px; }
.sayi { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* düğmeler */
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600;
  background: var(--yazi); color: #fff; transition: transform .05s, opacity .15s;
}
a.btn { text-decoration: none; display: inline-block; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.kirmizi { background: var(--tostos); }
.btn.yesil { background: var(--yesil); }
.btn.mor { background: var(--dukkan); }
.btn.cizgili { background: transparent; color: var(--yazi); box-shadow: inset 0 0 0 1.5px var(--cizgi); }
.btn.buyuk { padding: 14px 20px; font-size: 16px; border-radius: 12px; }
.btn.tam { width: 100%; }
.btn.mini { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.kart { background: var(--kart); border-radius: var(--r); box-shadow: var(--golge); }
.rozet {
  display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--cizgi); color: var(--yazi); white-space: nowrap;
}
.rozet.tostos { background: var(--tostos-acik); color: var(--tostos); }
.rozet.dukkan { background: var(--dukkan-acik); color: var(--dukkan); }
.rozet.yesil { background: var(--yesil-acik); color: var(--yesil); }
.rozet.sari { background: var(--sari-acik); color: var(--sari); }

input[type=text], input[type=number], input[type=password], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--cizgi);
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--yazi); }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }

#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: var(--yazi); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: calc(100% - 32px); text-align: center;
}
#toast.acik { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.hata { background: var(--tostos); }

/* ---------- müşteri menüsü ---------- */
.m-ust { padding: 20px 16px 12px; max-width: 640px; margin: 0 auto; }
.m-ust h1 { font-size: 22px; }
.m-ust .masa { display: inline-block; margin-top: 6px; background: var(--yazi); color: #fff; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.m-ust .ust-sat { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sekmeler {
  position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 16px 10px;
  max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sekme {
  border: 0; border-radius: 12px; padding: 12px 8px; font-weight: 700; background: var(--kart);
  box-shadow: var(--golge); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.sekme small { font-weight: 500; font-size: 12px; color: var(--soluk); }
.sekme.aktif.tostos { background: var(--tostos); color: #fff; }
.sekme.aktif.dukkan { background: var(--dukkan); color: #fff; }
.sekme.aktif small { color: rgba(255,255,255,.85); }
.menu { max-width: 640px; margin: 0 auto; padding: 4px 16px 120px; }
.kat-baslik { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--soluk); margin: 18px 4px 8px; font-weight: 700; }
.urun-liste { overflow: hidden; }
.urun { display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-bottom: 1px solid var(--cizgi); }
.urun:last-child { border-bottom: 0; }
.urun .bilgi { flex: 1; min-width: 0; }
.urun .ad { font-weight: 600; }
.urun .aciklama { color: var(--soluk); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.urun .fiyat { color: var(--yazi); font-weight: 600; font-size: 14px; margin-top: 4px; }
.ekle { width: 38px; height: 38px; border-radius: 10px; border: 0; font-size: 22px; line-height: 1; font-weight: 600; background: var(--yazi); color: #fff; }
.tostos-mod .ekle { background: var(--tostos); }
.dukkan-mod .ekle { background: var(--dukkan); }
.adim { display: flex; align-items: center; gap: 8px; }
.adim button { width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--cizgi); font-size: 18px; font-weight: 700; }
.adim span { min-width: 18px; text-align: center; font-weight: 700; }
.bilgi-kutu { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.bilgi-kutu.tostos { background: var(--tostos-acik); color: #8f2414; }
.bilgi-kutu.dukkan { background: var(--dukkan-acik); color: #34379a; }

.alt-cubuk { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 10; }
.alt-cubuk .btn { max-width: 608px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }

.perde { position: fixed; inset: 0; background: rgba(20, 12, 5, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sayfa-alt { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sayfa-alt .tutamac { width: 40px; height: 4px; background: var(--cizgi); border-radius: 4px; margin: -6px auto 12px; }
.sepet-grup { padding: 12px 14px; margin-top: 12px; }
.sepet-grup h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sepet-satir { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--cizgi); }
.sepet-satir:first-of-type { border-top: 0; }
.toplam { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; margin: 16px 2px 4px; }

.durum-kart { padding: 16px; margin-top: 12px; }
.durum-kart h3 { font-size: 16px; }
.adimlar { list-style: none; padding: 0; margin: 12px 0 0; }
.adimlar li { display: flex; gap: 10px; align-items: center; padding: 5px 0; color: var(--soluk); }
.adimlar li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cizgi); flex: none; }
.adimlar li.tamam { color: var(--yazi); }
.adimlar li.tamam::before { background: var(--yesil); border-color: var(--yesil); }
.adimlar li.simdi { color: var(--yazi); font-weight: 700; }
.adimlar li.simdi::before { border-color: var(--sari); background: var(--sari-acik); animation: nabiz 1.2s infinite; }
@keyframes nabiz { 50% { box-shadow: 0 0 0 5px rgba(183, 121, 31, .2); } }
.ortada { text-align: center; padding: 60px 24px; max-width: 480px; margin: 0 auto; }

/* ---------- paneller ---------- */
.p-ust { background: var(--yazi); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.p-ust h1 { font-size: 18px; }
.p-ust .bosluk { flex: 1; }
.p-ust .btn.cizgili { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.p-sekmeler { display: flex; gap: 4px; flex-wrap: wrap; }
.p-sekme { background: transparent; border: 0; color: rgba(255,255,255,.7); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.p-sekme.aktif { background: rgba(255,255,255,.15); color: #fff; }
.p-sekme .say { background: var(--tostos); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.p-icerik { padding: 20px; max-width: 1280px; margin: 0 auto; }
.bolum-baslik { font-size: 15px; font-weight: 700; margin: 8px 0 12px; display: flex; align-items: center; gap: 8px; }
.izgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 28px; }
.s-kart { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.s-kart.bekliyor { box-shadow: 0 0 0 2.5px var(--sari), var(--golge); }
.s-kart.yeni { box-shadow: 0 0 0 2.5px var(--tostos), var(--golge); }
.s-kart .bas { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.s-kart .masa-no { font-size: 22px; font-weight: 800; }
.s-kart .kalemler { font-size: 14px; }
.s-kart .kalem { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.s-kart .grup-bas { font-size: 12px; font-weight: 700; margin-top: 6px; }
.s-kart .not { background: var(--sari-acik); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.s-kart .butonlar { display: flex; gap: 8px; flex-wrap: wrap; }
.s-kart .butonlar .btn { flex: 1; }
.bos { padding: 28px; text-align: center; color: var(--soluk); border: 2px dashed var(--cizgi); border-radius: var(--r); margin-bottom: 28px; }
.giris { max-width: 360px; margin: 10vh auto; padding: 24px; }
.giris h1 { font-size: 22px; margin-bottom: 4px; }
.ozet { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.ozet .kart { padding: 14px 16px; }
.ozet .deger { font-size: 26px; font-weight: 800; margin-top: 2px; }
table.tablo { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--golge); }
.tablo th, .tablo td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--cizgi); vertical-align: middle; }
.tablo th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--soluk); background: #fdfaf6; }
.tablo tr:last-child td { border-bottom: 0; }
.tablo input { padding: 6px 8px; }
.tablo-sar { overflow-x: auto; }
.form-satir { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; padding: 14px; margin-bottom: 16px; }
.form-satir label { margin-top: 0; }
.ses-uyari { background: var(--sari-acik); color: #7a4f0f; padding: 10px 20px; display: flex; align-items: center; gap: 12px; justify-content: center; font-weight: 600; flex-wrap: wrap; }

@media (max-width: 600px) {
  .p-icerik { padding: 14px 16px; }
  .p-ust { padding: 10px 16px; }
  .izgara { grid-template-columns: 1fr; }
}

/* ---------- QR baskı ---------- */
.qr-sayfa { padding: 20px; }
.qr-izgara { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.qr-kart { border: 2px solid var(--yazi); border-radius: 14px; padding: 14px; text-align: center; background: #fff; break-inside: avoid; }
.qr-kart .qr { display: flex; justify-content: center; margin: 10px 0; }
.qr-kart .qr img, .qr-kart .qr canvas { width: 150px; height: 150px; }
.qr-kart .buyuk-masa { font-size: 30px; font-weight: 800; }
@media print {
  .yazdirma-yok { display: none !important; }
  body { background: #fff; }
  .qr-sayfa { padding: 0; }
}
@media (max-width: 700px) { .qr-izgara { grid-template-columns: repeat(2, 1fr); } }

/* sipariş alarmı */
#alarm-baslat { position: fixed; inset: 0; z-index: 60; background: rgba(20, 14, 10, .82); display: flex; align-items: center; justify-content: center; padding: 16px; }
#alarm-baslat .kutu { background: var(--kart, #fff); border-radius: 18px; padding: 28px 22px; max-width: 380px; width: 100%; text-align: center; }
#alarm-baslat .ikon { font-size: 44px; } #alarm-baslat .baslik { font-size: 20px; font-weight: 800; margin: 6px 0; }
#alarm-baslat p { color: var(--soluk, #6b6259); margin: 0 0 18px; }
#alarm-serit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--tostos); color: #fff; font-weight: 800; font-size: 18px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: center; justify-content: space-between; cursor: pointer;
  animation: alarm-yanip 1s steps(2, jump-none) infinite; box-shadow: 0 -6px 24px rgba(214, 51, 31, .45); }
#alarm-serit .yazi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#alarm-serit .git { flex: none; font-size: 14px; background: rgba(255,255,255,.2); padding: 6px 10px; border-radius: 8px; }
@keyframes alarm-yanip { 0% { background: var(--tostos); } 100% { background: #8f1c0f; } }
body:has(#alarm-serit:not(.gizli)) .p-icerik { padding-bottom: 90px; }
body.alarm-var::after { content: ''; position: fixed; inset: 0; z-index: 49; pointer-events: none; border: 10px solid var(--tostos);
  animation: alarm-cerceve 1s steps(2, jump-none) infinite; }
@keyframes alarm-cerceve { 0% { border-color: var(--tostos); } 100% { border-color: transparent; } }
@media print { #alarm-serit, #alarm-baslat { display: none !important; } body.alarm-var::after { display: none; } }

.hy-kopya { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; margin-top: 4px; }
.hy-kopya .btn { flex: 0 0 auto; }

/* ---------- Tos Tos: tezgah / gel-al sipariş girişi ---------- */
.ys-duzen { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.ys-urunler { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.ys-urun { border: 0; background: var(--kart); box-shadow: var(--golge); border-radius: 12px; padding: 12px 10px; text-align: left; min-height: 66px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px; position: relative; }
.ys-urun:active { transform: scale(.97); }
.ys-urun .ad { font-weight: 700; font-size: 14px; line-height: 1.2; }
.ys-urun .fiyat { color: var(--soluk); font-size: 13px; font-weight: 600; }
.ys-urun.tukendi { opacity: .5; }
.ys-urun .adet { position: absolute; top: -6px; right: -6px; background: var(--tostos); color: #fff; border-radius: 99px; min-width: 24px; height: 24px;
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.ys-sepet { padding: 16px; position: sticky; top: 76px; }
.ys-sepet h2 { font-size: 17px; }
.ys-sepet .sepet-satir .ad { flex: 1; min-width: 0; }
.secim { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.secim button { border: 0; border-radius: 10px; padding: 11px 6px; font-weight: 700; background: var(--cizgi); }
.secim button.aktif { background: var(--yazi); color: #fff; }
.kuyruk { background: var(--sari-acik); color: #7a4f0f; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kuyruk.hata { background: var(--tostos-acik); color: #8f2414; }
.rozet.mavi { background: var(--dukkan-acik); color: var(--dukkan); }
.s-kart.cevrimdisi { box-shadow: 0 0 0 2.5px var(--sari), var(--golge); }
.rapor-ust { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.rapor-ust h2 { font-size: 18px; margin-right: auto; }
.rapor-ust input[type=date] { width: auto; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--cizgi); background: #fff; }
@media (max-width: 860px) { .ys-duzen { grid-template-columns: 1fr; } .ys-sepet { position: static; } }
.masa-izgara { grid-template-columns: repeat(3, 1fr); }
.masa-izgara button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; }
.masa-izgara small { font-size: 11px; font-weight: 600; color: var(--sari); }
.masa-izgara button.aktif small { color: #ffd88a; }
.hs-kart { border: 0; text-align: left; width: 100%; font: inherit; cursor: pointer; }
.hs-kart:active { transform: scale(.98); }
.hs-satir input { width: 20px; height: 20px; vertical-align: middle; margin: 0 8px 0 0; }
.ys-alt { display: none; }
@media (max-width: 860px) {
  .ys-alt { display: block; position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
  .ys-alt.gizli { display: none !important; }
  section[data-gorunum="yeni"] { padding-bottom: 80px; }
}
