/**
 * CSS DESIGN SYSTEM POS TERAS FOODIES
 * Responsif Layar Tablet & Smartphone PWA
 */

:root {
  /* PALET WARNA IDENTITAS TERAS FOODIES */
  --color-primary: #E03E1A;
  --color-primary-hover: #C43212;
  --color-primary-light: #FFF1EE;
  --color-accent: #D97706;
  --color-accent-light: #FEF3C7;
  
  /* STATUS */
  --color-success: #059669;
  --color-success-light: #ECFDF5;
  --color-warning: #D97706;
  --color-danger: #DC2626;
  --color-info: #2563EB;

  /* MODE TERANG (DEFAULT KASIR) */
  --bg-app: #F8F9FA;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F3F5;
  --border-color: #E5E7EB;
  --border-focus: #E03E1A;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;

  /* ELEVASI & BAYANGAN */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);

  /* RADIUS */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 9999px;

  /* TIPOGRAFI */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', Menlo, monospace;
}

[data-theme="dark"] {
  --bg-app: #121316;
  --bg-surface: #1A1C22;
  --bg-surface-elevated: #23262F;
  --border-color: #2D3139;
  --border-focus: #E03E1A;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --color-primary-light: #2A1815;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Scroll mandiri di dalam panel katalog dan panel keranjang */
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

input, select {
  font-family: inherit;
  outline: none;
}

.font-mono {
  font-family: var(--font-mono);
}

/* HEADER APLIKASI */
.app-header {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), #991B1B);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 22px;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.status-online {
  background: var(--color-success-light);
  color: var(--color-success);
}

.status-online::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--color-success);
  border-radius: 50%;
  display: inline-block;
}

.status-offline {
  background: #FEF3C7;
  color: #B45309;
}

.status-offline::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #B45309;
  border-radius: 50%;
  display: inline-block;
}

.pending-badge {
  background: #F59E0B;
  color: #FFF;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  display: none;
}

.header-btn {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.header-btn:hover {
  background: var(--border-color);
}

.header-btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
}

.header-btn-install {
  background: var(--color-primary);
  color: #FFF;
  border-color: var(--color-primary);
  display: none;
}

.header-btn-install:hover {
  background: var(--color-primary-hover);
}

/* LAYOUT POS UTAMA (SPLIT SCREEN TABLET) */
.pos-layout-container {
  display: flex;
  flex: 1;
  height: calc(100dvh - 64px);
  overflow: hidden;
}

/* KOLOM KIRI: MENU KATALOG */
.pos-catalog-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

/* SEARCH & TOP BAR */
.catalog-top-bar {
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 18px;
}

.search-input-box input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.search-input-box input:focus {
  border-color: var(--color-primary);
  background: var(--bg-surface);
}

/* KATEGORI HORIZONTAL TABS (SCROLLABLE TABLET) */
.category-tabs-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  gap: 8px;
  scrollbar-width: none;
}

.category-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.cat-tab-btn {
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.cat-tab-btn:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.cat-tab-btn.active {
  background: var(--color-primary);
  color: #FFF;
  border-color: var(--color-primary);
}

/* GRID MENU CARDS */
.menu-grid-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.menu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.menu-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.menu-card:active {
  transform: scale(0.98);
}

.menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.menu-category-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.badge-dimsum { background: #FEE2E2; color: #991B1B; }
.badge-drink { background: #E0E7FF; color: #3730A3; }
.badge-noodle { background: #FEF3C7; color: #92400E; }
.badge-snack { background: #FFEDD5; color: #9A3412; }
.badge-birthday { background: #FCE7F3; color: #9D174D; }

.menu-variant-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.menu-card-body {
  margin-bottom: 12px;
}

.menu-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}

.menu-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 4px;
}

.menu-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.menu-card-price {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-primary);
}

.btn-add-quick {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.btn-add-quick:hover {
  background: var(--color-primary-hover);
}

/* KOLOM KANAN: KERANJANG PESANAN KASIR */
.pos-cart-panel {
  width: 380px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -2px 0 8px rgba(0,0,0,0.03);
}

.cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-title {
  font-size: 16px;
  font-weight: 700;
}

.cart-badge-count {
  background: var(--color-primary);
  color: #FFF;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.btn-cart-clear {
  font-size: 12px;
  color: var(--color-danger);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.btn-cart-clear:hover {
  background: var(--color-danger-light);
}

/* PILIHAN TIPE PESANAN (DINE-IN / TAKEAWAY / WA) */
.order-type-selector {
  padding: 8px 16px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.order-type-chip {
  flex: 1;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-color);
}

.order-type-chip.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}

/* DAFTAR ITEM KERANJANG */
.cart-items-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 12px;
}

.cart-item-row {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-color);
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cart-item-variant {
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.cart-item-note {
  font-size: 11px;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 2px;
}

.btn-qty {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-number {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.cart-item-subtotal {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.btn-item-note {
  color: var(--text-secondary);
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
}

.btn-item-note:hover {
  color: var(--color-primary);
}

/* FOOTER RINGKASAN & TOMBOL BAYAR */
.cart-footer-panel {
  padding: 14px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
  flex-shrink: 0;
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cart-grand-total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 0 14px 0;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.total-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.total-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-primary);
}

.btn-checkout-main {
  width: 100%;
  height: 54px;
  background: var(--color-primary);
  color: #FFF;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(224, 62, 26, 0.3);
}

.btn-checkout-main:disabled {
  background: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-checkout-main:not(:disabled):hover {
  background: var(--color-primary-hover);
}

/* FLOATING CART BAR (KHUSUS SMARTPHONE / SMALL TABLET) */
.floating-cart-bar {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: 60px;
  background: var(--color-primary);
  color: #FFF;
  border-radius: var(--radius-lg);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

/* MODAL UMUM */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.modal-open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalPop 0.18s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
}

.modal-close-btn {
  font-size: 24px;
  color: var(--text-muted);
}

.modal-close-btn:hover {
  color: var(--color-danger);
}

.modal-body {
  padding: 20px;
}

/* MODAL PEMBAYARAN (CHECKOUT) */
.checkout-amount-display {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}

.checkout-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.checkout-val {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-primary);
  margin-top: 4px;
}

.payment-method-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pay-method-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pay-method-btn.active {
  background: var(--color-primary);
  color: #FFF;
  border-color: var(--color-primary);
}

.quick-cash-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.btn-quick-cash {
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.btn-quick-cash:hover {
  border-color: var(--color-primary);
}

.cash-input-field {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  padding: 0 16px;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: var(--bg-surface);
  margin-bottom: 14px;
}

.cash-input-field:focus {
  border-color: var(--color-primary);
}

.change-display-box {
  background: var(--color-success-light);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.change-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-success);
}

.change-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--color-success);
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-primary {
  height: 48px;
  padding: 0 24px;
  background: var(--color-primary);
  color: #FFF;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  height: 48px;
  padding: 0 18px;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* REKAPAN PENJUALAN DASHBOARD */
.recap-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 2px 0;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.recap-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recap-table-container {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.recap-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.recap-item-row:last-child {
  border-bottom: none;
}

.recap-item-name {
  font-weight: 600;
  flex: 1;
}

.recap-item-qty {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-primary);
  width: 70px;
  text-align: right;
}

.recap-item-omzet {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 100px;
  text-align: right;
}

.recap-footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* CUSTOM FLOATING TOASTS */
.tf-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.tf-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(-20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tf-toast-show {
  transform: translateY(0);
  opacity: 1;
}

.tf-toast-hide {
  transform: translateY(-10px);
  opacity: 0;
}

.tf-toast-success { border-left: 4px solid var(--color-success); }
.tf-toast-danger { border-left: 4px solid var(--color-danger); }
.tf-toast-warning { border-left: 4px solid var(--color-warning); }
.tf-toast-info { border-left: 4px solid var(--color-info); }

.tf-toast-message {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.tf-toast-close {
  color: var(--text-muted);
  font-size: 18px;
}

/* SWEETALERT2 CUSTOM THEMING TERAS FOODIES */
.swal2-tf-popup {
  border-radius: 20px !important;
  font-family: var(--font-sans) !important;
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color) !important;
}

.swal2-tf-title {
  color: var(--text-primary) !important;
  font-weight: 800 !important;
}

.swal2-tf-btn-primary {
  background: var(--color-primary) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  padding: 12px 24px !important;
}

.swal2-tf-btn-danger {
  background: var(--color-danger) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
}

.swal2-tf-btn-secondary {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-secondary) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
}

.swal2-tf-btn-whatsapp {
  background: #25D366 !important;
  color: #FFF !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  padding: 12px 24px !important;
}

/* SPINNER LOADING */
.tf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.menu-loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* STRUK PRINT THERMAL ONLY */
#thermal-receipt-print-area {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #thermal-receipt-print-area, #thermal-receipt-print-area * {
    visibility: visible;
  }
  #thermal-receipt-print-area {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 58mm;
    margin: 0;
    padding: 2mm;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #000;
  }
  .receipt-header {
    text-align: center;
    margin-bottom: 6px;
  }
  .receipt-header h3 {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 2px;
  }
  .receipt-header p {
    font-size: 10px;
  }
  .receipt-divider {
    text-align: center;
    font-size: 10px;
    margin: 4px 0;
  }
  .receipt-meta {
    font-size: 10px;
    margin-bottom: 4px;
  }
  .receipt-item-line {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 2px;
  }
  .receipt-item-note {
    font-size: 9px;
    font-style: italic;
    padding-left: 8px;
  }
  .calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 2px;
  }
  .total-bold {
    font-size: 13px;
    font-weight: bold;
    margin: 4px 0;
  }
  .receipt-footer {
    text-align: center;
    font-size: 10px;
    margin-top: 6px;
  }
}

/* TABLET PORTRAIT (768px - 991px, Contoh: iPad Mini, iPad Air Portrait) */
@media (min-width: 768px) and (max-width: 991px) {
  .pos-layout-container {
    height: calc(100dvh - 64px);
    overflow: hidden;
    display: flex;
    flex-direction: row;
  }

  .pos-catalog-panel {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
  }

  .menu-grid-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .menu-card {
    padding: 10px;
    min-height: 135px;
  }

  .menu-card-title {
    font-size: 13.5px;
    margin-bottom: 2px;
  }

  .menu-card-price {
    font-size: 14px;
  }

  .pos-cart-panel {
    width: 310px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: static;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
  }

  .cart-items-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cart-footer-panel {
    flex-shrink: 0;
    padding: 10px 12px;
  }

  .cart-grand-total-line {
    margin: 6px 0 10px 0;
  }

  .total-val {
    font-size: 20px;
  }

  .btn-checkout-main {
    height: 48px;
    font-size: 14px;
  }

  .floating-cart-bar {
    display: none !important;
  }

  .btn-close-mobile-cart {
    display: none !important;
  }
}

/* SMARTPHONE & SMALL SCREEN (< 768px) */
@media (max-width: 767px) {
  body {
    overflow-y: auto;
  }

  .pos-layout-container {
    height: auto;
    min-height: calc(100dvh - 64px);
    flex-direction: column;
    padding-bottom: 84px;
    overflow: visible;
  }

  .pos-catalog-panel {
    border-right: none;
    overflow: visible;
  }

  .menu-grid-scroll-area {
    overflow: visible;
    padding: 12px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .pos-cart-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    width: 100%;
    height: 85dvh;
    border-radius: 20px 20px 0 0;
    z-index: 80;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
    transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .pos-cart-panel.mobile-cart-open {
    bottom: 0;
  }

  .floating-cart-bar {
    display: flex;
  }

  .btn-close-mobile-cart {
    display: inline-flex !important;
  }

  .recap-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}
