/* ==========================================================================
   QR Menü — müşteri menü sayfası stilleri
   Mobil öncelikli. Açık/koyu tema cihaz ayarına göre otomatik seçilir.
   ========================================================================== */

:root {
  /* Marka rengi menu.json'dan JS ile yazılır; buradakiler yedek değerlerdir */
  --brand: #c2410c;
  --brand-rgb: 194 65 12;
  --brand-on: #ffffff;

  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f4f0eb;
  --text: #1c1917;
  --text-muted: #79716b;
  --border: #e8e2db;
  --shadow-sm: 0 1px 2px rgb(28 25 23 / 0.05);
  --shadow-md: 0 1px 3px rgb(28 25 23 / 0.06), 0 12px 28px -16px rgb(28 25 23 / 0.22);
  --tag-l: 30%;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --maxw: 620px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141110;
    --surface: #1f1b19;
    --surface-2: #2a2523;
    --text: #f4f0ec;
    --text-muted: #a8a09b;
    --border: #322c29;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 1px 3px rgb(0 0 0 / 0.5), 0 12px 28px -16px rgb(0 0 0 / 0.7);
    --tag-l: 74%;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #141110;
  --surface: #1f1b19;
  --surface-2: #2a2523;
  --text: #f4f0ec;
  --text-muted: #a8a09b;
  --border: #322c29;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 3px rgb(0 0 0 / 0.5), 0 12px 28px -16px rgb(0 0 0 / 0.7);
  --tag-l: 74%;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.kapsayici {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 16px;
}

/* ------------------------------------------------------------------ başlık */

.ust-alan {
  padding: 22px 0 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgb(var(--brand-rgb) / 0.12), transparent 70%);
}

.ust-alan__ic {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.ust-alan__yazi {
  min-width: 0;
  flex: 1 1 auto;
}

.restoran-adi {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.restoran-slogan {
  margin: 3px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.masa-rozeti {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgb(var(--brand-rgb) / 0.14);
  /* koyu temada marka rengi sönük kalabilir; metni okunur tutar */
  color: color-mix(in srgb, var(--brand) 72%, var(--text));
  font-size: 0.8125rem;
  font-weight: 600;
}


.tema-dugmesi {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.tema-dugmesi:hover {
  background: var(--surface-2);
}

.tema-dugmesi:active {
  transform: scale(0.94);
}

.tema-dugmesi svg {
  width: 20px;
  height: 20px;
}

/* Düğme, geçilecek temanın simgesini gösterir: açık temada ay, koyu temada güneş */
.ikon-ay {
  display: block;
}

.ikon-gunes {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ikon-ay {
    display: none;
  }
  :root:not([data-theme="light"]) .ikon-gunes {
    display: block;
  }
}

:root[data-theme="dark"] .ikon-ay {
  display: none;
}

:root[data-theme="dark"] .ikon-gunes {
  display: block;
}

:root[data-theme="light"] .ikon-ay {
  display: block;
}

:root[data-theme="light"] .ikon-gunes {
  display: none;
}

/* ------------------------------------------------------------- araç çubuğu */

.arac-cubugu {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .arac-cubugu {
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
  }
}

.arac-cubugu[data-yapisik="evet"] {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 16px -14px rgb(0 0 0 / 0.5);
}

.arama-kutusu {
  position: relative;
  display: flex;
  align-items: center;
}

.arama-kutusu svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.arama-girisi {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 38px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  -webkit-appearance: none;
  appearance: none;
}

.arama-girisi::placeholder {
  color: var(--text-muted);
}

.arama-girisi::-webkit-search-cancel-button {
  display: none;
}

.arama-temizle {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
}

.arama-temizle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.arama-kutusu[data-dolu="evet"] .arama-temizle {
  display: grid;
}

.kategori-seridi {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 16px;
  margin-inline: -16px;
  scroll-padding-inline: 16px;
}

.kategori-seridi::-webkit-scrollbar {
  display: none;
}

.cip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 550;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cip:hover {
  color: var(--text);
}

.cip[aria-current="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-on);
}

/* ------------------------------------------------------------------ menü */

.menu-alani {
  padding-block: 8px 40px;
}

.kategori {
  padding-top: 26px;
  /* yapışkan araç çubuğunun altında kalmasın diye pay bırakılır */
  scroll-margin-top: calc(var(--arac-yuksekligi, 100px) + 14px);
}

.kategori__baslik {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
}

.kategori__baslik::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.urun-listesi {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.kart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.kart__gorsel {
  margin: 0;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
}

.kart__gorsel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fotoğrafı olmayan ürün için nötr yer tutucu */
.kart__gorsel--bos {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  opacity: 0.5;
}

.kart__gorsel--bos svg {
  width: 40px;
  height: 40px;
}

.kart__govde {
  padding: 15px 17px 17px;
}

.kart__ust {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.kart__ad {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  flex: 1 1 auto;
}

.kart__fiyat {
  flex: 0 0 auto;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: color-mix(in srgb, var(--brand) 78%, var(--text));
}

.kart__aciklama {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.etiketler {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 0;
  padding: 0;
}

.etiket {
  --tag-h: 20;
  --tag-s: 80%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: hsl(var(--tag-h) var(--tag-s) 48% / 0.13);
  color: hsl(var(--tag-h) var(--tag-s) var(--tag-l));
}

.etiket[data-etiket="aci"] { --tag-h: 8; --tag-s: 78%; }
.etiket[data-etiket="vegan"] { --tag-h: 145; --tag-s: 50%; }
.etiket[data-etiket="vejetaryen"] { --tag-h: 168; --tag-s: 44%; }
.etiket[data-etiket="glutensiz"] { --tag-h: 38; --tag-s: 78%; }
.etiket[data-etiket="laktozsuz"] { --tag-h: 205; --tag-s: 62%; }

.kart__bilgi {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.kart__bilgi b {
  font-weight: 600;
  color: color-mix(in srgb, var(--text-muted) 70%, var(--text));
}

.kart__alerjen {
  min-width: 0; /* uzun alerjen listesi taşmak yerine alt satıra geçsin */
}

/* Kalori kartın sağ kenarına yaslanır */
.kart__kalori {
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- durumlar */

.durum {
  margin: 48px auto;
  max-width: 420px;
  text-align: center;
  color: var(--text-muted);
}

.durum h2 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  color: var(--text);
}

.durum p {
  margin: 0;
  font-size: 0.9375rem;
}

.durum code {
  font-size: 0.8125em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
}

.yukleniyor {
  display: grid;
  gap: 16px;
  padding-top: 26px;
}

.iskelet {
  height: 300px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: parilti 1.4s ease-in-out infinite;
}

@keyframes parilti {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------------------- alt */

.alt-alan {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  background: var(--surface);
}

.iletisim {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.iletisim a {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.iletisim a:active {
  transform: scale(0.985);
}

.iletisim a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.iletisim .btn-telefon {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-on);
}

.iletisim .btn-whatsapp {
  background: #25d366;
  border-color: #25d366;
  color: #0b2e18;
}

.alt-not {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- masaüstü */

@media (min-width: 900px) {
  :root {
    --maxw: 1000px;
  }

  .urun-listesi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .restoran-adi {
    font-size: 1.6rem;
  }

  .kategori {
    padding-top: 34px;
  }
}

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