/* ========================================================
   AN THỊNH TECH - POS & BÁN HÀNG STYLES
   Chuyên nghiệp - Tối ưu POS thu ngân & In ấn K80 / A4
   ======================================================== */

:root {
  --primary: #0F172A;
  --primary-deep: #080D1A;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --success: #16A34A;
  --warning: #EA580C;
  --danger: #DC2626;
  --sidebar-w: 240px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Toast Container */
#pos-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.pos-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  min-width: 280px;
  max-width: 400px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.pos-toast.fade-out {
  transform: translateX(100%);
  opacity: 0;
}

/* POS Product Card Hover */
.product-card {
  transition: all 0.18s ease-in-out;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.08);
}
.product-card:active {
  transform: scale(0.98);
}

/* Tab Active Styles */
.nav-tab.active {
  background: #2563EB;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Modal Backdrop */
.pos-modal-backdrop {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

/* Tab Order Pills */
.order-tab.active {
  background-color: #2563EB;
  color: #ffffff;
  border-color: #2563EB;
}

/* ========================================================
   PRINTING STYLES (IN HÓA ĐƠN K80 & A4)
   ======================================================== */
@media screen {
  #print-bill-container {
    display: none;
  }
}

@media print {
  /* Hide everything on screen except print container */
  body * {
    visibility: hidden;
  }
  
  #print-bill-container, #print-bill-container * {
    visibility: visible;
  }

  #print-bill-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  }

  /* K80 Receipt Formatting (80mm width) */
  .receipt-k80 {
    width: 78mm !important;
    max-width: 78mm !important;
    margin: 0 auto;
    padding: 2mm 3mm;
    font-size: 11px;
    line-height: 1.35;
    color: #000;
  }

  .receipt-k80 .receipt-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }

  .receipt-k80 .receipt-title {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 4px 0;
  }

  .receipt-k80 .receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 10.5px;
  }

  .receipt-k80 .receipt-table th {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 4px 0;
    text-align: left;
  }

  .receipt-k80 .receipt-table td {
    padding: 3px 0;
    vertical-align: top;
  }

  .receipt-k80 .receipt-totals {
    border-top: 1px dashed #000;
    padding-top: 5px;
    margin-top: 5px;
  }

  .receipt-k80 .receipt-footer {
    text-align: center;
    border-top: 1px dashed #000;
    padding-top: 6px;
    margin-top: 8px;
    font-size: 10px;
  }

  /* A4 / A5 Invoice Formatting */
  .receipt-a4 {
    width: 100% !important;
    max-width: 210mm !important;
    margin: 0 auto;
    padding: 15mm;
    font-size: 13px;
    line-height: 1.5;
    color: #000;
  }

  .receipt-a4 table {
    width: 100%;
    border-collapse: collapse;
  }

  .receipt-a4 table th, .receipt-a4 table td {
    border: 1px solid #475569;
    padding: 8px 10px;
  }

  .receipt-a4 table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  @page {
    margin: 5mm;
  }
}
