/* ==========================================================================
   Dokun — temel tasarım sistemi
   Renkler İznik çinisinden: kobalt, mercan kırmızısı, turkuaz, çini beyazı.
   İmza öğe: "adisyon" (sipariş fişi) — delikli üst kenar, çizgili kâğıt,
   tükenmez kalemle yazılmış masa numarası.
   ========================================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-ext-standard-normal.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque-latin-ext-standard-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/caveat-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat";
  src: url("../fonts/caveat-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/caveat-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Renk */
  --tile: #F3F5F9;          /* çini beyazı — sayfa zemini */
  --paper: #FFFFFF;
  --ink: #142038;           /* mürekkep — ana metin */
  --ink-2: #48536B;         /* ikincil metin */
  --ink-3: #66718A;         /* soluk metin */
  --line: #DFE4ED;
  --line-2: #C8D0DC;
  --cobalt: #2340B8;        /* İznik kobaltı — marka rengi */
  --cobalt-ink: #1A3196;
  --cobalt-wash: #E8ECFA;
  --turq: #0A7F76;          /* tamamlandı, onaylandı */
  --turq-wash: #E1F3F1;
  --bole: #C02F1F;          /* İznik mercan kırmızısı — indirim, iptal */
  --bole-wash: #FBE9E6;
  --amber: #A35F00;
  --amber-wash: #FFF2DC;
  --adisyon: #FFFDF6;       /* fiş kâğıdı */
  --adisyon-rule: #E2E9F5;  /* fişin mavi çizgileri */
  --pen: #2340B8;           /* tükenmez kalem */

  /* Mekân rengi (müşteri sayfasında mekânın kendi rengiyle değişir) */
  --accent: var(--cobalt);
  --accent-ink: var(--cobalt-ink);
  --on-accent: #FFFFFF;

  /* Tipografi */
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Bricolage", cursive;
  --fs-xs: 0.8125rem;
  --fs-s: 0.875rem;
  --fs-m: 1rem;
  --fs-l: 1.25rem;
  --fs-xl: 1.5625rem;
  --fs-2xl: 1.953rem;
  --fs-3xl: 2.441rem;
  --fs-4xl: 3.052rem;

  /* Biçim */
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(20, 32, 56, 0.06), 0 6px 18px rgba(20, 32, 56, 0.06);
  --shadow-2: 0 2px 6px rgba(20, 32, 56, 0.08), 0 18px 48px rgba(20, 32, 56, 0.12);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.5;
  color: var(--ink);
  background: var(--tile);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
s { text-decoration-thickness: 1.5px; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.num { font-variant-numeric: tabular-nums; }
.hand { font-family: var(--font-hand); color: var(--pen); font-weight: 600; letter-spacing: 0.01em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-s); }
.xsmall { font-size: var(--fs-xs); }

/* --------------------------------------------------------------------------
   Butonlar
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-m);
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  font-size: var(--fs-m);
  line-height: 1.15;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-outline { border-color: var(--line-2); background: var(--paper); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn-danger { background: var(--bole); color: #fff; }
.btn-danger:hover { background: #9E2618; }
.btn-success { background: var(--turq); color: #fff; }
.btn-success:hover { background: #066A62; }
.btn-sm { min-height: 36px; padding: 0 0.8rem; font-size: var(--fs-s); border-radius: 10px; }
.btn-lg { min-height: 56px; font-size: 1.0625rem; padding: 0 1.4rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; min-height: 36px; }

/* --------------------------------------------------------------------------
   Form alanları
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 0.4rem; align-content: start; }
.field > span, .field-label { font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.field small, .field-hint { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.4; }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--bole); }
.input-group { display: flex; align-items: stretch; }
.input-group > .addon {
  display: inline-flex; align-items: center; padding: 0 0.8rem;
  border: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-m) 0 0 var(--r-m);
  background: var(--tile); color: var(--ink-3); font-size: var(--fs-s); white-space: nowrap;
}
.input-group > .addon + .input { border-radius: 0 var(--r-m) var(--r-m) 0; }
.input-group > .input + .addon { border-left: 0; border-right: 1px solid var(--line-2); border-radius: 0 var(--r-m) var(--r-m) 0; }
.input-group > .input:has(+ .addon) { border-radius: var(--r-m) 0 0 var(--r-m); }

/* Anahtar (switch) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; width: 46px; height: 28px; flex: none;
  border-radius: 999px; background: var(--line-2); transition: background-color 0.18s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 32, 56, 0.25);
  transition: transform 0.18s var(--ease);
}
.switch input:checked + .track { background: var(--turq); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Adisyon (sipariş fişi) — markanın imza öğesi
   -------------------------------------------------------------------------- */
.adisyon-wrap { filter: drop-shadow(0 1px 1px rgba(20, 32, 56, 0.08)) drop-shadow(0 10px 22px rgba(20, 32, 56, 0.10)); }
.adisyon {
  --hole: 6px;
  --gap: 20px;
  position: relative;
  padding: 1.6rem 1.15rem 1.15rem;
  background-color: var(--adisyon);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    var(--adisyon-rule) 31px,
    var(--adisyon-rule) 32px
  );
  background-position: 0 12px;
  border-radius: 0 0 6px 6px;
  -webkit-mask: radial-gradient(circle at calc(var(--gap) / 2) 0, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) top left / var(--gap) 100% repeat-x;
          mask: radial-gradient(circle at calc(var(--gap) / 2) 0, transparent var(--hole), #000 calc(var(--hole) + 0.5px)) top left / var(--gap) 100% repeat-x;
}
.adisyon-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  font-size: var(--fs-xs); color: var(--ink-3);
}
.adisyon-head strong { color: var(--ink-2); font-weight: 650; }
.adisyon-table { font-size: 2.6rem; line-height: 1; margin: 0.35rem 0 0.6rem; transform: rotate(-2deg); transform-origin: left center; }
.adisyon-cols {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.6rem;
  padding-bottom: 0.35rem; border-bottom: 1px solid var(--adisyon-rule);
  font-size: var(--fs-xs); color: var(--ink-3);
}
.adisyon-line {
  display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.6rem; align-items: center;
  padding: 0.55rem 0; border-bottom: 1px dashed var(--adisyon-rule);
}
.adisyon-line .qty { font-family: var(--font-hand); color: var(--pen); font-size: 1.6rem; line-height: 1; font-weight: 600; }
.adisyon-line .name { font-weight: 600; line-height: 1.3; }
.adisyon-line .name small { display: block; font-weight: 450; color: var(--ink-3); font-size: var(--fs-xs); }
.adisyon-line .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.adisyon-sum { display: grid; gap: 0.3rem; padding-top: 0.8rem; font-variant-numeric: tabular-nums; }
.adisyon-sum > div { display: flex; justify-content: space-between; gap: 1rem; }
.adisyon-sum .discount { color: var(--bole); font-weight: 600; }
.adisyon-sum .total { font-size: var(--fs-l); font-weight: 750; padding-top: 0.35rem; border-top: 2px solid var(--ink); margin-top: 0.25rem; }
.adisyon-note { margin-top: 0.7rem; font-family: var(--font-hand); color: var(--pen); font-size: 1.35rem; line-height: 1.15; }

.stamp {
  display: inline-block;
  padding: 0.2rem 0.7rem 0.25rem;
  border: 2.5px solid currentColor;
  border-radius: 8px;
  font-weight: 800;
  font-stretch: 78%;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  transform: rotate(-7deg);
  opacity: 0.9;
  background: color-mix(in srgb, currentColor 6%, transparent);
}
.stamp.is-new { color: var(--amber); }
.stamp.is-accepted { color: var(--cobalt); }
.stamp.is-ready { color: var(--turq); }
.stamp.is-done { color: var(--ink-2); }
.stamp.is-cancelled { color: var(--bole); }

/* --------------------------------------------------------------------------
   Sayfa altı katmanlar: alt sayfa (sheet), modal, toast
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 32, 56, 0.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in 0.18s var(--ease);
}
.sheet {
  width: min(560px, 100%);
  max-height: 92dvh;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--tile);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom));
  animation: sheet-up 0.26s var(--ease);
}
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0.1rem auto 0.8rem; }
@media (min-width: 720px) {
  .backdrop.is-center { align-items: center; }
  .backdrop.is-center .sheet { border-radius: var(--r-xl); }
}
.modal {
  width: min(520px, calc(100% - 2rem));
  max-height: 90dvh;
  overflow: auto;
  margin: auto;
  background: var(--paper);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-2);
  padding: 1.4rem;
  animation: pop-in 0.2s var(--ease);
}
.modal h2 { font-size: var(--fs-xl); font-weight: 720; line-height: 1.2; margin-bottom: 0.4rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; margin-top: 1.2rem; }

.toast-host {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 100;
  transform: translateX(-50%); display: grid; gap: 0.5rem; width: min(440px, calc(100% - 2rem));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem; border-radius: var(--r-m);
  background: var(--ink); color: #fff; box-shadow: var(--shadow-2);
  font-size: var(--fs-s); font-weight: 550;
  animation: toast-in 0.24s var(--ease);
}
.toast.is-success { background: var(--turq); }
.toast.is-error { background: var(--bole); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes pop-in { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Demo şeridi */
.demo-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.45rem 1rem; background: var(--amber-wash); color: var(--amber);
  font-size: var(--fs-xs); font-weight: 600; text-align: center;
}
.demo-ribbon button { border: 0; background: none; color: inherit; text-decoration: underline; font-weight: 700; padding: 0; }

/* Yükleniyor */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { min-height: 70dvh; display: grid; place-items: center; color: var(--ink-3); }

/* Logo */
.brand { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; color: var(--ink); font-weight: 760; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-word { font-size: 1.3rem; font-stretch: 92%; }
