/* ══════════════════════════════════════════════
   Header / Navigation
   ══════════════════════════════════════════════ */
.header {
  display: flex;
  gap: var(--gap-md);
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-md) var(--gap-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
}
.brand__logo {
  height: 38px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.brand b {
  font-size: var(--font-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
  display: block;
}
.brand span {
  font-size: var(--font-sm);
  color: var(--muted);
  display: block;
}

/* ══════════════════════════════════════════════
   Pills / Tabs
   ══════════════════════════════════════════════ */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border);
  background: rgba(20, 20, 26, 0.8);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--border-light);
  background: rgba(30, 30, 40, 0.9);
}
.pill.active {
  border-color: var(--accent-border);
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 166, 71, 0.06);
}

/* ══════════════════════════════════════════════
   Cards
   ══════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--gap-lg);
  box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 650;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: rgba(26, 26, 34, 0.9);
  color: var(--text);
  transition: all var(--duration) var(--ease-out);
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: rgba(36, 36, 46, 1); }
.btn:active { transform: scale(0.97); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border-color: var(--accent-border);
  background: linear-gradient(135deg, rgba(212,166,71,0.2), rgba(212,166,71,0.08));
  box-shadow: 0 0 0 3px rgba(212,166,71,0.06), var(--shadow-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(212,166,71,0.3), rgba(212,166,71,0.12));
}

.btn-success {
  border-color: rgba(92,224,155,0.45);
  background: linear-gradient(135deg, rgba(92,224,155,0.15), rgba(92,224,155,0.05));
}
.btn-success:hover {
  background: linear-gradient(135deg, rgba(92,224,155,0.25), rgba(92,224,155,0.1));
}

.btn-danger {
  border-color: rgba(240,101,101,0.45);
  background: linear-gradient(135deg, rgba(240,101,101,0.15), rgba(240,101,101,0.05));
}
.btn-danger:hover {
  background: linear-gradient(135deg, rgba(240,101,101,0.25), rgba(240,101,101,0.1));
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  min-height: 56px;
  padding: 14px 24px;
  font-size: var(--font-lg);
  font-weight: 800;
  border-radius: var(--radius-lg);
}

/* ══════════════════════════════════════════════
   Inputs
   ══════════════════════════════════════════════ */
.input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  outline: none;
  transition: border-color var(--duration) var(--ease-out);
}
.input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(212,166,71,0.06);
}
.input::placeholder { color: var(--muted); }
.input.error {
  border-color: rgba(240,101,101,0.6);
  animation: shake 0.3s ease;
}

textarea.input {
  min-height: 70px;
  resize: vertical;
}

/* ══════════════════════════════════════════════
   Badges
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-new {
  border-color: rgba(212,166,71,0.5);
  color: var(--accent);
  background: var(--accent-glow);
}
.badge-preparing {
  border-color: rgba(96,165,250,0.5);
  color: var(--info);
  background: var(--info-glow);
}
.badge-ready {
  border-color: rgba(92,224,155,0.5);
  color: var(--success);
  background: var(--success-glow);
}
.badge-canceled {
  border-color: rgba(240,101,101,0.4);
  color: var(--danger);
  background: var(--danger-glow);
}
.badge-paid {
  border-color: rgba(92,224,155,0.4);
  color: var(--success);
}
.badge-unpaid {
  border-color: rgba(240,101,101,0.4);
  color: var(--danger);
}
.badge-soldout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 900;
  padding: 6px 14px;
  background: rgba(0,0,0,0.85);
  color: var(--danger);
  border-color: rgba(240,101,101,0.6);
  z-index: 2;
}

/* ══════════════════════════════════════════════
   Toast
   ══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-weight: 600;
  font-size: var(--font-sm);
  animation: slideInUp 0.3s var(--ease-out);
  pointer-events: auto;
  max-width: min(520px, 92vw);
}
.toast.toast-success { border-color: rgba(92,224,155,0.5); }
.toast.toast-error   { border-color: rgba(240,101,101,0.5); }

/* ══════════════════════════════════════════════
   Modal
   ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 90%;
  animation: slideInUp 0.3s var(--ease-out);
}
.modal h3 {
  font-size: var(--font-xl);
  font-weight: 800;
  margin-bottom: var(--gap-md);
}
.modal-actions {
  display: flex;
  gap: var(--gap-sm);
  justify-content: flex-end;
  margin-top: var(--gap-lg);
}

/* ══════════════════════════════════════════════
   Product Cards (POS)
   ══════════════════════════════════════════════ */
.product-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card-alt);
  transition: all var(--duration) var(--ease-out);
}
.product-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}
.product-card:active {
  transform: scale(0.96);
}
.product-card.sold-out {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.product-card.sold-out:hover {
  transform: none;
  box-shadow: none;
}

.product-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(20, 20, 30, 0.5);
}
.product-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, transparent 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.product-card__name {
  font-weight: 700;
  font-size: 12px;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.product-card__price {
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(212,166,71,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212,166,71,0.3);
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   Cart
   ══════════════════════════════════════════════ */
.cart-line {
  display: flex;
  justify-content: space-between;
  gap: var(--gap-md);
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.cart-line:last-child { border-bottom: none; }
.cart-line__left { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cart-line__name { font-weight: 750; font-size: var(--font-base); }
.cart-line__meta { color: var(--muted); font-size: var(--font-sm); }
.cart-line__price { font-weight: 850; font-size: var(--font-base); white-space: nowrap; }

.qty-row { display: flex; gap: var(--gap-sm); align-items: center; margin-top: 4px; }
.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-input);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  transition: all var(--duration) var(--ease-out);
}
.qty-btn:hover { background: rgba(40,40,50,1); }
.qty-btn:active { transform: scale(0.9); }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border-light);
  font-size: var(--font-xl);
  font-weight: 900;
}

/* ══════════════════════════════════════════════
   Responsive helpers
   ══════════════════════════════════════════════ */
@media (max-width: 700px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .btn { padding: 12px 14px; }
}

/* ══════════════════════════════════════════════
   Fullscreen Toggle
   ══════════════════════════════════════════════ */
.fullscreen-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
  transition: all var(--duration) var(--ease-out);
}
.fullscreen-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}

/* ══════════════════════════════════════════════
   Connection Indicator
   ══════════════════════════════════════════════ */
.conn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  transition: background 0.3s ease;
}
.conn-dot.online { background: var(--success); }
.conn-dot.pending {
  background: var(--warning);
  animation: pulse 1.5s infinite;
}
