/**
 * PegaiPOS — Müşteri yüzeyi (QR menü, sepet, ödeme)
 * Apple Liquid Glass — design-system token alias'ları + dark
 * Not: dsCustomerStylesheetTag design-system.css'i önce yükler.
 */

:root {
  --cust-bg: transparent;
  --cust-mesh: var(--glass-mesh);
  --cust-surface: var(--material-surface);
  --cust-surface-solid: var(--material-elevated);
  --cust-surface-chrome: var(--material-chrome);
  --cust-surface-floating: var(--material-floating);
  --cust-text: var(--text);
  --cust-text-2: var(--text-secondary);
  --cust-text-3: var(--text-tertiary);
  --cust-separator: var(--separator);
  --cust-glass-border: var(--glass-border-outer);
  --cust-fill: var(--menu-accent, var(--fill-primary));
  --cust-fill-hover: var(--menu-accent, var(--fill-primary-hover));
  --cust-on-fill: var(--on-fill-primary);
  --cust-tint: var(--menu-accent, var(--tint));
  --cust-radius: var(--radius-lg);
  --cust-radius-lg: var(--radius-xl);
  --cust-radius-full: var(--radius-full);
  --cust-shadow: var(--glass-shadow-sm);
  --cust-font: var(--font-body);
  --cust-max: 430px;
  --cust-blur: var(--glass-blur);
  --cust-saturate: var(--glass-saturate);
  --cust-filter: var(--glass-filter);
  --cust-muted: var(--bg-muted);
  --cust-border: var(--border);
  --cust-placeholder: var(--text-placeholder);
}

/* Fallback when design-system not loaded (safety) */
@supports not (color: var(--glass-surface)) {
  :root {
    --cust-mesh:
      radial-gradient(ellipse 90% 60% at 10% 5%, var(--tint-soft), transparent 55%),
      radial-gradient(ellipse 70% 50% at 92% 8%, rgba(175, 82, 222, 0.1), transparent 50%),
      linear-gradient(160deg, #e6ecf8 0%, #f2f2f7 42%, #ece6f4 100%);
    --cust-surface: rgba(255, 255, 255, 0.55);
    --cust-surface-solid: rgba(255, 255, 255, 0.78);
    --cust-text: var(--gray-900);
    --cust-fill: #1d1d1f;
    --cust-blur: 20px;
  }
}

[data-theme="dark"] {
  --cust-mesh: var(--glass-mesh);
  --cust-surface: var(--material-surface);
  --cust-surface-solid: var(--material-elevated);
  --cust-surface-chrome: var(--material-chrome);
  --cust-surface-floating: var(--material-floating);
  --cust-text: var(--text);
  --cust-text-2: var(--text-secondary);
  --cust-text-3: var(--text-tertiary);
  --cust-separator: var(--separator);
  --cust-glass-border: var(--glass-border-outer);
  --cust-fill: var(--menu-accent, var(--fill-primary));
  --cust-fill-hover: var(--menu-accent, var(--fill-primary-hover));
  --cust-on-fill: var(--on-fill-primary);
  --cust-shadow: var(--glass-shadow-sm);
  --cust-filter: var(--glass-filter);
  --cust-muted: var(--bg-muted);
  --cust-border: var(--border);
  --cust-placeholder: var(--text-placeholder);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body.cust-app,
body {
  font-family: var(--cust-font);
  background: var(--cust-bg);
  color: var(--cust-text);
  min-height: 100vh;
  max-width: var(--cust-max);
  margin: 0 auto;
  line-height: 1.47;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  isolation: isolate;
}
body.cust-app::before,
body:has(.menu-header)::before,
body:has(.sepet-header)::before,
body:has(.odeme-header)::before,
body:has(.top-bar)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  max-width: var(--cust-max);
  margin: 0 auto;
  background: var(--cust-mesh);
  background-attachment: fixed;
  pointer-events: none;
}

/* ── Üst bar (cam) ── */
.cust-topbar,
.menu-header,
.sepet-header,
.odeme-header,
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cust-surface-chrome);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  border-bottom: 1px solid var(--cust-glass-border);
  box-shadow: var(--cust-shadow);
}

/* ── Kartlar: buzlu cam ── */
.cust-card,
.restoran-kart,
.urun-kart,
.sepet-item,
.odeme-kart,
.menu-section {
  background: var(--cust-surface);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  border: 1px solid var(--cust-glass-border);
  border-radius: var(--cust-radius-lg);
  box-shadow: var(--cust-shadow);
  transition:all var(--transition-fast);
}
.urun-kart:active,
.restoran-kart:active {
  transform: scale(0.98);
}

/* ── Birincil CTA ── */
.cust-btn-primary,
.modal-sepet-btn,
.sepet-alt-bar-btn,
.btn-devam,
.btn-onayla,
.yorum-submit-btn,
.terms-btn-acc,
.kamp-popup-btn,
.otp-dogrula-btn,
.onay-tamam,
.onay-btn-onayla,
.modal-btn-full {
  background: var(--cust-fill) !important;
  color: var(--cust-on-fill) !important;
  border: none !important;
  border-radius: var(--cust-radius) !important;
  font-weight: 600 !important;
  font-family: var(--cust-font) !important;
  letter-spacing: -0.01em;
  transition:all var(--transition-fast);
  box-shadow: none !important;
}
.cust-btn-primary:active,
.modal-sepet-btn:active,
.btn-devam:active,
.btn-onayla:active {
  background: var(--cust-fill-hover) !important;
  transform: scale(0.98);
}

/* ── İkincil buton ── */
.cust-btn-secondary,
.terms-btn-ret,
.onay-vazgec,
.onay-btn-iptal {
  background: var(--cust-surface) !important;
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  color: var(--cust-text) !important;
  border: 1px solid var(--cust-glass-border) !important;
  box-shadow: var(--cust-shadow) !important;
  border-radius: var(--cust-radius) !important;
  font-weight: 600 !important;
}

/* ── Girdiler ── */
.cust-input,
.yf-input,
.fi, .fs,
.not-textarea,
.lang-drawer-search input,
.otp-inp {
  border: 1px solid var(--cust-glass-border) !important;
  background: var(--cust-surface) !important;
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  box-shadow: var(--glass-inset) !important;
  border-radius: var(--cust-radius) !important;
  font-family: var(--cust-font) !important;
  font-size: 16px !important;
  color: var(--cust-text) !important;
  transition:all var(--transition-fast);
}
.cust-input:focus,
.yf-input:focus,
.fi:focus, .fs:focus,
.not-textarea:focus,
.otp-inp:focus {
  outline: none !important;
  background: var(--cust-surface-solid) !important;
  border-color: var(--cust-tint) !important;
  box-shadow: var(--glass-inset), 0 0 0 3px var(--tint-soft) !important;
}

/* ── Kategori şeridi ── */
.cat-bar {
  background: var(--cust-surface);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  border-bottom: 1px solid var(--cust-glass-border);
  box-shadow: var(--cust-shadow);
}
.cat-btn {
  font-weight: 500;
  color: var(--cust-text-3);
  border-bottom-width: 2px;
  transition:all var(--transition-fast);
}
.cat-btn.aktif,
.cat-btn.active {
  color: var(--cust-text);
  border-bottom-color: var(--cust-fill);
  font-weight: 600;
}

/* ── Alt bar (sepet) ── */
.sepet-alt-bar,
.menu-alt-bar {
  background: var(--cust-surface-chrome);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  border-top: 1px solid var(--cust-glass-border);
  box-shadow: var(--glass-shadow);
}

/* ── Masa servis butonları ── */
.masa-servis-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 52px;
  border: none;
  border-radius: var(--cust-radius);
  background: var(--cust-muted);
  color: var(--cust-text);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.masa-servis-btn svg { opacity: 0.85; }
.masa-servis-btn:active { transform: scale(0.98); }
.masa-servis-btn.primary {
  background: var(--cust-fill);
  color: var(--cust-on-fill);
}

/* ── Toast ── */
#menuToast,
.menu-toast {
  background: var(--cust-fill, var(--fill-primary));
  color: var(--cust-on-fill, var(--on-fill-primary));
  border-radius: var(--cust-radius-full, var(--radius-full));
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 10050;
}

/* ── Modal / drawer ── */
.modal-overlay,
.drawer-overlay {
  background: var(--scrim);
  backdrop-filter: var(--glass-filter-sm);
}
.modal-box,
.menu-drawer,
.lang-drawer {
  background: var(--cust-surface-solid);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  border: 1px solid var(--cust-glass-border);
  border-radius: var(--cust-radius-lg) var(--cust-radius-lg) 0 0;
  box-shadow: var(--glass-shadow);
}

/* ── Fiyat vurgusu ── */
.urun-fiyat,
.sepet-toplam,
.odeme-toplam {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* ── Boş durum ── */
.cust-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--cust-text-3);
}
.cust-empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cust-text);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
}
button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}


/* Elevated glass surfaces (payment/menu cards that used solid) */
.section,
.ozet-section,
.info-card,
.product-item,
.cat-nav,
.tt-opt,
.odeme-opt,
.masa-kart,
.alt-bar,
.modal-box,
.onay-modal-box,
.sosyal-popup-box,
.menu-drawer-box,
.sheet-box,
.sheet-head,
.modal-footer,
.review-badge,
.google-review-btn,
.h-status,
.konum-izin-btn {
  background: var(--cust-surface-solid);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
}
.alt-bar,
.sepet-alt-bar,
.menu-alt-bar {
  background: var(--cust-surface-chrome);
  backdrop-filter: var(--cust-filter);
  -webkit-backdrop-filter: var(--cust-filter);
  box-shadow: var(--glass-shadow-sm);
}
