* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f0f0;
  overflow: hidden;
  touch-action: manipulation;
}

.container {
  display: flex;
  height: 100vh;
  flex-direction: column;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  background: #34495e;
  color: white;
  flex-shrink: 0;
}

.toolbar-btn {
  background: #2c3e50;
  color: white;
  border: none;
  padding: 12px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.toolbar-btn:active {
  background: #1a252f;
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.items-panel {
  flex: 2;
  background: #fff;
  padding: 20px;
  overflow-y: auto;
  border-right: 2px solid #ddd;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.item-tile {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  user-select: none;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.item-tile:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.item-price {
  font-size: 18px;
  font-weight: 700;
}

.order-panel {
  flex: 1;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  min-width: 350px;
}

.order-header {
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-header h2 {
  font-size: 20px;
  margin: 0;
}

.clear-btn {
  background: #e74c3c;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.clear-btn:active {
  transform: scale(0.9);
}

.order-items {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.order-item {
  background: white;
  padding: 10px 15px;
  margin-bottom: 8px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
  cursor: pointer;
}

.order-item:hover {
  background: #ffe6e6;
}

.order-item:active {
  background: #ffcccc;
}

.order-item-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-item-name {
  font-weight: 600;
  font-size: 14px;
}

.order-item-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-item-qty {
  background: #3498db;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.order-item-price {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

.remove-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.order-summary {
  background: white;
  padding: 20px;
  border-top: 2px solid #ddd;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
}

.summary-row.total {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  padding-top: 10px;
  border-top: 2px solid #ddd;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 15px;
}

.pay-action {
  margin-top: 15px;
}

.btn-pay {
  width: 100%;
  padding: 18px;
  background: #27ae60;
  color: white;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-pay:active {
  transform: scale(0.97);
}

.btn {
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #27ae60;
  color: white;
}

.btn-secondary {
  background: #3498db;
  color: white;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-warning {
  background: #f39c12;
  color: white;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-close-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #e74c3c;
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.modal-close-btn:active {
  transform: translateY(-50%) scale(0.9);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.numpad-btn {
  padding: 20px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s;
}

.numpad-btn:active {
  background: #3498db;
  color: white;
  transform: scale(0.95);
}

.numpad-btn.wide {
  grid-column: span 2;
}

.numpad-btn.ok {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
}

.numpad-btn.ok:active {
  background: #229954;
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.currency-btn {
  padding: 20px;
  border: 2px solid #27ae60;
  background: #ecf9f2;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: #27ae60;
}

.currency-btn:active {
  background: #27ae60;
  color: white;
}

.lock-screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0a0a0a;
  z-index: 3000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
}

.lock-screen.active {
  display: flex;
}

.lock-screen.locked {
  cursor: pointer;
}

.lock-screen.unlocking .modal-content {
  display: block;
}

.lock-screen.locked .modal-content {
  display: none;
}

.lock-icon {
  font-size: 120px;
  margin-bottom: 30px;
  position: relative;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.3));
}

.lock-icon svg {
  width: 120px;
  height: 120px;
}

.lock-title {
  color: white;
  font-size: 28px;
  margin-bottom: 30px;
  opacity: 0;
  transition: opacity 0.3s;
}

.lock-screen.unlocking .lock-title {
  opacity: 1;
}

.lock-screen.unlocking .lock-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.display-value {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.change-display {
  background: #d4edda;
  color: #155724;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin: 20px 0;
  font-size: 28px;
  font-weight: 700;
}

.completed-order {
  background: white;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s;
  border: 2px solid #ddd;
}

.completed-order:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: #3498db;
}

.order-header-info {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 8px;
}

.order-time {
  color: #666;
  font-size: 14px;
}

.order-detail-section {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.order-detail-items {
  margin: 10px 0;
}

.order-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}

.order-detail-item:last-child {
  border-bottom: none;
}

.mobile-toggle {
  display: none;
}

.mobile-notification {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: #0f0;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid #0f0;
  box-shadow: 0 0 10px rgba(0,255,0,0.3);
}

.mobile-notification.show {
  opacity: 1;
}

.payment-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  z-index: 200;
  cursor: pointer;
  transition: transform 0.3s;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

.payment-bar.visible {
  display: block;
}

.payment-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-bar-total {
  font-size: 24px;
  font-weight: 700;
}

.payment-bar-label {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.payment-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2500;
  flex-direction: column;
  overflow-y: auto;
}

.payment-overlay.active {
  display: flex;
}

.payment-overlay-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.payment-overlay-header {
  background: #2c3e50;
  color: white;
  padding: 20px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.payment-overlay .btn-pay {
  margin: 20px;
  padding: 25px;
  font-size: 22px;
}

#drawerModal .action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

#drawerModal .btn-danger {
  order: -1;
  align-self: flex-start;
  padding: 10px 20px;
  font-size: 14px;
}

#drawerModal .btn-primary {
  padding: 25px;
  font-size: 18px;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
    position: relative;
  }

  .items-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    border-right: none;
    border-bottom: none;
    z-index: 1;
    transition: transform 0.3s ease;
    padding-bottom: 80px;
  }

  .order-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    min-width: 100%;
    z-index: 2;
    transition: transform 0.3s ease;
  }

  .items-panel.hidden {
    transform: translateX(-100%);
  }

  .order-panel.hidden {
    transform: translateX(100%);
  }

  .mobile-toggle {
    display: flex;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    transition: transform 0.2s;
  }

  .mobile-toggle:active {
    transform: scale(0.9);
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .item-tile {
    padding: 15px;
    min-height: 80px;
  }

  .item-name {
    font-size: 14px;
  }

  .item-price {
    font-size: 16px;
  }

  .modal-content {
    max-height: none;
    height: 100vh;
    max-width: none;
    width: 100%;
    border-radius: 0;
    padding: 20px;
  }

  #discountModal {
    z-index: 2000;
  }

  #paymentModal {
    z-index: 1500;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.lock-icon-inner {
  animation: pulse 3s ease-in-out infinite;
}

.display-value {
	display: none;
}


