/**
 * MJ SMART BILLING - POS Billing Screen Styles
 * Brand: MJ SMART APPS
 * High efficiency 2-column POS interface
 */

.pos-container {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  height: calc(100vh - var(--header-height) - 56px);
  min-height: 650px;
}

/* Left Panel: Catalog & Search */
.pos-catalog-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.catalog-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-search-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
}

.barcode-input-wrapper {
  position: relative;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-pill {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--transition-speed);
}

.category-pill:hover {
  background: var(--border-subtle);
  color: var(--text-main);
}

.category-pill.active {
  background: var(--brand-primary);
  color: #FFFFFF;
}

.catalog-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  align-content: start;
}

.pos-product-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
}

.pos-product-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-badge-stock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.product-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  margin-top: 14px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-sku {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-family: ui-monospace, monospace;
}

.product-meta {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-primary);
}

.product-gst-tag {
  font-size: 0.7rem;
  color: var(--text-subtle);
  background: var(--bg-muted);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Right Panel: Current Bill / Cart */
.pos-cart-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.cart-top-bar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-customer-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.cart-items-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

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

.cart-table th {
  padding: 10px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cart-table td {
  padding: 10px 12px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border-subtle);
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  background: var(--bg-subtle);
  border: none;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 700;
}

.qty-btn:hover {
  background: var(--border-subtle);
}

.qty-input {
  width: 36px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Cart Summary & Totals */
.cart-summary-section {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.summary-row.grand-total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-heading);
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px dashed var(--border-medium);
}

.grand-total-val {
  color: var(--brand-primary);
  font-size: 1.45rem;
}

/* Payment Method Badges */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.payment-method-chip {
  padding: 7px 4px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.payment-method-chip:hover {
  border-color: var(--brand-primary);
  color: var(--text-main);
}

.payment-method-chip.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

/* Action Buttons Footer */
.cart-actions-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-buttons-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 10px;
}

.secondary-actions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
