/* ================================================
   QR MENÜ - ANA STİL DOSYASI
   Mobile-first, modern kafe tasarımı
   ================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@700;800&display=swap');

/* ------------------------------------------------
   CSS DEĞİŞKENLERİ (settings.json'dan JS ile ayarlanır)
   ------------------------------------------------ */
:root {
  --primary: #1f7a4d;
  --primary-dark: #155c39;
  --primary-light: #e8f5ee;
  --secondary: #f4b942;
  --secondary-dark: #d99e2a;
  --background: #f8f7f3;
  --surface: #ffffff;
  --text: #1f2933;
  --text-light: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 900px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

/* ------------------------------------------------
   RESET & BASE
   ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ------------------------------------------------
   YÜKLEME EKRANI
   ------------------------------------------------ */
#loading-screen {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 20px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ------------------------------------------------
   HATA EKRANI
   ------------------------------------------------ */
#error-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 24px;
  text-align: center;
  gap: 16px;
}

#error-screen.visible {
  display: flex;
}

.error-icon {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.error-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.error-message {
  font-size: 0.95rem;
  color: var(--text-light);
  max-width: 360px;
}

/* ------------------------------------------------
   WRAPPER
   ------------------------------------------------ */
#app {
  display: none;
  flex-direction: column;
  min-height: 100vh;
}

#app.visible {
  display: flex;
}

/* ------------------------------------------------
   HERO / KAPAK ALANI
   ------------------------------------------------ */
.hero {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

@media (min-width: 768px) {
  .hero {
    height: 460px;
  }
}

.hero-cover {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 8s ease;
}

.hero-cover:hover {
  transform: scale(1.04);
}

/* Cover görsel yüklenemezse yeşil gradient kalır */
.hero-cover-fallback {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(160deg, 
    var(--primary) 0%, 
    var(--primary-dark) 40%,
    #0d4a2e 100%);
  z-index: 1;
}

/* Dekoratif desen overlay */
.hero-cover-fallback::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(244,185,66,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
}

.hero-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.35) 50%,
    rgba(0,0,0,0.70) 100%
  );
  z-index: 2;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 24px 20px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hero-content {
    padding: 32px 40px 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

/* Logo */
.hero-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  object-fit: cover;
  background: var(--surface);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* Logo yoksa emoji fallback */
.hero-logo-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.9);
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.hero-info {
  flex: 1;
}

.hero-business-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: -0.5px;
}

@media (min-width: 480px) {
  .hero-business-name {
    font-size: 2.3rem;
  }
}

.hero-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
  margin-top: 4px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}

.hero-meta-item .icon {
  font-size: 1rem;
  opacity: 0.9;
}

/* Sosyal Butonlar */
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.action-btn:active {
  transform: scale(0.96);
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  box-shadow: 0 4px 15px rgba(37,211,102,0.4);
}

.btn-whatsapp:hover {
  background: #1ebe5a;
  box-shadow: 0 6px 20px rgba(37,211,102,0.5);
  transform: translateY(-1px);
}

.btn-instagram {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(220,39,67,0.4);
}

.btn-instagram:hover {
  box-shadow: 0 6px 20px rgba(220,39,67,0.5);
  transform: translateY(-1px);
}

.btn-maps {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5);
}

.btn-maps:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* ------------------------------------------------
   ANA İÇERİK
   ------------------------------------------------ */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 32px;
}

@media (min-width: 768px) {
  .main-content {
    padding: 0 32px 48px;
  }
}

/* ------------------------------------------------
   ARAMA KUTUSU
   ------------------------------------------------ */
.search-section {
  padding: 24px 0 16px;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: var(--transition);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.search-input:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
  color: var(--primary);
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  font-size: 0.85rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.search-clear.visible {
  display: flex;
}

.search-clear:hover {
  background: var(--text-muted);
  color: #fff;
}

/* ------------------------------------------------
   KATEGORİ FİLTRE BUTONLARI
   ------------------------------------------------ */
.categories-section {
  padding: 4px 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--background);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

@media (min-width: 768px) {
  .categories-section {
    margin: 0 -32px;
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* Sticky için blur efekti */
.categories-section::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: var(--background);
  opacity: 0.95;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.categories-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 8px;
  position: relative;
  z-index: 1;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.2px;
}

.category-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31,122,77,0.35);
}

/* ------------------------------------------------
   MENÜ BÖLÜMÜ
   ------------------------------------------------ */
#menu-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ------------------------------------------------
   KATEGORİ BAŞLIĞI
   ------------------------------------------------ */
.category-section {
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.category-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.category-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--border), transparent);
  border-radius: 2px;
}

.category-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 100px;
}

/* ------------------------------------------------
   ÜRÜN KARTLARı GRID
   ------------------------------------------------ */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

/* ------------------------------------------------
   ÜRÜN KARTI
   ------------------------------------------------ */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid rgba(226,232,240,0.8);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: transparent;
}

/* Kart Görsel Alanı */
.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 58%; /* 58% oranında görsel alanı */
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light) 0%, #e2ece8 100%);
  flex-shrink: 0;
}

.product-img {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-img {
  transform: scale(1.06);
}

/* Görsel bulunamadı fallback */
.product-img-fallback {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #d4ede1 100%);
}

.product-img-fallback .fallback-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.product-img-fallback .fallback-text {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
  opacity: 0.7;
}

/* Badge */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

.badge-popular {
  background: var(--secondary);
  color: #7a4f00;
  box-shadow: 0 2px 8px rgba(244,185,66,0.5);
}

.badge-new {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31,122,77,0.4);
}

.badge-chef {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  box-shadow: 0 2px 8px rgba(231,76,60,0.4);
}

.badge-default {
  background: rgba(255,255,255,0.9);
  color: var(--text);
}

/* Kart İçerik Alanı */
.product-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.product-description {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.product-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* ------------------------------------------------
   BOŞ DURUM
   ------------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 14px;
  animation: fadeUp 0.3s ease both;
}

.empty-state-icon {
  font-size: 3.5rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state-sub {
  font-size: 0.9rem;
  color: var(--text-light);
  max-width: 280px;
}

.empty-state-btn {
  margin-top: 8px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(31,122,77,0.3);
}

.empty-state-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ------------------------------------------------
   FOOTER
   ------------------------------------------------ */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-business {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-light);
}

.footer-powered {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.footer-powered a {
  color: var(--primary);
  font-weight: 600;
}

/* ------------------------------------------------
   ARAMA VURGUSu
   ------------------------------------------------ */
.highlight {
  background: rgba(244,185,66,0.35);
  color: var(--text);
  border-radius: 2px;
  padding: 0 2px;
}

/* ------------------------------------------------
   MASAÜSTÜ DÜZELTMELER
   ------------------------------------------------ */
@media (min-width: 768px) {
  .hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .hero-business-name {
    font-size: 2.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

/* ------------------------------------------------
   SCROLL TO TOP BUTTON
   ------------------------------------------------ */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(31,122,77,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 200;
}

#scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

#scroll-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(31,122,77,0.5);
}

/* ------------------------------------------------
   ÜRÜN SAYACI (arama sonucu)
   ------------------------------------------------ */
.results-info {
  font-size: 0.85rem;
  color: var(--text-light);
  padding: 0 0 16px;
  font-weight: 500;
}

.results-info strong {
  color: var(--primary);
  font-weight: 700;
}

/* ------------------------------------------------
   HERO AÇIKLAMA
   ------------------------------------------------ */
.hero-description {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  margin-top: 6px;
  max-width: 420px;
  line-height: 1.5;
}

/* ------------------------------------------------
   ANİMASYON UTILITY
   ------------------------------------------------ */
.fade-in {
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ------------------------------------------------
   RESPONSIVE DÜZELTMELER
   ------------------------------------------------ */
@media (max-width: 360px) {
  .hero-business-name {
    font-size: 1.6rem;
  }

  .hero-logo,
  .hero-logo-fallback {
    width: 58px;
    height: 58px;
  }

  .action-btn {
    padding: 9px 14px;
    font-size: 0.8rem;
  }
}
