/**
 * Enterprise Cafeteria POS System
 * POS Terminal CSS - Catalog, Search, Cart, Action Grid, Payment Modals
 */

/* =============================================================================
   1. POS Layout Grid
   ============================================================================= */
.pos-view-container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Middle Area: Product Catalog (58%) */
.pos-catalog-area {
  flex: 58;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  border-right: 2px solid var(--border-panel);
  background: #edf0f4;
  overflow: hidden;
}

/* Right Area: Cart & Checkout (42%) */
.pos-checkout-area {
  flex: 42;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 380px;
  background: var(--bg-panel);
  overflow: hidden;
}

/* =============================================================================
   2. Product Search & Category Navigation
   ============================================================================= */
.catalog-header {
  padding: 8px 12px;
  background: var(--bg-header-gradient);
  border-bottom: 1px solid var(--border-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-barcode-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: #6c757d;
  pointer-events: none;
}

.pos-search-input {
  width: 100%;
  height: 38px;
  padding-left: 36px;
  padding-right: 32px;
  font-size: var(--font-size-base);
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #8e97a4;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  outline: none;
}

.pos-search-input:focus {
  border-color: #1976d2;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8892a0;
  cursor: pointer;
  padding: 4px;
}

.search-clear-btn:hover {
  color: #c62828;
}

/* Category Filter Tabs */
.category-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cat-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
  background: var(--bg-btn-default);
  border: 1px solid var(--border-btn-default);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-bevel-btn);
  cursor: pointer;
  color: var(--text-heading);
  transition: all 0.12s ease;
}

.cat-pill-btn:hover {
  background: var(--bg-btn-default-hover);
}

.cat-pill-btn.active {
  background: var(--bg-primary-glossy);
  border-color: var(--color-primary-border);
  color: #ffffff;
  text-shadow: var(--text-dark-shadow);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0,0,0,0.15);
}

.cat-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
}

.cat-pill-btn.active .cat-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* =============================================================================
   3. Product Grid & Cards
   ============================================================================= */
.product-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  align-content: start;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #bcc2cb;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 1px 0 #ffffff;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
  height: 160px;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #718096;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 #ffffff;
}

.product-card:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-card-top {
  height: 72px;
  background: linear-gradient(180deg, #f4f6f9 0%, #e2e6eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid #d0d6df;
}

.product-card-top svg {
  width: 36px;
  height: 36px;
  fill: #546e7a;
  opacity: 0.85;
}

.product-station-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  background: rgba(33, 43, 54, 0.75);
  color: #ffffff;
  border-radius: 3px;
  text-transform: uppercase;
}

.product-badge-variant {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  background: #1976d2;
  color: #ffffff;
  border-radius: 3px;
}

.product-card-info {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card-name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.product-card-price {
  font-size: var(--font-size-md);
  font-weight: 800;
  color: var(--color-primary);
  font-family: var(--font-mono);
}

.product-stock-tag {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
}

.product-stock-tag.low-stock {
  color: #c62828;
  font-weight: 700;
}

/* =============================================================================
   4. Right Panel: Cart & Order Management
   ============================================================================= */
.cart-header {
  padding: 8px 12px;
  background: var(--bg-header-gradient);
  border-bottom: 1px solid var(--border-panel);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-customer-table-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-selector-btn, .table-selector-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  background: #ffffff;
  border: 1px solid #9aa1ab;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-heading);
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.customer-selector-btn:hover, .table-selector-btn:hover {
  border-color: #1976d2;
}

.cart-order-info-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: #495057;
  padding: 3px 6px;
  background: #dde2e8;
  border-radius: var(--radius-sm);
}

/* Cart Items Scrollable List */
.cart-items-container {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #8892a0;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.cart-empty-state svg {
  width: 54px;
  height: 54px;
  fill: #b0b8c4;
}

.cart-item-row {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e9ee;
  transition: background 0.1s ease;
  gap: 8px;
}

.cart-item-row:hover {
  background: #f8fafc;
}

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

.cart-item-name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cart-addon-badge {
  background: #eef2f6;
  border: 1px solid #d2d8e2;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  color: #334155;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  padding: 0;
  font-weight: 800;
}

.qty-value {
  width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
}

.cart-item-price-col {
  width: 72px;
  text-align: right;
  font-weight: 700;
  font-size: var(--font-size-sm);
  font-family: var(--font-mono);
  color: #111827;
}

.cart-item-remove-btn {
  background: transparent;
  border: none;
  color: #b0b8c4;
  cursor: pointer;
  padding: 4px;
}

.cart-item-remove-btn:hover {
  color: #dc2626;
}

/* =============================================================================
   5. Totals Calculation & POS Action Pad
   ============================================================================= */
.cart-totals-panel {
  background: linear-gradient(180deg, #f2f4f7 0%, #e2e6eb 100%);
  border-top: 1px solid var(--border-panel);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 600;
}

.totals-row.grand-total-row {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed #a0abb8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grand-total-label {
  font-size: var(--font-size-base);
  font-weight: 800;
  color: var(--text-heading);
  text-transform: uppercase;
}

.grand-total-amount {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  color: var(--color-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

/* POS Quick Action Buttons Grid */
.pos-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 8px 12px;
  background: #d8dde4;
  border-top: 1px solid #bcc2cb;
}

.pos-action-btn {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 44px;
}

.pos-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Pay / Checkout Main Trigger Button */
.pos-pay-trigger-wrapper {
  padding: 8px 12px 12px 12px;
  background: #d8dde4;
}

.pos-btn-pay {
  width: 100%;
  height: 52px;
  font-size: var(--font-size-xl);
  letter-spacing: 0.5px;
}

/* =============================================================================
   6. Payment Dialog Multi-Tender Tabs & Quick Cash
   ============================================================================= */
.payment-modal-layout {
  display: flex;
  gap: 16px;
}

.payment-methods-column {
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pay-method-btn {
  padding: 10px;
  font-size: var(--font-size-md);
  font-weight: 700;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pay-method-btn.active {
  background: var(--bg-primary-glossy);
  border-color: var(--color-primary-border);
  color: #ffffff;
  text-shadow: var(--text-dark-shadow);
}

.payment-details-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.quick-cash-btn {
  height: 42px;
  font-size: var(--font-size-lg);
  font-weight: 800;
  font-family: var(--font-mono);
}

.pay-calc-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid #bcc2cb;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pay-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-md);
  font-weight: 700;
}

.pay-calc-row.change-row {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  border-top: 1px dashed #cbd5e1;
  padding-top: 6px;
}
