/* ==========================================================================
   POS (POINT OF SALE) VIEW STYLES
   ========================================================================== */

.pos-container {
  display: grid;
  grid-template-columns: 440px 1fr;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 380px 1fr;
  }
}

@media (max-width: 768px) {
  .pos-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* ==========================================================================
   POS LEFT COLUMN: CART & TICKET
   ========================================================================== */
.pos-cart-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cart-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.cart-title-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-title-box h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-count-badge {
  font-size: 0.75rem;
  background: rgba(2, 132, 199, 0.2);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.btn-clear-cart {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-clear-cart:hover {
  background: var(--accent-danger);
  color: white;
  border-color: var(--accent-danger);
}

/* Cart Items List */
.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  opacity: 0.4;
}

.cart-empty-state p {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.cart-item-row {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.cart-item-row.flash-highlight {
  animation: flashRow 0.6s ease-out;
}

@keyframes flashRow {
  0% { background: rgba(16, 185, 129, 0.3); transform: scale(1.02); }
  100% { background: var(--bg-app); transform: scale(1); }
}

.cart-item-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-item-title {
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.cart-item-code {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cart-item-price-tag {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-color);
}

.qty-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-qty {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-qty:hover {
  background: var(--primary);
  color: white;
}

.input-qty {
  width: 48px;
  height: 30px;
  border: none;
  background: transparent;
  text-align: center;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  outline: none;
}

.cart-item-subtotal {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary-hover);
}

body.dark-theme .cart-item-subtotal {
  color: #38bdf8;
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-remove-item:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.15);
}

/* Cart Footer & Totals */
.cart-footer {
  padding: 1rem 1.1rem;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-totals-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.totals-row.main-total-row {
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.main-total-amount {
  font-size: 1.5rem;
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--accent-success);
}

.btn-checkout {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: var(--transition);
}

.btn-checkout:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.keyboard-shortcut-hint {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   POS RIGHT COLUMN: CATALOG & BARCODE SEARCH
   ========================================================================== */
.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-app);
}

.catalog-topbar {
  padding: 0.8rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-scanner-bar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.scanner-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.scanner-icon {
  position: absolute;
  left: 0.9rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.pos-search-input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.6rem;
  background: var(--bg-app);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.pos-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.scanner-indicator {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  animation: fadeIn 0.2s ease-in;
}

.scanner-indicator.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-success);
  border: 1px solid var(--accent-success);
}

.scanner-indicator.warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-warning);
  border: 1px solid var(--accent-warning);
}

/* Category Pills */
.category-pills-bar {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 2px;
}

.category-pills-bar::-webkit-scrollbar {
  height: 4px;
}

.category-pills-bar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.pill-category {
  padding: 0.4rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

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

.pill-category.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Catalog Grid */
.catalog-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.product-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.9rem;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  min-height: 115px;
}

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

.prod-badge-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.prod-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.3rem;
}

.prod-code-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

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

.prod-price {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent-success);
}

.prod-stock {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.prod-stock.stock-low {
  color: var(--accent-danger);
  font-weight: 700;
}

/* ==========================================================================
   PAYMENT MODAL SPECIFIC STYLES
   ========================================================================== */
.pay-modal-total-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid var(--accent-success);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  text-align: center;
  margin-bottom: 1.2rem;
}

.pay-modal-total-banner span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: block;
}

.pay-modal-total-banner strong {
  font-size: 2rem;
  font-family: var(--font-mono);
  color: var(--accent-success);
  font-weight: 900;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.btn-pay-method {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pay-method .method-icon {
  font-size: 1.4rem;
}

.btn-pay-method:hover {
  border-color: var(--primary);
}

.btn-pay-method.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #38bdf8;
}

.quick-bills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.btn-quick-bill {
  padding: 0.4rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-quick-bill:hover {
  background: var(--primary);
  color: white;
}

.change-display-box {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.change-display-box span {
  font-size: 1.05rem;
  font-weight: 700;
}

.change-display-box strong {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: #38bdf8;
}

.change-display-box strong.text-danger {
  color: var(--accent-danger);
}

/* Success Modal */
.success-total-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid var(--accent-success);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.success-total-banner span {
  display: block;
  font-size: 0.9rem;
}

.success-total-banner strong {
  font-size: 2.2rem;
  font-family: var(--font-mono);
  color: var(--accent-success);
}

.receipt-preview-container {
  background: #ffffff;
  color: #000000;
  padding: 1rem;
  border-radius: var(--radius-md);
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
}
