/* Misal Cafe — müşteri ekranı. Koyu kahve · krem · beyaz · siyah. */
:root {
  --brown-950: #150b06;
  --brown-900: #1f130c;
  --brown-800: #2b1a10;
  --brown-700: #432818;
  --brown-600: #5c3a26;
  --brown-400: #8a6a52;
  --cream: #f6efe3;
  --cream-2: #ece1cf;
  --cream-3: #ddd0b9;
  --white: #ffffff;
  --black: #0c0806;
  --danger: #9c2f21;
  --danger-bg: #fbe9e5;
  --ok: #2d6a3e;
  --radius: 20px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--brown-900);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brown-600); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; }

/* ---------- açılış ---------- */
.hero {
  background: radial-gradient(120% 100% at 15% 0%, #4d3020 0%, var(--brown-800) 55%, var(--brown-950) 100%);
  color: var(--cream);
  padding: calc(26px + env(safe-area-inset-top)) 22px 38px;
  border-radius: 0 0 34px 34px;
}
.hero-inner { padding: 0 2px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 46px; }
.hero-logo { width: 46px; height: 46px; opacity: .95; }
.hero-logo.custom { width: 58px; height: 58px; opacity: 1; object-fit: contain; background: var(--cream); border-radius: 16px; padding: 5px; }
.pill {
  border: 1px solid rgba(246, 239, 227, .35);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  background: rgba(246, 239, 227, .08);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 13vw, 68px);
  line-height: 1.02;
  letter-spacing: .3px;
  margin: 26px 0 0;
}
.welcome { margin: 12px 0 0; font-size: 20px; line-height: 1.35; color: #e8dcc6; max-width: 24ch; }
.last-order {
  margin-top: 22px;
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(246, 239, 227, .3);
  background: rgba(246, 239, 227, .1);
  color: var(--cream);
  text-align: left;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}
.last-order small { font-weight: 400; opacity: .8; display: block; }
.last-order .dot { width: 10px; height: 10px; border-radius: 50%; background: #e7c27d; flex: none; }
.last-order.ready .dot { background: #8fd49b; }

.notice-wrap { padding: 0 16px; }
.notice {
  margin-top: 16px;
  background: var(--white);
  border: 1px solid var(--cream-3);
  border-left: 5px solid var(--brown-700);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
}
.notice.warn { border-left-color: var(--danger); background: var(--danger-bg); }

.offline-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--danger); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  text-align: center; font-weight: 600; font-size: 15px;
}

/* ---------- kategoriler ---------- */
.cats {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 239, 227, .94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  margin-top: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(43, 26, 16, .08);
}
.offline-bar:not([hidden]) ~ .cats { top: 40px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; scrollbar-width: none; scroll-behavior: smooth; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1.5px solid var(--cream-3);
  background: var(--white); font-weight: 600; font-size: 15px; white-space: nowrap;
}
.chip.on { background: var(--brown-800); color: var(--cream); border-color: var(--brown-800); }

/* ---------- menü ---------- */
.menu { padding: 0 0 150px; }
.boot { padding: 60px 20px; text-align: center; color: var(--brown-400); }
.sec { scroll-margin-top: 76px; }
.sec h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 26px 16px 12px; letter-spacing: .2px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 0 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  display: flex; flex-direction: column; text-align: left;
  background: var(--white); border: 0; padding: 0; overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(43, 26, 16, .08), 0 8px 22px -12px rgba(43, 26, 16, .35);
  transition: transform .12s ease;
}
.card:active:not(:disabled) { transform: scale(.985); }
.card:disabled { cursor: default; }
.card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--brown-800); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card:disabled .card-img img { filter: grayscale(1) brightness(.7); }
.badge {
  position: absolute; left: 10px; top: 10px;
  background: var(--black); color: var(--cream);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.card-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.card-desc {
  font-size: 13px; color: var(--brown-400); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 800; font-size: 17px; }
.plus {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brown-800); color: var(--cream);
  display: grid; place-items: center; font-size: 24px; line-height: 1; padding-bottom: 2px;
}
.card:disabled .plus { background: var(--cream-3); color: var(--brown-400); }

.error-box { margin: 40px 16px; padding: 24px; background: var(--white); border-radius: var(--radius); text-align: center; }
.error-box p { margin: 0 0 16px; }

/* ---------- butonlar ---------- */
.btn {
  min-height: 58px; border-radius: 16px; border: 0;
  padding: 0 22px; font-size: 18px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary { background: var(--brown-800); color: var(--cream); }
.btn-primary:active { background: var(--brown-950); }
.btn-ghost { background: transparent; color: var(--brown-700); border: 2px solid var(--cream-3); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(246, 239, 227, .35); border-top-color: var(--cream);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sepet çubuğu ---------- */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 55%, rgba(246, 239, 227, 0));
  pointer-events: none;
}
.cart-bar button {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 560px; margin: 0 auto; min-height: 62px;
  border: 0; border-radius: 18px; padding: 0 20px;
  background: var(--brown-800); color: var(--cream);
  font-size: 18px; font-weight: 700;
  box-shadow: 0 12px 30px -10px rgba(21, 11, 6, .7);
}
.cart-count {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px;
  background: var(--cream); color: var(--brown-800);
  display: inline-grid; place-items: center; font-size: 16px; margin-right: 12px;
}

/* ---------- alt panel (sheet) ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 60; display: none; }
.sheet-root.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(12, 8, 6, .58); animation: fade .2s ease-out; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  max-height: 94vh; max-height: 94dvh;
  background: var(--cream); border-radius: 28px 28px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1; }
.sheet-foot {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--cream); border-top: 1px solid var(--cream-3);
}
.sheet-img { position: relative; aspect-ratio: 16 / 10; background: var(--brown-800); }
.sheet-img img { width: 100%; height: 100%; object-fit: cover; }
.x {
  position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255, 255, 255, .94); border: 0; font-size: 24px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 6px; }
.sheet-head h2 { font-family: var(--serif); font-size: 28px; margin: 0; }
.sheet-head .x { position: static; box-shadow: none; background: var(--white); border: 1px solid var(--cream-3); }
.sheet-body { padding: 18px 20px 24px; }
.p-title { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0; line-height: 1.12; }
.p-desc { color: var(--brown-400); margin: 6px 0 0; }
.p-price { font-weight: 800; font-size: 20px; margin-top: 10px; }
.tag { display: inline-block; margin-top: 10px; padding: 5px 12px; border-radius: 999px; background: var(--cream-2); font-size: 14px; font-weight: 600; }

.group { margin-top: 24px; }
.group h3 { font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--brown-400); margin: 0 0 10px; font-weight: 700; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button, .opt, .row-opt {
  border: 2px solid var(--cream-3); background: var(--white); color: var(--brown-900);
  border-radius: 16px; font-weight: 700;
}
.seg button { min-height: 60px; font-size: 18px; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { min-height: 50px; padding: 0 18px; font-size: 16px; }
.opt small { font-weight: 600; opacity: .7; margin-left: 4px; }
.row-opt {
  width: 100%; min-height: 58px; padding: 0 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px; text-align: left; font-size: 16px;
}
.row-opt .name { flex: 1; }
.row-opt .extra-price { font-weight: 600; opacity: .75; }
.box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--cream-3); background: var(--white); position: relative; flex: none; }
.on { background: var(--brown-800) !important; color: var(--cream) !important; border-color: var(--brown-800) !important; }
.on .box { background: var(--cream); border-color: var(--cream); }
.on .box::after {
  content: ""; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px;
  border: solid var(--brown-800); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
textarea.note {
  width: 100%; min-height: 76px; resize: none; padding: 14px 16px;
  border-radius: 16px; border: 2px solid var(--cream-3); background: var(--white);
  font: inherit; font-size: 16px; color: var(--brown-900);
}
textarea.note:focus { outline: none; border-color: var(--brown-600); }
.name-field { margin: 16px 0 4px; }
.name-field label { display: block; font-family: var(--serif); font-weight: 600; font-size: 17px; margin-bottom: 8px; color: var(--brown-900); }
.name-field label i { color: var(--danger); font-style: normal; }
.name-field input {
  width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--cream-3);
  background: var(--white); font: inherit; font-size: 17px; color: var(--brown-900);
}
.name-field input:focus { outline: none; border-color: var(--brown-600); }
.name-field.bad input { border-color: var(--danger); }
.name-field .name-err { display: none; color: var(--danger); font-size: 14px; font-weight: 700; margin-top: 6px; }
.name-field.bad .name-err { display: block; }
.foot-row { display: flex; gap: 12px; align-items: stretch; }
.qty { display: flex; align-items: center; background: var(--white); border: 2px solid var(--cream-3); border-radius: 16px; flex: none; }
.qty button { width: 54px; height: 54px; border: 0; background: transparent; font-size: 28px; font-weight: 600; border-radius: 14px; }
.qty button:disabled { opacity: .3; }
.qty output { min-width: 32px; text-align: center; font-weight: 800; font-size: 20px; }
.foot-row .btn { flex: 1; font-size: 17px; }

/* ---------- sepet ---------- */
.ci { display: grid; grid-template-columns: 68px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--cream-3); }
.ci:last-child { border-bottom: 0; }
.ci img { width: 68px; height: 68px; border-radius: 16px; object-fit: cover; background: var(--brown-800); }
.ci-top { display: flex; justify-content: space-between; gap: 10px; }
.ci-name { font-weight: 800; font-size: 17px; }
.ci-line { font-weight: 800; white-space: nowrap; }
.ci-opts { font-size: 14px; color: var(--brown-600); margin-top: 3px; line-height: 1.45; }
.ci-note { font-size: 14px; font-style: italic; color: var(--brown-400); margin-top: 3px; }
.ci-ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ci-ctl .qty button { width: 46px; height: 46px; }
.link-btn { background: none; border: 0; color: var(--danger); font-weight: 700; padding: 12px 6px; font-size: 15px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 4px; font-size: 20px; font-weight: 800; }
.total-row span:first-child { font-family: var(--serif); font-weight: 600; }
.table-line { color: var(--brown-600); font-size: 15px; margin: 0 0 4px; }
.send-error {
  background: var(--danger-bg); color: var(--danger); border: 1.5px solid #e4b5ac;
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; font-weight: 600; font-size: 15px;
}
.send-error strong { display: block; margin-bottom: 2px; font-size: 16px; }
.empty { padding: 40px 10px; text-align: center; color: var(--brown-400); }

/* ---------- sipariş gönderildi ---------- */
.done-wrap { padding: 34px 24px 20px; text-align: center; }
.check {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px;
  background: var(--brown-800); display: grid; place-items: center;
}
.check svg { width: 44px; height: 44px; stroke: var(--cream); fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.done-wrap h2 { font-family: var(--serif); font-size: 30px; margin: 0; line-height: 1.15; }
.order-meta { margin: 10px 0 0; color: var(--brown-600); font-size: 17px; }
.order-meta b { color: var(--brown-900); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 28px 0 14px; }
.step { text-align: center; font-size: 13px; font-weight: 700; color: var(--brown-400); }
.step i { display: block; height: 8px; border-radius: 4px; background: var(--cream-3); margin-bottom: 8px; }
.step.on { color: var(--brown-900); }
.step.on i { background: var(--brown-800); }
.status-text { font-size: 18px; font-weight: 700; min-height: 28px; }
.status-text.ready { color: var(--ok); }
.ready-banner { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--brown-800); color: var(--cream); font-weight: 700; font-size: 18px; }

/* ---------- bildirim ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--black); color: var(--cream);
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* Sipariş hazır tam ekran uyarısı */
.ready-alert {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(12, 8, 6, .82); animation: fade .2s ease-out;
}
.ra-box {
  width: min(420px, 100%); background: var(--cream); color: var(--brown-900); border-radius: 28px;
  padding: 32px 24px 24px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.ra-icon { font-size: 64px; line-height: 1; animation: ra-pulse 1s ease-in-out infinite; }
.ra-box h2 { font-family: var(--serif); font-size: 30px; margin: 12px 0 8px; }
.ra-box p { font-size: 18px; margin: 0 0 22px; color: var(--brown-600); }
@keyframes ra-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .ra-icon { animation: none; } }
