/* pos/pos.css – POS Screen Styles */
body { overflow: hidden; }

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 56px);
  gap: 0;
}

/* LEFT PANEL */
.pos-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--bg);
}

.pos-search-bar {
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.pos-search-bar .form-control {
  font-size: 15px;
  padding: 10px 14px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% - 4px);
  left: 16px;
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #eff6ff; }
.dropdown-item .prod-name { font-weight: 500; font-size: 13px; }
.dropdown-item .prod-sku  { font-size: 11px; color: var(--text-muted); }
.dropdown-item .prod-price { font-weight: 700; color: var(--primary); font-size: 13px; }
.dropdown-item .prod-stock { font-size: 11px; color: var(--text-muted); }
.dropdown-item.out-of-stock { opacity: .5; pointer-events: none; }

#cartContainer {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

#cartTable { font-size: 13px; }
#cartTable th { position: sticky; top: 0; background: var(--surface); z-index: 5; }

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all .1s;
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-input {
  width: 52px;
  text-align: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.disc-input {
  width: 56px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}
.remove-btn {
  background: none; border: none;
  color: var(--danger); cursor: pointer;
  font-size: 16px; padding: 4px;
  border-radius: 4px;
  transition: background .1s;
}
.remove-btn:hover { background: #fee2e2; }

/* RIGHT PANEL */
.pos-right {
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  background: var(--surface);
}

.pos-customer { position: relative; }
.pos-customer .form-control { font-size: 13px; }

.pos-totals .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pos-totals .total-row:last-child { border-bottom: none; }
.discount-row { flex-wrap: wrap; gap: 8px; }
.disc-controls { display: flex; gap: 6px; align-items: center; }
.disc-controls .form-control { padding: 4px 8px; font-size: 12px; }
.total-final {
  font-size: 20px !important;
  font-weight: 700;
  padding: 12px 0 !important;
  color: var(--primary);
}

.pay-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pay-btn {
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  text-align: center;
}
.pay-btn:hover  { border-color: var(--primary); color: var(--primary); }
.pay-btn.active { border-color: var(--primary); background: #eff6ff; color: var(--primary); font-weight: 700; }

.change-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
}

.pos-actions { margin-top: auto; padding-top: 8px; }

/* Responsive – tablet landscape */
@media (max-width: 900px) {
  .pos-layout { grid-template-columns: 1fr; height: auto; overflow: auto; }
  body { overflow: auto; }
  .pos-left { min-height: 60vh; }
  .pos-right { border-top: 1px solid var(--border); }
}
