/* ==========================================================================
   WEB POS - ASOSIY STILLAR VA TERMOPRINTER QOIDALARI
   ========================================================================== */

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

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --success-color: #10b981;
  --success-hover: #059669;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom zamonaviy scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Kategoriya gorizontal skroli uchun */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Mahsulot kartochkasi hover animatsiyasi */
.product-card {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.product-card:hover:not(.out-of-stock) {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

.product-card:active:not(.out-of-stock) {
  transform: scale(0.98);
}

/* Omborda qolmagan tovarlar uchun */
.product-card.out-of-stock {
  opacity: 0.55;
  filter: grayscale(85%);
  cursor: not-allowed;
  position: relative;
}

/* Beep / Bosilgandagi yorqinlik effekti */
@keyframes quickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.cart-item-added {
  animation: quickPulse 0.2s ease-in-out;
}

/* Spinner animatsiyasi */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin-custom {
  animation: spin 0.8s linear infinite;
}

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

.toast {
  pointer-events: auto;
  transition: all 0.25s ease-out;
  transform: translateX(100%);
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Monospace raqamlar */
.font-mono-numbers {
  font-family: 'JetBrains Mono', monospace;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TERMOPRINTER (80mm / 58mm) VA CHEK CHOP ETISH QOIDALARI (@media print)
   ========================================================================== */

#receipt-print-area {
  display: none;
}

@media print {
  /* Brauzerning standart sarlavha va sanalarini olib tashlash */
  @page {
    margin: 0;
    size: auto;
  }

  /* Butun sahifadagi elementlarni yashirish */
  body * {
    visibility: hidden;
  }

  /* Faqat va faqat chek qismini ko'rsatish */
  #receipt-print-area, #receipt-print-area * {
    visibility: visible;
  }

  #receipt-print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 80mm;
    margin: 0 auto;
    padding: 4mm 6mm;
    background: #ffffff;
    color: #000000;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.35;
  }

  /* 58mm termoprinterlar uchun avtomatik moslashuv */
  .receipt-58mm #receipt-print-area {
    max-width: 58mm;
    font-size: 9.5px;
    padding: 2mm 3mm;
  }

  /* Chek ichidagi sarlavha va ajratgichlar */
  .receipt-header {
    text-align: center;
    margin-bottom: 6px;
  }

  .receipt-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 2px;
  }

  .receipt-divider {
    border-top: 1px dashed #000000;
    margin: 6px 0;
  }

  .receipt-double-divider {
    border-top: 1px double #000000;
    border-bottom: 1px double #000000;
    height: 3px;
    margin: 6px 0;
  }

  .receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
  }

  .receipt-table th {
    text-align: left;
    border-bottom: 1px dashed #000000;
    padding-bottom: 3px;
    font-size: 10px;
  }

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

  .receipt-row-flex {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
  }

  .receipt-bold {
    font-weight: 700;
  }

  .receipt-total-large {
    font-size: 13px;
    font-weight: 800;
  }

  .receipt-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 10px;
  }

  .receipt-barcode {
    text-align: center;
    margin-top: 8px;
    letter-spacing: 2px;
  }
}


/* ==========================================================================
   TOUCH SCREEN / POS MONOBLOK VA TERMINAL MOSLASHUVI
   ========================================================================== */
html, body {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* Matn tanlanib qolishini oldini olish (Barmoq bilan tez bosganda) */
button, 
.category-pill, 
.product-card, 
.btn-quick-staff, 
.btn-quick-reason, 
.btn-expense-num, 
.btn-cash-num, 
.btn-qty-num, 
.btn-qty-chip, 
.btn-quick-discount, 
.btn-quick-cash, 
.btn-qty-minus, 
.btn-qty-plus {
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Touch tugmalar bosilgandagi yumshoq tebranish va bosilish effekti */
.btn-expense-num:active, 
.btn-cash-num:active, 
.btn-qty-num:active, 
.btn-qty-chip:active, 
.btn-quick-cash:active, 
.btn-quick-discount:active, 
.btn-quick-staff:active, 
.btn-quick-reason:active {
  transform: scale(0.94);
  transition: transform 0.06s ease;
}

/* Sensor ekranlarda skroll silliqligi */
.overflow-x-auto, .overflow-y-auto {
  -webkit-overflow-scrolling: touch;
}
