/* =========================================================================
   SISTEMA DE DISEÑO PWA: GASTRO-NFC
   Aestética: Cyber-Bistrot / Dark Glassmorphism de Alta Fidelidad
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 29, 44, 0.75);
  --bg-card-hover: rgba(30, 40, 60, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #f97316;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #090d16;

  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.35);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--accent-orange-glow);

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(249, 115, 22, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
}

/* App Header & Top Navigation */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 12px var(--accent-orange-glow);
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  color: var(--accent-orange);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.role-diner {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.role-badge.role-waiter {
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.role-badge.role-admin {
  background: rgba(168, 85, 247, 0.18);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* Banner de Mesa */
.table-indicator-card {
  margin: 16px 20px 8px 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
}

.table-info h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.table-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.crypto-secure-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Main Container */
.container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 100px 20px;
  flex: 1;
}

/* Quick Action Bar for Diners / Waiters */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

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

.btn-action.highlight {
  border-color: var(--accent-orange);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.15) 0%, rgba(22, 29, 44, 0.8) 100%);
}

.btn-action svg {
  width: 22px;
  height: 22px;
}

/* Menu Grid */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

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

.dish-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.dish-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.dish-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.dish-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.dish-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-orange);
  font-size: 1.05rem;
}

.dish-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.dish-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* Quantity Selector & Add Button */
.qty-selector {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.qty-value {
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-orange), #ea580c);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px var(--accent-orange-glow);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

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

/* Floating Bottom Bar (Cart / Active Order Status) */
.floating-bottom-bar {
  position: fixed;
  bottom: 16px;
  left: 20px;
  right: 20px;
  max-width: 860px;
  margin: 0 auto;
  z-index: 40;
  background: rgba(18, 24, 36, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(249, 115, 22, 0.4);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.floating-cart-summary {
  display: flex;
  flex-direction: column;
}

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

.cart-total {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

/* Modal Windows & Drawers */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #141b29;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-orange);
}

/* Waiter & Admin Order Status Pills */
.status-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.status-pill.status-preparing {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.status-pill.status-delivered {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.status-pill.status-paid {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

/* Animations */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

.pulse-target {
  animation: pulseGlow 2s infinite;
}
