@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0E1622;
  --card: #182233;
  --card-2: #0B1320;
  --accent: #C89669;
  --accent-hover: #D4A574;
  --text: #F5EBD8;
  --text-muted: #9CA3AF;
  --text-soft: #C8CCD4;
  --border: rgba(255,255,255,0.04);
  --border-accent: rgba(200,150,105,0.18);
}

html, body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ============ APP CONTAINER ============ */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ============ SCREEN MANAGEMENT ============ */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ HEADER ============ */
.header {
  padding: 38px 22px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.brand {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--accent);
  font-size: 12px;
  margin: 6px 0 0;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 20px;
}
.divider::before, .divider::after {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}
.divider span {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ CATEGORIES ============ */
.cats {
  display: flex;
  gap: 10px;
  padding: 4px 18px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }

.cat {
  flex-shrink: 0;
  min-width: 84px;
  background: var(--card);
  border-radius: 18px;
  padding: 12px 6px 10px;
  text-align: center;
  border: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.cat:hover {
  border-color: rgba(200,150,105,0.4);
  box-shadow: 0 8px 22px rgba(200,150,105,0.18);
}
.cat:active { transform: scale(0.96); }

.cat.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(200,150,105,0.35);
}

.cat-img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--card-2);
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 22px;
  overflow: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.cat-img img { width: 100%; height: 100%; object-fit: cover; }
.cat:hover .cat-img { color: var(--accent-hover); }
.cat.active .cat-img { background: var(--card-2); color: var(--text); }

.cat-name {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.25s ease;
}
.cat:hover .cat-name { color: var(--text); }
.cat.active .cat-name { color: var(--bg); font-weight: 600; }

/* ============ SEARCH ============ */
.search {
  margin: 0 18px 22px;
  position: relative;
}
.search input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus {
  border-color: rgba(200,150,105,0.5);
  box-shadow: 0 8px 22px rgba(200,150,105,0.15);
}
.search .ti {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 17px;
  pointer-events: none;
}

/* ============ SECTION TITLE ============ */
.section-title {
  padding: 4px 22px 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.section-title h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.3px;
}
.section-title span { font-size: 11px; color: var(--text-muted); }

/* ============ PRODUCTS ============ */
.products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 18px 32px;
}
.product {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.25s;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  cursor: pointer;
}
.product:hover {
  border-color: rgba(200,150,105,0.3);
  box-shadow: 0 14px 30px rgba(200,150,105,0.15);
  transform: translateY(-2px);
}
.product:active { transform: scale(0.97); }
.product-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--card-2);
  position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 36px; opacity: 0.5;
}
.product.featured .product-img::after {
  content: '★';
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  box-shadow: 0 4px 12px rgba(200,150,105,0.4);
}
.product-price {
  font-size: 17px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.product-price .cur {
  color: var(--accent);
  font-weight: 600;
  margin-right: 2px;
}
.product-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty i {
  font-size: 30px;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ============ DETAIL SCREEN ============ */
.detail-hero {
  height: 280px;
  margin: 10px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35);
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 80px; opacity: 0.4;
}
.back-btn {
  position: absolute;
  top: 18px; left: 18px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(14,22,34,0.85);
  border: 1px solid rgba(200,150,105,0.3);
  color: var(--text);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  backdrop-filter: blur(10px);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.back-btn:hover {
  background: rgba(14,22,34,0.95);
  box-shadow: 0 8px 22px rgba(200,150,105,0.35);
}
.back-btn:active { transform: scale(0.94); }

.detail-body { padding: 24px 26px 40px; }
.detail-name {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: -0.5px;
}
.detail-tag {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 16px;
}
.detail-price {
  font-size: 26px;
  color: var(--text);
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--accent);
  display: inline-block;
  letter-spacing: -0.5px;
}
.detail-price .cur {
  color: var(--accent);
  font-weight: 600;
  margin-right: 4px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 14px;
}
.section-label span {
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
}
.section-label hr {
  flex: 1;
  border: none;
  border-top: 1px solid rgba(200,150,105,0.25);
}

.ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ing {
  background: var(--card);
  border: 1px solid var(--border-accent);
  padding: 8px 16px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.desc {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ============ FOOTER ============ */
.footer {
  text-align: center;
  padding: 36px 20px 40px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.footer-ig {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: transparent;
  border: 1px solid rgba(200,150,105,0.35);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.footer-ig:hover {
  background: rgba(200,150,105,0.08);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(200,150,105,0.18);
  transform: translateY(-2px);
}
.footer-ig:active { transform: scale(0.97); }
.footer-ig i {
  color: var(--accent);
  font-size: 20px;
}

/* ============ DESKTOP TWEAKS ============ */
@media (min-width: 768px) {
  .app { padding-top: 20px; padding-bottom: 20px; }
  .products { grid-template-columns: 1fr 1fr 1fr; }
}

/* ============ PRELOADER ============ */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-brand {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 500;
  opacity: 0;
  animation: preloaderFadeIn 0.8s ease 0.1s forwards;
}
.preloader-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 10px;
  opacity: 0;
  animation: preloaderFadeIn 0.8s ease 0.4s forwards;
}
.preloader-divider {
  width: 60px;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  margin: 22px 0 20px;
  animation: preloaderLine 0.8s ease 0.7s forwards;
  transform-origin: center;
}
.preloader-dots {
  display: flex;
  gap: 8px;
  opacity: 0;
  animation: preloaderFadeIn 0.5s ease 1s forwards;
}
.preloader-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: preloaderBounce 1.2s infinite ease-in-out;
}
.preloader-dots span:nth-child(2) { animation-delay: 0.15s; }
.preloader-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes preloaderFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes preloaderLine {
  from { opacity: 0; transform: scaleX(0); }
  to { opacity: 0.5; transform: scaleX(1); }
}
@keyframes preloaderBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ============ BOTTOM BACK BUTTON (ürün detay) ============ */
.back-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: calc(100% - 32px);
  margin: 8px 16px 24px;
  padding: 14px 20px;
  background: var(--card);
  border: 1px solid var(--border-accent);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}
.back-bottom:hover {
  background: var(--card-hover, #1d2a3f);
  border-color: rgba(200,150,105,0.4);
}
.back-bottom:active { transform: scale(0.98); }
.back-bottom i { color: var(--accent); font-size: 18px; }