*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

.pos-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */

.pos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #111827;
  color: #f9fafb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.brand-name {
  font-weight: 600;
}

/* Buttons */

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn.primary {
  background: #2563eb;
  color: #f9fafb;
}

.btn.secondary {
  background: #374151;
  color: #e5e7eb;
}

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

/* Main layout */

.pos-main {
  flex: 1;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
}

/* Panels */

.products-panel,
.cart-panel {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}

.products-panel {
  flex: 2;
  min-width: 0;
}

.cart-panel {
  flex: 1;
  min-width: 260px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.order-id {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Search */

.search-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}

/* Categories */

.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.75rem;
}

.chip {
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  cursor: pointer;
}

.chip-active {
  background: #2563eb;
  color: #f9fafb;
  border-color: #2563eb;
}

/* Products grid */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}

.product-card {
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  background: #f9fafb;
}

.product-card:hover {
  border-color: #2563eb;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.product-price {
  font-size: 0.85rem;
  color: #111827;
}

.product-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Cart */

.cart-items {
  flex: 1;
  min-height: 80px;
  max-height: 55vh;
  overflow-y: auto;
  border-radius: 0.5rem;
  border: 1px dashed #e5e7eb;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: #f9fafb;
}

.cart-empty {
  margin: 0;
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
  padding-top: 1rem;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  background: #ffffff;
  margin-bottom: 0.3rem;
}

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

.cart-item-name {
  font-weight: 500;
}

.cart-item-qty {
  font-size: 0.75rem;
  color: #6b7280;
}

.cart-item-price {
  font-weight: 500;
}

.cart-item-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Summary */

.cart-summary {
  border-top: 1px solid #e5e7eb;
  padding-top: 0.5rem;
}

.cart-summary .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.total-row {
  font-weight: 600;
  margin-top: 0.3rem;
}

.cart-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* RESPONSIVE */

/* Κινητά / μικρές οθόνες */
@media (max-width: 768px) {
  .pos-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .header-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .pos-main {
    flex-direction: column;
  }

  .cart-panel {
    min-width: 0;
  }

  .cart-items {
    max-height: 40vh;
  }
}

/* Mεγάλες οθόνες */
@media (min-width: 1200px) {
  .pos-main {
    padding: 1rem 1.5rem 1.5rem;
  }

  .products-panel,
  .cart-panel {
    padding: 1rem;
    border-radius: 1rem;
  }
}
