/* ============================================================
   MenuVerse AR — style.css  (Müşteri Arayüzü)
   Dark Glassmorphism · Premium Restoran
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@600;700;800&display=swap');

/* ─── Değişkenler ─────────────────────────────────────────── */
:root {
  --accent: #FF5733;
  --accent-2: #FF8C42;
  --accent-glow: rgba(255, 87, 51, .30);
  --bg-card: rgba(8, 8, 18, .90);
  --bg-glass: rgba(255, 255, 255, .06);
  --bg-glass-md: rgba(255, 255, 255, .10);
  --border: rgba(255, 255, 255, .10);
  --text-1: #FFFFFF;
  --text-2: rgba(255, 255, 255, .60);
  --text-3: rgba(255, 255, 255, .32);
  --font: 'Inter', sans-serif;
  --font-d: 'Outfit', sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-full: 9999px;
  --blur: blur(22px);
  --blur-h: blur(38px);
  --shadow: 0 8px 32px rgba(0, 0, 0, .55);
  --t: all .22s cubic-bezier(.4, 0, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: none !important;
  background-color: transparent !important;
  color: var(--text-1);
  font-family: var(--font);
}

/* ══════════════════════════════════════════════════════════
   AR SAHNE & WEB-XR
══════════════════════════════════════════════════════════ */
#ar-scene,
.a-canvas,
canvas {
  background: none !important;
  background-color: transparent !important;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   MINDAR & A-FRAME UI ZORLA GİZLEME
══════════════════════════════════════════════════════════ */
.mindar-ui-overlay,
.mindar-ui-loading,
.mindar-ui-scanning,
.mindar-ui-error {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ══════════════════════════════════════════════════════════
   TOP-BAR
══════════════════════════════════════════════════════════ */
#top-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  padding: 0 8px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

#top-bar>* {
  pointer-events: all;
}

.top-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

/* Marka */
.brand-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(20, 20, 32, .76);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 8px 14px;
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .2
  }
}

/* Status badge */
.ar-status {
  flex: 0 1 auto;
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 20, 32, .76);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--text-2);
  white-space: nowrap;
}

.ar-status.tracking {
  color: #4ade80;
  border-color: rgba(74, 222, 128, .28);
}

.ar-status.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 87, 51, .9);
  box-shadow: 0 0 7px rgba(255, 87, 51, .55);
  transition: background .3s, box-shadow .3s;
}

/* Kontrol butonları */
.ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 20, 32, .85);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--t);
  box-shadow: 0 3px 14px rgba(0, 0, 0, .4);
}

.ctrl-btn:hover,
.ctrl-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.ctrl-btn-label {
  font-family: var(--font-d);
  font-size: 12px;
  font-weight: 800;
}

/* UI Gizleme ve Geçişler */
.ui-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.ui-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Modern Vizör (Onboarding) Katmanı */
#onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: none !important;
  background-color: transparent !important;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#onboarding-screen.fade-out {
  opacity: 0;
}

/* Vizör Kutusu (Scan Box) */
.scan-box {
  position: relative;
  width: 240px;
  height: 240px;
  max-width: 60vw;
  max-height: 60vw;
  margin-top: -10vh;
  box-sizing: border-box;
}

.scan-corner {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  box-sizing: border-box;
}

.s-tl {
  top: 0;
  left: 0;
  border-top-width: 3px;
  border-left-width: 3px;
  border-radius: 8px 0 0 0;
}

.s-tr {
  top: 0;
  right: 0;
  border-top-width: 3px;
  border-right-width: 3px;
  border-radius: 0 8px 0 0;
}

.s-bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-radius: 0 0 0 8px;
}

.s-br {
  bottom: 0;
  right: 0;
  border-bottom-width: 3px;
  border-right-width: 3px;
  border-radius: 0 0 8px 0;
}

.scan-line {
  position: absolute;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 8px var(--accent);
  animation: scanLineMove 2s ease-in-out infinite;
  opacity: 0.6;
}

@keyframes scanLineMove {

  0%,
  100% {
    top: 5%;
  }

  50% {
    top: 95%;
  }
}

/* Hizalama Mesajı (Pill) */
.scan-hint-pill {
  margin-top: 30px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-family: var(--font);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Dil Seçici (Gizlendi - Otomatik Algılanıyor) */
.lang-picker {
  display: none !important;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: var(--t);
}

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

/* RTL Desteği (Arapça) */
[dir="rtl"] {
  direction: rtl;
}

[dir="rtl"] #top-bar {
  flex-direction: row-reverse;
}

[dir="rtl"] .brand-badge {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-top {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .card-meta-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-bottom {
  flex-direction: row-reverse;
}

[dir="rtl"] .qty-control {
  flex-direction: row-reverse;
}

[dir="rtl"] .cart-badge {
  right: auto;
  left: -5px;
}

/* Sepet Butonu ve Badge */
.ctrl-btn#ctrl-cart {
  position: relative;
  font-size: 18px;
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ff3b30;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  display: none;
  /* 0 iken gizli */
}

.cart-badge.active {
  display: flex;
}

/* ══════════════════════════════════════════════════════════
   A-FRAME & MindAR UI TEMİZLİĞİ (Beyaz Kutu Çözümü)
══════════════════════════════════════════════════════════ */
.a-dialog,
.a-dialog-allow-button,
.a-dialog-deny-button,
.a-dialog-ok-button,
.a-enter-vr,
.a-enter-ar,
.a-orientation-modal,
.a-loader-title {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════
   ALT UI OVERLAY
══════════════════════════════════════════════════════════ */
#ui-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#ui-overlay>* {
  pointer-events: all;
}

/* ── Bilgi Kartı ── */
#info-card {
  margin: 0 8px 4px;
  background: rgba(8, 8, 18, .88);
  backdrop-filter: var(--blur-h);
  -webkit-backdrop-filter: var(--blur-h);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--r-xl);
  padding: 10px 13px 10px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.card-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.food-emoji-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--bg-glass-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.food-name {
  font-family: var(--font-d);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.meta-price {
  font-family: var(--font-d);
  font-size: 16px;
  font-weight: 900;
}

.meta-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 193, 7, .12);
  border: 1px solid rgba(255, 193, 7, .28);
  border-radius: var(--r-full);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #FFD84D;
}

.food-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 87, 51, .1);
  border: 1px solid rgba(255, 87, 51, .22);
  border-radius: var(--r-full);
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-desc {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
}

.see-more-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: var(--font);
}

.card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--bg-glass);
  height: 33px;
}

.qty-btn {
  width: 33px;
  height: 33px;
  background: transparent;
  border: none;
  color: var(--text-1);
  font-size: 18px;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: rgba(255, 87, 51, .18);
  color: var(--accent);
}

.qty-display {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.add-btn {
  flex: 1;
  height: 33px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  border-radius: var(--r-full);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-d);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 3px 14px var(--accent-glow);
  transition: var(--t);
}

.add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px var(--accent-glow);
}

.add-btn:active {
  transform: translateY(0);
}

/* ── Menü Nav ── */
#menu-nav {
  background: rgba(5, 5, 14, .93);
  backdrop-filter: var(--blur-h);
  -webkit-backdrop-filter: var(--blur-h);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.categories-scroll {
  display: flex;
  gap: 6px;
  padding: 0 12px 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.cat-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--t);
  flex-shrink: 0;
}

.cat-tab:hover {
  background: rgba(255, 87, 51, .08);
  border-color: rgba(255, 87, 51, .28);
  color: var(--text-1);
}

.cat-tab.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.foods-scroll {
  display: flex;
  gap: 8px;
  padding: 2px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.food-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--t);
}

.food-thumb:hover {
  transform: translateY(-2px);
}

.thumb-img-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, .04);
  position: relative;
  transition: var(--t);
}

.food-thumb.selected .thumb-img-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.thumb-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.food-thumb:hover .thumb-img-wrap img {
  transform: scale(1.07);
}

.thumb-selected-ring {
  position: absolute;
  inset: 0;
  background: rgba(255, 87, 51, .14);
  opacity: 0;
  transition: var(--t);
}

.food-thumb.selected .thumb-selected-ring {
  opacity: 1;
}

.thumb-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-thumb.selected .thumb-name {
  color: var(--accent);
}

/* model gölge halkası */
#model-glow {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  width: min(160px, 40vw);
  height: min(24px, 6vw);
  background: radial-gradient(ellipse, rgba(255, 87, 51, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 4;
  display: none;
  pointer-events: none;
}



/* ── Modal ── */
#food-model-viewer {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Kesin merkezleme */
  width: 100vw;
  height: 50vh;
  background: transparent;
  --poster-color: transparent;
  z-index: 5;
  display: none;
  /* activateModel() içinde açılır */
  pointer-events: auto;
  /* Geniş dokunmatik alan */
}

#food-model-viewer::part(default-progress-bar) {
  display: none;
}

#food-model-viewer::part(default-ar-button) {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  background: rgba(10, 10, 20, .97);
  border-top: 1px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 18px 40px;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-close {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg-glass);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--t);
}

.modal-close:hover {
  background: var(--bg-glass-md);
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 54px);
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all .26s;
  white-space: nowrap;
  box-shadow: 0 4px 18px var(--accent-glow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animasyon ── */
.food-change-enter {
  animation: cardPop .32s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes cardPop {
  from {
    opacity: .4;
    transform: translateY(6px) scale(.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}