:root {
  --accent: #4A6741; /* JS tarafından cafenin theme_color'ı ile değiştirilir */
  --accent-ink: #ffffff;
  --accent-soft: #EAF0DF; /* rozetler için accent'in açık tonu, JS ayarlar */
  --accent-bg-top: #E4EAD9; /* üstteki yumuşak arka plan tonu, JS ayarlar */
  --bg: #F7F8F3;
  --surface: #FFFFFF;
  --ink: #24291F;
  --muted: #6B7263;
  --border: #E4E8DD;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Work Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--accent-bg-top) 0px, var(--bg) 480px, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; padding-bottom: 90px; }

/* ---------- Loading / Error ---------- */
.loading-screen, .error-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 24px;
}
.loading-spinner {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-screen h2 { font-family: var(--serif); font-weight: 600; margin: 0; }
.error-screen p { color: var(--muted); margin: 0; max-width: 320px; }

/* Site ilk açıldığında ~1sn görünen cafe adı ekranı */
.splash-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding: 24px;
  animation: splash-fade-in 0.35s ease;
}
.splash-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.splash-sub {
  color: var(--muted);
  font-size: 0.9rem;
}
@keyframes splash-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Top bar (her iki ekranda da sabit) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 6px;
}
.topbar .brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.topbar .sub {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 1px;
}
.cafe-logo {
  height: 40px;
  max-width: 160px;
  object-fit: contain;
}
.footer-info {
  padding: 4px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-info-item {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.footer-info-item.eco-note {
  color: var(--ink);
}
.wifi-chip {
  margin: 6px 16px 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  box-shadow: 0 1px 3px rgba(20,24,16,0.06);
}
.wifi-chip-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.wifi-chip-text {
  font-size: 0.78rem;
  color: var(--muted);
}
.wifi-chip-text strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--ink);
  flex-shrink: 0;
}

/* ---------- Ana ekran: kategori afişleri ---------- */
.banner-list { padding: 12px 16px 4px; }
.category-banner {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  height: 150px;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.category-banner:active {
  transform: scale(0.97);
}
.category-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,24,16,0.72), rgba(20,24,16,0.05) 60%);
}
.category-banner .banner-text {
  position: absolute;
  left: 16px; bottom: 14px; right: 16px;
  color: #fff;
  z-index: 1;
}
.category-banner .banner-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
}
.category-banner .banner-count {
  font-size: 0.76rem;
  opacity: 0.9;
  margin-top: 2px;
}

/* ---------- Kategori (browse) ekranı ---------- */
.tab-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  gap: 22px;
  padding: 8px 18px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-item {
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease;
}
.tab-item:active {
  transform: scale(0.93);
}
.tab-item.active {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Öne çıkanlar şeridi */
.featured-strip {
  display: flex;
  gap: 10px;
  padding: 14px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.featured-strip::-webkit-scrollbar { display: none; }
.featured-card {
  flex-shrink: 0;
  width: 122px;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.featured-card:active {
  transform: scale(0.95);
}
.featured-card .featured-image {
  width: 122px; height: 96px;
  border-radius: 12px;
  background: var(--border);
  background-size: cover;
  background-position: center;
}
.featured-strip.large .featured-card {
  width: 150px;
}
.featured-strip.large .featured-card .featured-image {
  width: 150px; height: 120px;
}
.featured-card .featured-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.3;
}
.featured-card .featured-price {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 1px;
}

/* Ürün listesi */
.product-list { padding: 16px 16px 4px; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.category-banner, .featured-card, .product-card {
  animation: fadeInUp 0.3s ease both;
}

.product-card {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  align-items: flex-start;
  scroll-margin-top: 70px;
}
.product-card.unavailable { opacity: 0.5; }
.product-info { flex: 1; min-width: 0; }
.product-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.product-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  margin: 0;
}
.badge-new {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.product-desc {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 5px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.unavailable-tag { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

.product-image {
  width: 74px; height: 74px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.product-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
  font-size: 1.4rem;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:disabled { background: var(--border); color: var(--muted); cursor: default; }
.qty-value { min-width: 16px; text-align: center; font-weight: 600; font-size: 0.85rem; }
.add-btn {
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ---------- Cart bar ---------- */
.cart-bar {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  cursor: pointer;
  z-index: 20;
}
.cart-bar-left { display: flex; flex-direction: column; }
.cart-bar-count { font-size: 0.75rem; opacity: 0.85; }
.cart-bar-total { font-weight: 700; font-size: 1.05rem; }
.cart-bar-cta { font-weight: 600; font-size: 0.9rem; }

/* ---------- Cart drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,17,14,0.4);
  z-index: 30;
}
.drawer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 82vh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.drawer h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 14px;
}
.drawer-items { overflow-y: auto; flex: 1; }
.drawer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.drawer-item-name { font-weight: 500; font-size: 0.92rem; }
.drawer-item-price { color: var(--muted); font-size: 0.82rem; }
.drawer-note {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: var(--sans);
  font-size: 0.88rem;
  margin-top: 14px;
  resize: none;
}
.drawer-footer { margin-top: 14px; }
.drawer-total-row {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 1.05rem;
  margin-bottom: 12px;
}
.submit-btn {
  width: 100%;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}
.submit-btn:disabled { opacity: 0.6; }
.close-drawer {
  background: none; border: none;
  color: var(--muted);
  font-size: 0.85rem;
  align-self: center;
  margin-top: 10px;
  cursor: pointer;
}

.order-confirm { text-align: center; padding: 20px 0; }
.order-confirm .check {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 14px;
}

.empty-menu { text-align: center; padding: 60px 24px; color: var(--muted); }
