/* pos.css - POS page specific styles */

/* Product cards */
.product-card {
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: scale(1.05);
}

.product-card img {
  height: 120px;
  object-fit: cover;
}

/* Cart / Invoice area */
.invoice-box {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #000;
}

.invoice-header {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.invoice-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.info-label {
  font-weight: bold;
  width: 45%;
}

.info-value {
  text-align: right;
  width: 55%;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.product-table th,
.product-table td {
  border-bottom: 1px dashed #000;
  padding: 4px 0;
  text-align: left;
}

.product-table .qty {
  text-align: center;
  width: 40px;
}

.product-table .price {
  text-align: right;
  width: 90px;
}

.totals-table {
  width: 100%;
  margin-top: 10px;
}

.totals-table td {
  padding: 4px 0;
}

.totals-table .label {
  font-weight: bold;
}

.totals-table .value {
  text-align: right;
}

.grand-total {
  font-size: 16px;
  border-top: 2px solid #000;
  padding-top: 8px;
  margin-top: 8px;
}

.thanks {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  font-style: italic;
}

/* General POS layout */
.total-box {
  font-size: 1.5rem;
  font-weight: bold;
}

/* POS Header Custom Color */
.card-header.bg-primary {
  background-color: #79b8b9 !important;
  color: #000000 !important;
}

/* Customer Bill Card */
.customer-bill-card {
  border-top: 3px solid #79b8b9;
}

/* Customer Bill Header */
.customer-bill-header {
  background-color: #79b8b9 !important;
  color: #000 !important;
  font-weight: bold;
}

/* Search input group */
.search-input-group {
  flex: 1;
}

/* Search hint text */
.search-hint {
  font-size: 0.82rem;
  text-align: center;
  color: #6c757d;
  margin-bottom: 1rem;
}

/* Product card styling */
.product-card {
  cursor: pointer;
  overflow: hidden;
}

.product-card-image {
  height: 110px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.product-card-image img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.product-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

.product-card-title {
  height: 38px;
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.product-sku,
.product-barcode {
  font-family: monospace;
  font-size: 0.78rem;
  display: block;
  margin-bottom: 0.25rem;
  color: #6c757d;
}

.product-price {
  font-size: 15px;
  color: #28a745;
  margin-bottom: 0.25rem;
  font-weight: bold;
}

/* Customer Bill Area */
.customer-bill {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  color: #000;
  background: #fff;
}

.customer-info {
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.bill-dashed-line {
  border-top: 1px dashed #000;
  margin: 6px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr 60px 90px 30px;
  gap: 0.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.cart-item.low-stock {
  background-color: #ffe6e6;
  border-left: 3px solid #dc3545;
}

.cart-item-name {
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  font-size: 13px;
}

.cart-item-wrapper {
  min-width: 0;
  flex: 1;
}

.cart-item-warning {
  color: #dc3545;
  font-weight: bold;
  font-size: 11px;
  display: block;
  margin-top: 0.25rem;
}

.cart-item-qty {
  width: 60px;
}

.cart-item-qty input {
  width: 100%;
  text-align: center;
}

.cart-item-total {
  width: 90px;
  text-align: right;
  font-weight: bold;
  font-size: 14px;
  padding-top: 2px;
}

.cart-stock-warning {
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 1rem;
}

.totals-section {
  margin-bottom: 1rem;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
}

.totals-row.subtotal {
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.totals-row.tax {
  color: #666;
}

.totals-row.grand-total {
  border-top: 2px solid #17a2b8;
  padding-top: 0.5rem;
  font-size: 1.25rem;
}

.amount-paid-label {
  font-weight: 600;
  font-size: 13px;
}

.change-display {
  background-color: #f8f9fa;
  border: 2px solid #17a2b8;
  padding: 0.5rem;
  border-radius: 4px;
}

.totals-subtotal-label,
.totals-subtotal-value,
.totals-tax-label,
.totals-tax-value,
.totals-change-label,
.totals-change-value {
  font-size: 14px;
}

.totals-tax-label,
.totals-tax-value {
  font-size: 13px;
}
/* =============================================================================
   pos.css
   Styles for pages/pos.php — the POS screen, the receipt modal, and the
   printed receipt (also linked from the print window in printReceipt()).
   ============================================================================= */

/* ---------- Record Sale button state ---------- */
#recordSaleBtn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
#recordSaleBtn:not([disabled]) {
  opacity: 1;
  cursor: pointer;
}

/* ---------- Change display color states ---------- */
.pos-change-neutral  { color: #666; }
.pos-change-positive { color: #27ae60; }
.pos-change-negative { color: #dc3545; }

/* ---------- Receipt modal chrome ---------- */
.receipt-modal-dialog {
  max-width: 480px;
}
.receipt-modal-content {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.receipt-modal-header {
  border-bottom: 2px solid #17a2b8;
}
.receipt-modal-body {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  padding: 25px;
  background: #fafafa;
  max-height: 65vh;
  overflow-y: auto;
}
.receipt-modal-footer {
  border-top: 2px solid #17a2b8;
  gap: 10px;
}

/* =============================================================================
   Receipt content — shared by the on-screen modal AND the print window
   (printReceipt() links this same stylesheet into the popup window).
   ============================================================================= */

.receipt-container {
  max-width: 80mm;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #000;
  line-height: 1.4;
}

/* Business header */
.receipt-header {
  text-align: center;
  margin-bottom: 15px;
  border-bottom: 3px solid #17a2b8;
  padding-bottom: 12px;
}
.receipt-logo {
  max-height: 50px;
  margin-bottom: 6px;
}
.receipt-business-name {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #17a2b8;
  letter-spacing: 1px;
}
.receipt-branch {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #333;
  font-weight: 600;
}
.receipt-address,
.receipt-contact {
  margin: 2px 0 0 0;
  font-size: 10px;
  color: #666;
}
.receipt-tax-info {
  margin: 4px 0 0 0;
  font-size: 10px;
  color: #666;
}
.receipt-subtitle {
  margin: 4px 0 0 0;
  font-size: 11px;
  color: #17a2b8;
  font-weight: 600;
}

/* Receipt metadata (receipt no, date, cashier, payment method...) */
.receipt-meta {
  margin-bottom: 15px;
  border-bottom: 2px dashed #999;
  padding-bottom: 12px;
  font-size: 11px;
}
.receipt-meta-table {
  width: 100%;
  border-collapse: collapse;
}
.receipt-meta-table td {
  padding: 3px 0;
}
.receipt-meta-table td:last-child {
  text-align: right;
}
.receipt-meta-value-strong {
  font-family: monospace;
  font-weight: bold;
}

/* Item table */
.receipt-items-header-table,
.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
}
.receipt-items-header-table {
  font-size: 10px;
  font-weight: bold;
}
.receipt-items-header {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #999;
}
.receipt-col-item   { width: 34%; padding: 5px 0; }
.receipt-col-qty    { width: 13%; padding: 5px 0; text-align: center; }
.receipt-col-price  { width: 19%; padding: 5px 0; text-align: right; }
.receipt-col-sub    { width: 21%; padding: 5px 0; text-align: right; }
.receipt-col-tax    { width: 13%; padding: 5px 0; text-align: right; }

.receipt-items-table { font-size: 10px; margin-bottom: 12px; }
.receipt-item-row { border-bottom: 1px solid #f0f0f0; }
.receipt-item-name-cell {
  padding: 6px 0;
  word-break: break-word;
  width: 34%;
  vertical-align: top;
}
.receipt-item-sub {
  color: #888;
  font-size: 9px;
}
.receipt-item-qty-cell   { padding: 6px 0; text-align: center; width: 13%; vertical-align: top; }
.receipt-item-price-cell { padding: 6px 0; text-align: right; width: 19%; vertical-align: top; }
.receipt-item-subtotal-cell {
  padding: 6px 0;
  text-align: right;
  width: 21%;
  vertical-align: top;
  font-weight: 600;
}
.receipt-item-tax-cell {
  padding: 6px 0;
  text-align: right;
  width: 13%;
  vertical-align: top;
  font-size: 9px;
  color: #888;
}

/* Totals box */
.receipt-totals-box {
  margin-bottom: 15px;
  padding: 12px;
  background: #e8f4f8;
  border-radius: 4px;
  border-left: 4px solid #17a2b8;
}
.receipt-totals-table {
  width: 100%;
  border-collapse: collapse;
}
.receipt-totals-table td {
  padding: 5px 0;
}
.receipt-totals-table td:last-child {
  text-align: right;
}
.receipt-row-subtotal,
.receipt-row-tax {
  font-size: 11px;
  border-bottom: 1px dashed #999;
}
.receipt-row-discount {
  font-size: 11px;
  border-bottom: 1px dashed #999;
  color: #dc3545;
}
.receipt-row-grand-total {
  font-size: 12px;
  font-weight: bold;
  border-bottom: 2px solid #17a2b8;
}
.receipt-row-paid {
  font-size: 11px;
  border-bottom: 1px dashed #999;
  color: #27ae60;
}
.receipt-row-paid td:last-child {
  color: #27ae60;
  font-weight: bold;
}
.receipt-row-change {
  font-size: 12px;
  font-weight: bold;
}
.receipt-row-change td:last-child {
  font-size: 13px;
}

/* Footer */
.receipt-footer {
  text-align: center;
  border-top: 2px dashed #999;
  padding-top: 12px;
  font-size: 10px;
}
.receipt-policy {
  margin: 4px 0;
  color: #666;
  font-size: 9px;
  line-height: 1.4;
}
.receipt-thankyou {
  margin: 8px 0;
  color: #27ae60;
  font-weight: bold;
}
.receipt-substatus {
  margin: 3px 0;
  color: #16a085;
  font-size: 9px;
}
.receipt-generated-by {
  margin: 8px 0;
  color: #999;
  font-size: 9px;
  font-style: italic;
}

/* Print-specific overrides (used only inside the popup print window) */
@media print {
  body { margin: 0; padding: 0; }
  .receipt-container { padding: 0; }
}