/**
 * Thirumurugan Metals ERP - POS & Billing Layout Styles
 */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 20px;
  height: calc(100vh - var(--topbar-height) - 48px);
  min-height: 600px;
}

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

/* LEFT: CATALOG PANEL */
.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pos-category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

.cat-pill {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background-color: #ffffff;
  color: #475569;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-pill:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.cat-pill.active {
  background: linear-gradient(135deg, #0f172a 0%, #070d1d 100%);
  color: var(--gold-400);
  border-color: #070d1d;
  box-shadow: 0 3px 8px rgba(7, 13, 29, 0.25);
  font-weight: 700;
}

.pos-products-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
  padding-right: 4px;
}

/* PRODUCT CARD */
.pos-product-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.18s ease;
  user-select: none;
  box-shadow: var(--shadow-card);
  position: relative;
}

.pos-product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--gold-500);
}

.pos-product-card.out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f8fafc;
}

.pos-prod-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.pos-prod-stock {
  font-size: 11px;
  font-weight: 700;
}

.pos-prod-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 6px 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 35px;
}

.pos-prod-sku {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
  margin-bottom: 10px;
}

.pos-prod-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.pos-prod-price {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
}

.pos-prod-mrp {
  font-size: 11px;
  color: #94a3b8;
  text-decoration: line-through;
}

.pos-add-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-add-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #070d1d;
  border-color: #d97706;
}

/* RIGHT: CART & BILLING PANEL */
.pos-cart-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-cart-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  background-color: #ffffff;
}

.pos-cart-items-wrapper {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100% - 250px);
}

.pos-cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pos-cart-table th {
  padding: 10px 14px;
  background-color: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

.pos-cart-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.pos-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pos-qty-btn {
  background: #f8fafc;
  border: none;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: 800;
  color: #334155;
  transition: background 0.15s ease;
}
.pos-qty-btn:hover { background: #e2e8f0; color: #0f172a; }

.pos-qty-input {
  width: 32px;
  height: 24px;
  border: none;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  -moz-appearance: textfield;
}
.pos-qty-input::-webkit-outer-spin-button,
.pos-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pos-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}

.pos-cart-footer {
  padding: 16px;
  background-color: #f8fafc;
  border-top: 1px solid var(--border-light);
}

.pos-grand-total-banner {
  background: linear-gradient(135deg, #0b1329 0%, #070d1d 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(7, 13, 29, 0.35);
}

/* PAYMENT SELECTOR BUTTONS */
.pay-mode-btn {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pay-mode-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.pay-mode-btn.active {
  background: linear-gradient(135deg, #0b1329 0%, #070d1d 100%);
  border-color: var(--gold-500);
  color: var(--gold-400);
  box-shadow: 0 4px 12px rgba(11, 19, 41, 0.35);
}

/* RECEIPT PREVIEWS */
.thermal-receipt-view {
  display: flex;
  justify-content: center;
  padding: 12px;
}

.thermal-receipt {
  width: 320px;
  background: #ffffff;
  padding: 18px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  color: #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

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

.thermal-receipt th, .thermal-receipt td {
  padding: 4px 0;
  font-size: 11px;
}

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