/* City Kafe – kitap görünümlü menü. Renkler basılı menüden: koyu lacivert-siyah + altın. */
:root {
  --bg: #0d0e14;
  --bg-2: #191b27;
  --surface: #161720;
  --surface-2: #1e202c;
  --text: #f6f1e6;
  --muted: #a7a196;
  --line: #2a2c3a;
  --gold: #f5b301;
  --gold-text: #f7b500;
  --pill-bg: linear-gradient(180deg, #fff9e2 0%, #ffe9a6 100%);
  --pill-text: #17130a;
  --danger: #ef6f5c;
  --ok: #5ccf8a;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(ellipse 120% 70% at 50% 0%, var(--bg-2) 0%, var(--bg) 70%) fixed var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

/* =========================================================
   Menü (kitap)
   ========================================================= */
.viewer {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
}

.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: rgba(13, 14, 20, .85);
}
.bar-logo { width: 40px; height: 40px; border-radius: 50%; background: #000; object-fit: cover; flex: none; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none;
  border: 1px solid var(--line);
  background: none;
  padding: 6px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: .98rem;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--pill-bg); color: var(--pill-text); border-color: var(--gold); box-shadow: 0 0 14px rgba(255, 180, 30, .3); }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}
.book { position: relative; width: 100%; height: 100%; }
.page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2600px;
  visibility: hidden;
}
.page.show { visibility: visible; }

.sheet {
  position: relative;
  transform-origin: left center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px 10px 10px 4px;
  overflow: hidden;
  background: #0d0e14;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
  will-change: transform;
}
.sheet.fill { border-radius: 0; display: flex; align-items: center; justify-content: center; box-shadow: none; }
.sheet img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.art { position: relative; flex: none; width: 100%; height: 100%; }
/* Sığdır modu: fotoğrafın kenarları menünün lacivert-siyah zeminine yumuşakça karışır */
[data-fit="contain"] .sheet.fill { background: radial-gradient(ellipse 90% 60% at 50% 50%, #1b1d29 0%, #0e0f16 70%, #0b0c11 100%); }
[data-fit="contain"] .sheet.fill .art {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%),
                      linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%),
                      linear-gradient(to right, transparent 0, #000 3%, #000 97%, transparent 100%);
          mask-composite: intersect;
}
/* Telefonda fotoğraf yatayda tam sığıyorsa yanları soldurma */
@media (max-aspect-ratio: 3/4) {
  [data-fit="contain"] .sheet.fill .art {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  }
}

/* Cilt gölgesi: sayfanın sol kenarı */
.sheet::before {
  content: '';
  position: absolute; inset: 0 auto 0 0;
  width: 6%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
}
/* Dönerken kararan yüz */
.sheet .shade {
  position: absolute; inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .75));
}

/* Değişen fiyatın, orijinalin tam üstüne konan yaması */
.patch {
  position: absolute;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  border: calc(var(--sh) * .0022) solid #f2b01e;
  border-radius: calc(var(--sh) * .009);
  background: linear-gradient(180deg, #fffbea 0%, #ffe8a3 100%);
  color: #17130a;
  font-family: Arial, "Helvetica Neue", Helvetica, "Liberation Sans", sans-serif;
  font-weight: 700;
  font-size: calc(var(--sh) * var(--hf) * .62);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 0 calc(var(--sh) * .01) rgba(255, 190, 40, .55);
}
.patch.on { display: flex; }
.patch.ital { font-style: italic; }
/* İlk sayfalardaki fiyatlar italik tırnaklı yazıyla basılmış */
.patch.serif { font-family: var(--serif); font-style: italic; font-size: calc(var(--sh) * var(--hf) * .64); letter-spacing: -.01em; }
/* Tablo sayfaları: hücrenin zemin rengi, düz kalın yazı, sağa yaslı */
.patch.tbl {
  background: var(--cell, #f6c044);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  justify-content: flex-end;
  padding-right: calc(var(--sh) * .004);
  font-family: "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  color: #141414;
  letter-spacing: 0;
}

.hint {
  position: absolute;
  left: 50%; bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(245, 179, 1, .5);
  color: #fff;
  font-size: .9rem;
  pointer-events: none;
  transition: opacity .6s;
}
.hint.gone { opacity: 0; }

.nav-btn {
  position: absolute;
  top: 50%;
  z-index: 30;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(245, 179, 1, .7);
  background: rgba(13, 14, 20, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  transition: opacity .25s;
}
.nav-btn.prev { left: 8px; }
.nav-btn.next { right: 8px; }
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.counter {
  flex: none;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-left: 4px;
}

/* Sekme satırı kaydırılabilir; kenarlar yumuşakça solar ki devamı olduğu anlaşılsın */
.tabs {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  padding: 0 14px;
  scroll-padding: 0 14px;
}
.all-btn {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(245, 179, 1, .6);
  background: rgba(245, 179, 1, .08);
  color: var(--gold);
}
.all-btn svg { width: 18px; height: 18px; }
.all-btn[aria-expanded="true"] { background: var(--pill-bg); color: var(--pill-text); }

/* Dil seçici */
.lang { position: relative; flex: none; }
.lang-btn {
  height: 38px; min-width: 42px; padding: 0 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: none;
  color: var(--text);
  font-weight: 700; font-size: .82rem; letter-spacing: .04em;
}
.lang-btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 120;
  min-width: 170px;
  padding: 6px;
  background: #12131b;
  border: 1px solid rgba(245, 179, 1, .35);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6);
  display: grid; gap: 2px;
}
.lang-menu[hidden] { display: none; }
.lang-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px;
  border: 0; border-radius: 10px;
  background: none; color: var(--text);
  font-size: .95rem; text-align: left;
}
.lang-opt b { width: 26px; font-size: .75rem; color: var(--muted); letter-spacing: .04em; }
.lang-opt:hover { background: rgba(255, 255, 255, .05); }
.lang-opt.active { background: var(--pill-bg); color: var(--pill-text); }
.lang-opt.active b { color: var(--pill-text); }

/* Tüm bölümler paneli */
.sections {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 10, .6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: max(64px, calc(env(safe-area-inset-top) + 56px)) 12px 12px;
  animation: secIn .18s ease-out;
}
.sections[hidden] { display: none; }
@keyframes secIn { from { opacity: 0; } to { opacity: 1; } }
.sections-panel {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  background: #12131b;
  border: 1px solid rgba(245, 179, 1, .35);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}
.sections-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.15rem;
  color: var(--gold);
  margin: 2px 4px 12px;
}
.sections-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: none; color: var(--muted); font-size: .95rem;
}
.sections-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sec {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 10px;
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1rem;
  text-align: center;
}
.sec.active { background: var(--pill-bg); color: var(--pill-text); border-color: var(--gold); }

@media (max-width: 820px) {
  .bar { gap: 8px; padding: 8px 8px; padding-top: max(8px, env(safe-area-inset-top)); }
  .bar-logo { width: 34px; height: 34px; }
  .tab { padding: 5px 12px; font-size: .9rem; }
  /* Telefonda yan oklar sayfadaki yazıları az örtsün */
  .nav-btn { width: 30px; height: 30px; background: rgba(13, 14, 20, .4); opacity: .8; }
  .nav-btn.prev { left: 4px; }
  .nav-btn.next { right: 4px; }
  .nav-btn svg { width: 16px; height: 16px; }
  .counter {
    position: fixed; z-index: 30;
    right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
    padding: 3px 10px; border-radius: 999px;
    background: rgba(13, 14, 20, .7); border: 1px solid var(--line);
    font-size: .8rem;
  }
}

/* =========================================================
   Yönetim paneli
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .2s, opacity .2s;
}
.btn:hover { border-color: #4a4a58; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #17130a; font-weight: 600; }
.btn.primary:hover { opacity: .88; }
.btn.primary:disabled { opacity: .4; cursor: default; }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--danger); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus { border-color: var(--gold); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; text-align: center; }
.login-card .field, .login-card .error { text-align: left; }
.login-card img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; background: #000; }
.login-card h1 { font-family: var(--serif); font-style: italic; margin: 0 0 4px; font-size: 1.7rem; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: .92rem; }
.login-card .btn { width: 100%; padding: 11px; }
.error { color: var(--danger); font-size: .88rem; min-height: 1.3em; margin: -4px 0 10px; }
.hint-text { color: var(--muted); font-size: .8rem; margin-top: 16px; }

.topbar { position: sticky; top: 0; z-index: 10; background: rgba(13, 14, 20, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 1.2rem; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: #000; }
.brand small { font-family: var(--sans); font-style: normal; font-weight: 400; color: var(--muted); font-size: .8rem; }

.admin { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; }
.page-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 16px; }
.page-chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: .9rem; color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }
.chip.active { border-color: var(--gold); color: var(--text); box-shadow: inset 0 0 0 1px var(--gold); }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-left: 6px; vertical-align: middle; }

.editor { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .editor { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } }
.preview { display: flex; justify-content: center; }
.preview .sheet { box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.spot {
  position: absolute; z-index: 3;
  border: 2px dashed rgba(255, 211, 90, .95);
  border-radius: 8px;
  cursor: pointer;
}
.spot b {
  position: absolute; top: -9px; right: -9px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--gold); color: #000;
  font: 700 10px/1 var(--sans);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .6);
}
.spot.active { border-style: solid; box-shadow: 0 0 0 4px rgba(245, 179, 1, .35); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.card-body { padding: 16px; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.price-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 118px 34px; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.price-row:last-child { border-bottom: 0; }
.price-row.active { background: rgba(245, 179, 1, .06); }
.price-row .num { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #000; font: 700 11px/1 var(--sans); }
.price-row .label { min-width: 0; }
.price-row .label b { display: block; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.price-row .label small { color: var(--muted); }
.price-row .label small.changed { color: var(--gold-text); }
.price-row input { padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: none; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .25; pointer-events: none; }
.icon-btn svg { width: 17px; height: 17px; }
.empty { color: var(--muted); padding: 20px 16px; }

.settings { display: grid; gap: 20px; margin-top: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .settings { grid-template-columns: 1fr 1fr; } }
.settings p { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  transform: translate(-50%, 20px);
  background: var(--gold); color: #17130a;
  padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .topbar-inner { padding: 10px 14px; }
  .brand small { display: none; }
  .admin { padding: 14px; }
  .price-row { grid-template-columns: 24px minmax(0, 1fr) 96px 30px; gap: 8px; padding: 10px 12px; }
}
