:root {
  --bg: #17130f;
  --surface: #221c16;
  --text: #f3ede5;
  --text-muted: #a89b8c;
  --border: #332a21;
  --accent: #e08a3e;
  --accent-soft: #2c2822;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --tab-height: 52px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 36px;
  z-index: 20;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-box {
  flex: 1;
  max-width: 280px;
}

.search-box input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 16px; /* iOS zoom engellemek için en az 16px */
  color: var(--text);
}

.search-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------- Category tabs ---------- */
.category-tabs {
  position: sticky;
  top: 97px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-btn:hover {
  border-color: var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Menu content ---------- */
.menu-content {
  padding: 20px 16px 8px;
  max-width: 1080px;
  margin: 0 auto;
}

.loading, .empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.85em;
}

.category-section {
  margin-bottom: 32px;
}

.category-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 600;
  scroll-margin-top: 125px;
}

.category-heading .count {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 10px;
}

.product-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: left;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(31, 27, 22, 0.14);
  border-color: #e0d6c8;
}

.product-card .thumb-wrap {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: var(--accent-soft);
  overflow: hidden;
}

.product-card .thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-wrap.is-fallback img {
  object-fit: contain;
  padding: 8px;
}

.modal-image.is-fallback {
  object-fit: contain;
  padding: 24px;
}

.product-card .card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.3;
}

.card-price {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-size: 0.92rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-tag {
  font-size: 0.68rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-card {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  position: relative;
  animation: slide-up 0.2s ease;
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: 20px;
  }
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: #1f1b16;
  z-index: 2;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent-soft);
}

.modal-body {
  padding: 18px 20px 24px;
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.modal-header-row h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-price {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.15rem;
  white-space: nowrap;
}

.modal-description {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 10px 0 0;
}

.modal-meta {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.meta-value {
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 20px 16px 0;
}

.allergen-notice {
  max-width: 640px;
  margin: 0 auto 14px;
  padding: 14px 16px;
  background: var(--accent-soft);
  border-radius: 12px;
  text-align: left;
  font-size: 0.78rem;
  line-height: 1.55;
}

.allergen-notice strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.allergen-notice p {
  margin: 0 0 6px;
}

.allergen-notice p:last-child {
  margin-bottom: 0;
}

/* ---------- Category Note ---------- */
.category-note {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 12px;
  margin: -6px 0 14px;
  border-left: 4px solid var(--accent);
  line-height: 1.4;
}


/* ---------- Instagram Bar ---------- */
.instagram-bar {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 25;
}

.instagram-bar a.instagram-link {
  color: #fff;
  text-decoration: none;
  display: inline-block;
}

.instagram-bar a.instagram-link:hover {
  text-decoration: underline;
}

.instagram-bar strong {
  font-weight: 700;
}


/* Kategori sekmelerinde sağda soluk geçiş (kaydırılabilir ipucu) */
.category-tabs {
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
  mask-image: linear-gradient(to right, #000 85%, transparent 100%);
}


/* ---------- Language Switcher ---------- */
.lang-switcher {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.lang-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lang-btn:not(.active):hover {
  border-color: var(--accent);
  color: var(--accent);
}
