/* ==========================================================================
   ApexPOS - Components & Modals (Payment, Thermal Receipt, Modifiers)
   ========================================================================== */

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.wide {
  max-width: 720px;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Payment Tender Dialog */
.tender-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.tender-method-btn {
  padding: 12px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--trans-fast);
}

.tender-method-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tender-method-btn.active {
  background: var(--bg-hover);
  color: #ffffff;
  border-color: #ffffff;
  font-weight: 700;
}

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

.cash-chip {
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--trans-fast);
}

.cash-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.cash-chip.active {
  background: #f4f4f5;
  color: #09090b;
  border-color: #ffffff;
  font-weight: 700;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
}

.form-input, .form-select {
  width: 100%;
  height: 42px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Thermal Receipt Styling */
.thermal-receipt {
  width: 320px;
  background: #ffffff;
  color: #000000;
  font-family: var(--font-mono);
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  line-height: 1.35;
  font-size: 0.75rem;
}

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

.receipt-logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

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

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

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

/* Toast Notifications */
#toast-shelf {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-focus);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastSlide 200ms ease-out;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error   { border-left: 4px solid var(--accent-crimson); }
.toast.info    { border-left: 4px solid var(--accent-sky); }

@keyframes toastSlide {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}


