:root {
  --bg-primary: #0a0e17;
  --bg-surface: #121927;
  --bg-surface-elevated: #1a2336;
  --bg-card: rgba(22, 31, 49, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --color-brand: #10b981;
  --color-brand-glow: rgba(16, 185, 129, 0.25);
  --color-gold: #f59e0b;
  --color-revolut: #0075eb;
  --color-simplepay: #ff6f00;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 90px;
}

/* Glassmorphism Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 0 15px var(--color-brand-glow);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-switcher {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--color-brand);
  color: #042f2e;
}

.table-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-accent);
  color: var(--color-brand);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.table-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-brand);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Category Filter Bar */
.category-nav {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem 0.5rem 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-chip {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cat-chip.active {
  background: var(--color-brand);
  color: #042f2e;
  font-weight: 700;
  border-color: var(--color-brand);
  box-shadow: 0 0 12px var(--color-brand-glow);
}

/* Menu Grid */
.menu-container {
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 640px;
  margin: 0 auto;
}

.dish-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dish-card:active {
  transform: scale(0.99);
}

.dish-thumb {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface-elevated);
}

.dish-info {
  flex: 1;
  min-width: 0;
}

.dish-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.dish-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.dish-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dish-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-brand);
}

.vat-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.35rem;
}

/* Quantity Button */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  padding: 2px;
  border: 1px solid var(--border-subtle);
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn.add {
  background: var(--color-brand);
  color: #042f2e;
}

.qty-count {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* Sticky Bottom Cart Bar */
.bottom-cart-bar {
  position: fixed;
  bottom: 1rem;
  left: 1.25rem;
  right: 1.25rem;
  max-width: 600px;
  margin: 0 auto;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #042f2e;
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(120px);
}

.bottom-cart-bar.visible {
  transform: translateY(0);
}

.cart-bar-info {
  display: flex;
  flex-direction: column;
}

.cart-bar-count {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.cart-bar-total {
  font-size: 1.2rem;
  font-weight: 900;
}

.cart-bar-action {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Slide-up Bottom Sheet Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

.modal-sheet {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  margin: 0 auto 1.25rem auto;
  opacity: 0.4;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sheet-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.close-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tip Selector */
.tip-section {
  margin: 1.25rem 0;
}

.tip-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.tip-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.tip-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.6rem 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.tip-btn.active {
  background: var(--color-gold);
  color: #451a03;
  border-color: var(--color-gold);
}

/* Order Summary Box */
.summary-box {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.summary-row.total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

/* Payment Methods Grid */
.payment-methods-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.pay-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pay-card:hover {
  border-color: var(--border-accent);
}

.pay-card-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pay-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.pay-icon.qvik { background: #10b981; color: white; }
.pay-icon.revolut { background: #0075eb; color: white; }
.pay-icon.simplepay { background: #ff6f00; color: white; }

.pay-title { font-weight: 700; font-size: 0.95rem; }
.pay-subtitle { font-size: 0.75rem; color: var(--text-muted); }

/* QR Code Display for qvik */
.qvik-modal-content {
  text-align: center;
  padding: 1rem 0;
}

.qr-frame {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 1rem auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.qr-code-svg {
  width: 220px;
  height: 220px;
  display: block;
}

.action-btn {
  width: 100%;
  background: var(--color-brand);
  color: #042f2e;
  border: none;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.action-btn:hover { filter: brightness(1.1); }
.action-btn.secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

/* Success View */
.success-card {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--color-brand);
  color: var(--color-brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.25rem auto;
  animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Kitchen Display Grid */
.kds-container {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.kds-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kds-header {
  padding: 0.85rem 1rem;
  background: var(--bg-surface-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.kds-table-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.kds-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kds-body {
  padding: 1rem;
  flex: 1;
}

.kds-item-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.kds-item-qty {
  font-weight: 800;
  color: var(--color-brand);
  margin-right: 0.5rem;
}

.kds-footer {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 0.5rem;
}

.kds-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.status-received { background: #3b82f6; color: white; }
.status-preparing { background: #f59e0b; color: white; }
.status-ready { background: #10b981; color: white; }
.status-served { background: #64748b; color: white; }
