/* POS Cashier System - Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* Screens */
.screen {
  display: none;
  width: 100%;
  height: 100vh;
}

.screen.active {
  display: block;
}

/* Login Screen */
#loginScreen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#loginScreen.active {
  display: flex;
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  min-width: 350px;
  max-width: 90vw;
  width: 100%;
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #667eea;
}

.login-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
}

/* Session Screen */
#sessionScreen {
  background: #f5f5f5;
}

.session-container {
  max-width: 600px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.session-container h1 {
  margin-bottom: 30px;
  color: #667eea;
}

#sessionInfo {
  margin-bottom: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 5px;
}

#sessionActions button {
  margin: 10px 10px 10px 0;
}

/* POS Screen */
#posScreen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #667eea;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left h2 {
  margin: 0;
}

.header-left span {
  font-size: 14px;
  opacity: 0.9;
}

.header-right {
  display: flex;
  gap: 10px;
}

.pos-main {
  display: grid;
  grid-template-columns: 1fr 1fr 400px;
  gap: 10px;
  padding: 10px;
  flex: 1;
  overflow: hidden;
}

/* Layout toggle for cart/product swap */
.pos-main.layout-swapped {
  grid-template-columns: 400px 1fr 1fr;
}

.pos-main.layout-swapped .left-panel {
  order: 2;
}

.pos-main.layout-swapped .middle-panel {
  order: 1;
}

.pos-main.layout-swapped .right-panel {
  order: 3;
}

.pos-panel {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.pos-panel h3 {
  margin-bottom: 15px;
  color: #667eea;
  border-bottom: 2px solid #667eea;
  padding-bottom: 10px;
  font-size: 18px;
}

/* Left Panel - Products */
.customer-section {
  margin-bottom: 15px;
}

#selectedCustomer {
  margin-top: 10px;
  padding: 10px;
  background: #e3f2fd;
  border-radius: 5px;
  font-size: 14px;
}

.search-section {
  margin-bottom: 15px;
  position: relative;
}

#productSearch {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

#productSearch:focus {
  outline: none;
  border-color: #667eea;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  display: none;
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 0 0 5px 5px;
  max-height: 400px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  z-index: 10001;
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-dropdown.active {
  display: block;
}

.product-results {
  flex: 1;
  overflow-y: auto;
}

.product-item {
  padding: 12px 15px;
  margin: 0;
  background: white;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.2s;
}

.product-item:last-child {
  border-bottom: none;
}

.product-item:hover {
  background: #e8ebff;
  color: #667eea;
  padding-left: 20px;
}

.product-item-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.product-item-price {
  color: #666;
  font-size: 14px;
}

.product-item:hover .product-item-price {
  color: white;
}

/* No results message */
.product-item.no-results {
  background: #f5f5f5;
  color: #999;
  text-align: center;
  font-style: italic;
  padding: 20px 15px;
  cursor: default;
}

.product-item.no-results:hover {
  background: #f5f5f5;
  color: #999;
  padding-left: 15px;
}

/* Middle Panel - Cart */
.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 15px;
}

.cart-item {
  padding: 12px;
  margin-bottom: 8px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.cart-item:hover {
  background: #e0e0e0;
}

.cart-item.selected {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.cart-item-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.cart-item-name {
  font-weight: bold;
  flex: 1;
}

.cart-item-total {
  font-size: 18px;
  font-weight: bold;
}

.cart-item-details {
  font-size: 12px;
  color: #666;
}

.cart-item.selected .cart-item-details {
  color: rgba(255,255,255,0.8);
}

.cart-summary {
  border-top: 2px solid #667eea;
  padding-top: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 16px;
}

.summary-row.total {
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
  border-top: 2px solid #667eea;
  padding-top: 15px;
  margin-top: 5px;
}

/* Right Panel - Keypad */
.keypad {
  margin-bottom: 20px;
}

.keypad-display {
  width: 100%;
  padding: 15px;
  font-size: 24px;
  text-align: right;
  border: 2px solid #667eea;
  border-radius: 5px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.keypad-btn {
  padding: 20px;
  font-size: 20px;
  font-weight: bold;
  border: none;
  background: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.keypad-btn:hover {
  background: #e0e0e0;
}

.keypad-btn:active {
  transform: scale(0.95);
}

.keypad-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.action-btn {
  padding: 15px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  background: #764ba2;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #5e3a82;
}

/* Buttons */
.btn-primary {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background: #667eea;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-large {
  width: 100%;
  padding: 20px;
  font-size: 20px;
}

.btn-secondary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  border: 2px solid #667eea;
  background: white;
  color: #667eea;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #667eea;
  color: white;
}

/* Dialogs */
.dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.dialog.active {
  display: flex;
}

.dialog-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.dialog-content.large {
  max-width: 700px;
}

.dialog-content h2 {
  margin-bottom: 20px;
  color: #667eea;
}

.dialog-content input,
.dialog-content select {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 14px;
  background: white;
}

.dialog-content select {
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 20px;
  padding-right: 35px;
}

.dialog-results {
  max-height: 300px;
  overflow-y: auto;
  margin: 15px 0;
}

.result-item {
  padding: 12px;
  margin-bottom: 8px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

.result-item:hover {
  background: #667eea;
  color: white;
}

.dialog-close {
  margin-top: 15px;
  padding: 10px 20px;
  background: #ccc;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.dialog-close:hover {
  background: #bbb;
}

/* Payment Dialog */
.payment-info {
  text-align: center;
  margin-bottom: 20px;
  padding: 15px;
  background: #e3f2fd;
  border-radius: 5px;
}

.payment-keypad {
  margin-bottom: 20px;
}

.payment-keypad .keypad-grid {
  grid-template-columns: repeat(3, 1fr);
}

.payment-keypad-btn {
  padding: 15px;
  font-size: 18px;
  font-weight: bold;
  border: none;
  background: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
}

.payment-keypad-btn:hover {
  background: #e0e0e0;
}

.payment-methods {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.payment-method-btn {
  flex: 1;
  padding: 15px;
  font-weight: bold;
  border: none;
  background: #764ba2;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.payment-method-btn:hover {
  background: #5e3a82;
}

.payment-list {
  margin-bottom: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 5px;
  min-height: 100px;
}

.payment-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
}

.payment-item button {
  padding: 5px 10px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.dialog-actions {
  display: flex;
  gap: 10px;
}

.dialog-actions button {
  flex: 1;
}

/* Menu Dialog */
.menu-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.menu-item-btn {
  padding: 15px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background: #f0f0f0;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.menu-item-btn:hover {
  background: #667eea;
  color: white;
}

/* VAT Type Dialog */
.vat-type-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.vat-type-btn {
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
}

.vat-type-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.vat-type-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.vat-type-desc {
  font-size: 14px;
  color: #666;
}

/* Language Dialog */
.language-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.language-btn {
  padding: 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.language-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.language-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.language-flag {
  font-size: 32px;
}

/* Pricelist Dialog */
.pricelist-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  max-height: 400px;
  overflow-y: auto;
}

.pricelist-btn {
  padding: 15px 20px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.pricelist-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.pricelist-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

/* Queue Status */
.queue-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  background: #667eea;
  color: white;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none;
  z-index: 100;
}

.queue-status.active {
  display: block;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
  color: #ff4444;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

/* Warning Message */
.warning-message {
  color: #ff9900;
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 10px;
  font-size: 14px;
  text-align: center;
  background-color: rgba(255, 153, 0, 0.1);
  border: 1px solid #ff9900;
  border-radius: 4px;
}

/* Success Message */
.success-message {
  color: #44ff44;
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 16px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

.toast-icon {
  font-size: 24px;
  font-weight: bold;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
}

.toast-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-close:hover {
  color: #333;
}

/* Toast Types */
.toast-success {
  border-left: 4px solid #4caf50;
}

.toast-success .toast-icon {
  color: #4caf50;
  background: #e8f5e9;
}

.toast-error {
  border-left: 4px solid #f44336;
}

.toast-error .toast-icon {
  color: #f44336;
  background: #ffebee;
}

.toast-warning {
  border-left: 4px solid #ff9800;
}

.toast-warning .toast-icon {
  color: #ff9800;
  background: #fff3e0;
}

.toast-info {
  border-left: 4px solid #2196f3;
}

.toast-info .toast-icon {
  color: #2196f3;
  background: #e3f2fd;
}

.toast-confirm {
  border-left: 4px solid #9c27b0;
  flex-wrap: wrap;
}

.toast-confirm .toast-icon {
  color: #9c27b0;
  background: #f3e5f5;
}

.toast-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding-left: 44px;
}

.toast-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.toast-btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.toast-btn-cancel:hover {
  background: #e0e0e0;
}

.toast-btn-confirm {
  background: #667eea;
  color: white;
}

.toast-btn-confirm:hover {
  background: #5568d3;
}

/* ===== RESPONSIVE DESIGN (Base: 766px+) ===== */

/* BASE (766px - 899px) - 2 Column: Cart | Products+Keyboard */
@media (min-width: 766px) and (max-width: 899px) {
  .pos-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 5px;
    padding: 5px;
    height: calc(100vh - 110px);
  }
  
  .left-panel {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }
  
  .middle-panel {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
  }
  
  .right-panel {
    display: flex !important;
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    flex-direction: column;
  }
  
  .pos-header {
    padding: 10px 12px;
  }
  
  .header-left h2 {
    font-size: 16px;
  }
  
  .header-left span,
  .header-right button {
    font-size: 11px;
  }
  
  .pos-panel {
    padding: 10px;
    border-radius: 5px;
    overflow: hidden;
  }
  
  .pos-panel h3 {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  
  .keypad-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
  
  .keypad-btn,
  .action-btn {
    padding: 8px 5px;
    font-size: 11px;
  }
  
  .search-section input {
    padding: 9px;
    font-size: 13px;
    border: 1px solid #ddd;
  }
  
  .keypad-display {
    padding: 10px;
    font-size: 14px;
  }
  
  .btn-primary {
    padding: 10px;
    font-size: 12px;
  }
  
  .btn-secondary {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* MEDIUM (900px - 1024px) - 2 Column with better spacing */
@media (min-width: 900px) and (max-width: 1024px) {
  .pos-main {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 6px;
    padding: 6px;
    height: calc(100vh - 120px);
  }
  
  .left-panel {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
  }
  
  .middle-panel {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
  }
  
  .right-panel {
    display: flex !important;
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    flex-direction: column;
  }
  
  .pos-panel {
    padding: 12px;
    border-radius: 5px;
    overflow: hidden;
  }
  
  .pos-panel h3 {
    font-size: 14px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
  
  .keypad-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  
  .keypad-btn,
  .action-btn {
    padding: 10px 6px;
    font-size: 12px;
  }
  
  .search-section input {
    padding: 10px;
    font-size: 14px;
  }
}

/* LARGE (1025px - 1399px) - 3 Column: Products | Cart | Keyboard */
@media (min-width: 1025px) and (max-width: 1399px) {
  .pos-main {
    grid-template-columns: 1fr 0.9fr 350px;
    gap: 8px;
    padding: 8px;
  }
  
  .pos-panel {
    padding: 15px;
  }
  
  .pos-panel h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
}

/* EXTRA LARGE (1400px+) - 3 Column with generous spacing */
@media (min-width: 1400px) {
  .pos-main {
    grid-template-columns: 1.2fr 1fr 450px;
    gap: 10px;
    padding: 10px;
  }
  
  .pos-panel {
    padding: 25px;
  }
  
  .pos-panel h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
  }
}

/* SMALL (max 765px) - Single column stacked layout */
@media (max-width: 765px) {
  .pos-header {
    flex-wrap: wrap;
    padding: 12px 15px;
  }
  
  .header-left {
    gap: 15px;
    width: 100%;
    margin-bottom: 10px;
  }
  
  .header-left h2 {
    font-size: 18px;
  }
  
  .header-left span {
    font-size: 12px;
  }
  
  .header-right {
    width: 100%;
  }
  
  .header-right button {
    font-size: 12px;
    padding: 8px 12px;
  }
  
  /* Single column stacked layout */
  .pos-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    height: calc(100vh - 120px);
  }
  
  .left-panel,
  .middle-panel,
  .right-panel {
    min-height: 0;
  }
  
  .middle-panel {
    flex: 1.2;
    order: 2;
  }
  
  .left-panel {
    flex: 0.8;
    order: 1;
  }
  
  .right-panel {
    flex: 0.8;
    order: 3;
  }
  
  .pos-panel {
    padding: 12px;
    border-radius: 5px;
    overflow: hidden;
  }
  
  .pos-panel h3 {
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }
  
  /* Ensure scrollable content areas work */
  .product-results,
  .cart-items {
    overflow-y: auto;
    flex: 1;
  }
  
  /* Compact keypad for small screens */
  .keypad {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .keypad-display {
    padding: 12px;
    font-size: 16px;
    text-align: right;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
  
  .keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  
  .keypad-btn {
    padding: 12px 8px;
    font-size: 14px;
    font-weight: bold;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
  }
  
  .keypad-btn:hover {
    background: #5568d3;
  }
  
  .keypad-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }
  
  .action-btn {
    padding: 10px 6px;
    font-size: 12px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .action-btn:hover {
    background: #e0e0e0;
  }
  
  .btn-primary {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .btn-large {
    padding: 14px 12px;
    font-size: 14px;
    width: 100%;
    margin-top: 8px;
  }
  
  .btn-secondary {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  /* Reduce dialog sizes on tablet */
  .dialog-content {
    padding: 20px;
    max-width: 90%;
  }
  
  .dialog-content.large {
    max-width: 95%;
  }
  
  .dialog-content h2 {
    font-size: 18px;
    margin-bottom: 15px;
  }
  
  .dialog-content input,
  .dialog-content select {
    padding: 8px;
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .menu-items,
  .language-options,
  .pricelist-options {
    grid-template-columns: 1fr !important;
  }
  
  .menu-item-btn,
  .language-btn,
  .pricelist-btn {
    padding: 12px !important;
    font-size: 13px !important;
  }
}

/* Small phones (480px - 767px) */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }
  
  .pos-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 10px;
  }
  
  .header-left {
    width: 100%;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .header-left h2 {
    font-size: 16px;
    flex: 0 0 100%;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .header-right button {
    flex: 1;
    font-size: 12px;
    padding: 8px 10px;
    margin: 0 5px 0 0;
  }
  
  .pos-main {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 5px;
  }
  
  .pos-panel {
    padding: 10px;
    min-height: 200px;
    max-height: 450px;
  }
  
  .pos-panel h3 {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  
  .right-panel {
    display: none;
  }
  
  .left-panel {
    max-height: 30%;
  }
  
  .middle-panel {
    max-height: 70%;
  }
  
  #productSearch,
  #customerSearch {
    font-size: 16px !important;
  }
  
  .btn-primary,
  .btn-secondary {
    font-size: 13px;
    padding: 8px 12px;
  }
  
  .login-container {
    min-width: auto;
    width: 95%;
    padding: 25px;
  }
  
  .login-container h1 {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .login-form input {
    padding: 10px;
    margin-bottom: 12px;
    font-size: 16px;
  }
  
  .keypad-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  .keypad-btn {
    padding: 12px 8px !important;
    font-size: 14px !important;
  }
}

/* Extra small phones (< 480px) */
@media (max-width: 479px) {
  .pos-header {
    padding: 8px;
  }
  
  .header-left h2 {
    font-size: 14px;
  }
  
  .header-right button {
    font-size: 11px;
    padding: 6px 8px;
    margin: 0 3px 0 0;
  }
  
  .pos-panel {
    padding: 8px;
    border-radius: 5px;
    min-height: 180px;
  }
  
  .pos-panel h3 {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .login-container {
    width: 100%;
    padding: 20px;
    border-radius: 0;
  }
  
  .search-section input,
  #customerSearch {
    font-size: 16px;
    padding: 10px;
  }
  
  .product-item,
  .cart-item {
    padding: 10px;
    margin-bottom: 6px;
    font-size: 13px;
  }
  
  .product-item-name,
  .cart-item-name {
    font-size: 13px;
  }
  
  .summary-row {
    font-size: 14px;
    padding: 6px 0;
  }
  
  .summary-row.total {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .pos-main {
    grid-template-columns: 1fr;
  }
  
  .pos-panel {
    max-height: 400px;
  }
}
