/* Saflio POS — Register / Checkout Styles */

.pos-register-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  height: calc(100vh - var(--header-height) - 80px);
}

.pos-register-cart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.pos-register-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-register-title h3 {
  font-size: 1.2em;
}

.pos-register-total-display {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--accent);
}

.pos-register-add-row {
  display: flex;
  gap: 8px;
}

.pos-register-search {
  display: flex;
  gap: 4px;
  flex: 1;
}

.pos-register-search input {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 1em;
}

.pos-register-search input:focus {
  border-color: var(--accent);
}

/* Search results dropdown */
.pos-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
}

.pos-register-add-row {
  position: relative;
}

.pos-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  gap: 8px;
}

.pos-search-item:last-child { border-bottom: none; }
.pos-search-item:hover { background: var(--surface-hover); }

.pos-search-item-name {
  font-weight: 600;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pos-search-item-source {
  font-size: 0.75em;
  color: var(--text-muted);
  font-weight: 400;
}

.pos-search-item-price {
  font-size: 0.9em;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.pos-search-item-stock {
  font-size: 0.75em;
  color: var(--danger);
}

.pos-search-empty {
  padding: 16px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9em;
}

.pos-stock-badge {
  font-size: 0.75em;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 500;
}

.pos-stock-out { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.pos-stock-low { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

/* Cart */
.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-cart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.95em;
  text-align: center;
  padding: 40px;
}

.pos-cart-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: default;
}

.pos-cart-item-info {
  display: flex;
  justify-content: space-between;
}

.pos-cart-item-name {
  font-weight: 600;
  font-size: 0.9em;
}

.pos-cart-item-price {
  color: var(--text-muted);
  font-size: 0.85em;
}

.pos-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--surface-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  font-weight: 700;
}

.pos-qty-btn:hover {
  background: var(--surface-hover);
}

.pos-cart-item-qty {
  font-size: 1em;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.pos-cart-item-total {
  margin-left: auto;
  font-weight: 700;
  color: var(--accent);
}

.pos-cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2em;
  cursor: pointer;
  padding: 2px;
}

.pos-cart-item-remove:hover {
  color: var(--danger);
}

/* Cart summary */
.pos-cart-summary {
  padding: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.pos-cart-summary-total {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  padding-top: 6px;
}

/* Actions */
.pos-register-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pos-payment-row {
  display: flex;
  gap: 12px;
}

.pos-action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.pos-btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

/* Info panel */
.pos-register-info {
  border-left: 1px solid var(--border-color);
  padding-left: 20px;
}

.pos-info-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pos-info-header h4 {
  color: var(--text-muted);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pos-info-body {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.pos-info-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Receipt */
.pos-receipt-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-receipt-modal {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.pos-receipt-modal-body {
  padding: 20px;
}

.pos-receipt-modal-actions {
  padding: 12px 20px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border-color);
}

.pos-receipt {
  text-align: center;
}

.pos-receipt-header h4 {
  font-size: 1.1em;
  margin-bottom: 4px;
}

.pos-receipt-header p {
  color: var(--text-muted);
  font-size: 0.85em;
}

.pos-receipt-order {
  font-weight: 700;
  color: var(--accent);
}

.pos-receipt-divider {
  border-top: 1px dashed var(--border-color);
  margin: 12px 0;
}

.pos-receipt-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.9em;
}

.pos-receipt-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--text-secondary);
}

.pos-receipt-grand {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text-primary);
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 4px;
}

/* Customer search */
.pos-customer-results {
  background: var(--surface-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
}

.pos-customer-item {
  font-size: 0.85em;
}

/* Nutrition mini */
.pos-nutrition-mini {
  display: flex;
  gap: 8px;
  font-size: 0.8em;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .pos-register-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pos-register-info {
    display: none;
  }

  .pos-payment-row {
    flex-direction: column;
  }
}

/* Scanned product info in price dialog */
.pos-scanned-info {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface-tertiary);
  border-radius: var(--radius);
}

.pos-scanned-info h4 {
  font-size: 1em;
  margin-bottom: 4px;
}

.pos-scanned-barcode {
  font-size: 0.85em;
  color: var(--text-muted);
}

.pos-scanned-barcode code {
  font-size: 0.9em;
}

.pos-scanned-desc {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Cart item barcode display */
.pos-cart-item-barcode {
  font-size: 0.75em;
  color: var(--text-muted);
  display: block;
}

.pos-cart-item-barcode code {
  background: var(--surface-tertiary);
  padding: 1px 4px;
  border-radius: 2px;
}
