/* Afilli Pasta & Cafe — müşteri menüsü
   Şube temaları <html data-branch="..."> ile seçilir. */

/* ---------- Tema değişkenleri ---------- */
:root,
[data-branch="afilli"] {
  --bg: #F5EFE6;
  --surface: #FFFCF7;
  --surface-2: #F0E7DA;
  --ink: #23150F;
  --ink-2: #6B574A;
  --ink-3: #9A8676;
  --line: #E6DACA;
  --accent: #9A6629;          /* karamel / altın */
  --accent-strong: #7C4F1C;
  --accent-soft: #F2E4CD;
  --on-accent: #FFFFFF;
  --hero-shade: linear-gradient(180deg, rgba(20, 11, 7, 0.15) 0%, rgba(20, 11, 7, 0.55) 100%);
  --logo-ring: #FFFCF7;
  --logo-font: "Fraunces", Georgia, serif;
  --qr-color: #23150F;
  --mark: #F4D9A8;
}

[data-branch="onessa"] {
  --bg: #FBF6EC;
  --surface: #FFFEFA;
  --surface-2: #F3EEE2;
  --ink: #22301F;
  --ink-2: #5E6A58;
  --ink-3: #8D9586;
  --line: #E9E2D2;
  --accent: #4C7356;          /* adaçayı yeşili (logo) */
  --accent-strong: #3B5C44;
  --accent-soft: #E3ECDF;
  --on-accent: #FFFFFF;
  --caramel: #C27B33;
  --hero-shade: linear-gradient(180deg, rgba(34, 48, 31, 0.10) 0%, rgba(34, 48, 31, 0.55) 100%);
  --logo-ring: #FFFEFA;
  --logo-font: "Great Vibes", "Fraunces", cursive;
  --qr-color: #3B5C44;
  --mark: #F1DDBF;
}

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(35, 21, 15, 0.06), 0 2px 8px rgba(35, 21, 15, 0.05);
  --shadow-md: 0 8px 28px rgba(35, 21, 15, 0.12);
  --page-w: 560px;
  --gutter: 18px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-padding-top: 140px; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
body.sheet-open { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.page {
  max-width: var(--page-w);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-b));
}
body.no-action-bar .page { padding-bottom: calc(32px + var(--safe-b)); }

@media (min-width: 640px) {
  body { background: var(--surface-2); }
  .page { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(35, 21, 15, 0.10); }
}

/* ---------- Kapak ---------- */
.hero {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: var(--surface-2);
}
.hero-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
.hero-shade { position: absolute; inset: 0; background: var(--hero-shade); }
.hero-actions {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 12, 8, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 16px;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:active { transform: scale(0.94); background: rgba(20, 12, 8, 0.55); }
.icon-btn[hidden] { display: none; }

/* ---------- Marka ---------- */
.brand {
  position: relative;
  text-align: center;
  padding: 0 var(--gutter) 18px;
  margin-top: -54px;
}
.brand-logo {
  width: 108px;
  height: 108px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--logo-ring);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo--text { background: var(--surface); }
.brand-logo--text span {
  font-family: var(--logo-font);
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
  padding: 0 6px;
}
[data-branch="onessa"] .brand-logo--text span { font-size: 36px; }
[data-branch="onessa"] .brand-logo--text { box-shadow: var(--shadow-md), inset 0 0 0 3px var(--surface), inset 0 0 0 4.5px var(--caramel); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72;
}
.brand-tagline {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
}
.brand-meta {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-meta:empty { display: none; }
.brand-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.brand-meta i { color: var(--accent); font-size: 12px; }

/* ---------- Yapışkan arama + kategoriler ---------- */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  padding: 10px 0 0;
  border-bottom: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .sticky-bar { background: var(--bg); }
}
.search {
  margin: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 6px 0 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search > i { color: var(--ink-3); font-size: 15px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px; /* iOS yakınlaştırmasını önler */
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--ink-3);
  display: none;
  place-items: center;
}
.is-searching .search-clear { display: grid; }

.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px var(--gutter) 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cat-chip-icon { font-size: 15px; }
.cat-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}
[data-branch="onessa"] .cat-chip.is-active { background: var(--accent); border-color: var(--accent); }
.is-searching .cat-nav { opacity: 0.45; }

/* ---------- Menü ---------- */
.menu { padding: 6px var(--gutter) 8px; }
.menu-section { padding-top: 22px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
}
.section-count {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.item-list { list-style: none; }
.item-list > li + li .item { border-top: 1px solid var(--line); }

.item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  text-align: left;
  transition: opacity 0.2s;
}
.item:active { opacity: 0.7; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.item-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
}
.item-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 24;
}
.item-desc {
  margin-top: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-price {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
[data-branch="onessa"] .item-price { color: var(--accent-strong); }

.item-media {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(110deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%) 0 0 / 250% 100%;
  animation: shimmer 1.4s linear infinite;
  box-shadow: var(--shadow-sm);
}
.item-media.is-loaded { animation: none; background: var(--surface-2); }
.item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.item-media.is-loaded img { opacity: 1; }

mark {
  background: var(--mark);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* İskelet (yükleniyor) */
.item--skeleton { display: flex; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.item--skeleton:first-child { border-top: 0; }
.sk {
  display: block;
  height: 12px;
  border-radius: 6px;
  margin-bottom: 9px;
  background: linear-gradient(110deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%) 0 0 / 250% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-title { width: 55%; height: 16px; }
.sk-line { width: 92%; }
.sk-line.short { width: 70%; }
.sk-price { width: 64px; height: 14px; margin-top: 4px; }
.item--skeleton .item-body { padding-top: 4px; }

@keyframes shimmer { to { background-position: -250% 0; } }

.empty {
  text-align: center;
  padding: 56px 12px;
  color: var(--ink-2);
}
.empty i { font-size: 28px; color: var(--accent); margin-bottom: 14px; }
.empty h3 { font-family: var(--font-display); font-size: 20px; color: var(--ink); margin-bottom: 6px; }

/* ---------- Alt bilgi ---------- */
.site-footer {
  margin: 28px var(--gutter) 0;
  padding: 24px 0 8px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}
.site-footer p + p, .footer-name + p { margin-top: 8px; }
.footer-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--ink); }
.site-footer a { color: var(--accent-strong); font-weight: 700; }
.footer-note { font-size: 12px; color: var(--ink-3); }
.footer-copy { font-size: 12px; color: var(--ink-3); }

/* ---------- Hızlı erişim çubuğu ---------- */
.action-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  width: min(calc(100% - 28px), calc(var(--page-w) - 28px));
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(20, 12, 8, 0.28);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .action-bar { background: var(--ink); }
}
.action {
  flex: 1;
  height: 48px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--surface);
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.action:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.08); }
.action--primary { background: var(--accent); color: var(--on-accent); }
[data-branch="afilli"] .action--primary { background: #B88140; color: #1E120C; }

/* ---------- Alt sayfalar ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 9, 6, 0.5);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: var(--page-w);
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 14px 22px calc(24px + var(--safe-b));
  transform: translate(-50%, 100%);
  transition: transform 0.32s var(--ease);
  box-shadow: 0 -10px 40px rgba(15, 9, 6, 0.2);
}
.sheet.is-open .sheet-backdrop { opacity: 1; }
.sheet.is-open .sheet-panel { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  .sheet-panel, .sheet-backdrop { transition: none; }
}
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
}
.sheet-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-right: 44px;
}
.sheet-text { color: var(--ink-2); font-size: 14px; text-align: center; margin: 14px 0 18px; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }

.btn-primary, .btn-ghost {
  height: 50px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  width: 100%;
}
.btn-primary { background: var(--ink); color: var(--surface); margin-top: 16px; }
.sheet-actions .btn-primary { margin-top: 0; }
[data-branch="onessa"] .btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }

/* Ürün detayı */
.sheet-panel--product { padding: 0 0 calc(22px + var(--safe-b)); }
.sheet-panel--product .sheet-close { background: rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-sm); }
.pd-media {
  aspect-ratio: 4 / 3;
  max-height: 46vh;
  width: 100%;
  background-color: var(--surface-2);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.pd-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s var(--ease); }
.pd-media img.is-loaded { opacity: 1; }
.pd-body { padding: 20px 22px 0; }
.pd-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 60;
}
.pd-desc { margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.pd-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pd-price-label { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.pd-price { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-strong); }

/* İletişim */
.info-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
}
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row > i:first-child {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 16px;
}
.info-row div { flex: 1; min-width: 0; }
.info-row strong { display: block; font-size: 14px; }
.info-row p { font-size: 13.5px; color: var(--ink-2); }
.info-go { color: var(--ink-3); font-size: 12px; }

/* QR */
.qr-card {
  margin: 4px auto 0;
  width: fit-content;
  padding: 18px 18px 12px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.qr-card img { width: 220px; height: 220px; }
.qr-url { margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-3); }

/* Küçük ekran ince ayarları */
@media (max-width: 360px) {
  :root { --gutter: 14px; }
  .item-media { width: 88px; height: 88px; }
  .brand-name { font-size: 25px; }
  .action span { font-size: 13px; }
}
