/* ============================================================
   MULTI SYSTEM — POS (Punto de Venta)
   ============================================================ */

.pos-shell {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  height: calc(100vh - 64px - 52px); /* topbar + padding */
}

/* -------------------- Columna izquierda: catálogo -------------------- */
.pos-catalog {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pos-search-bar {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.pos-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.pos-search-input-wrap svg { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.pos-search-input-wrap input {
  border: none; background: transparent; outline: none;
  color: var(--text); font-family: var(--font-body); font-size: 14.5px; width: 100%;
}
.pos-search-input-wrap input::placeholder { color: var(--text-faint); }

.pos-categories {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pos-categories::-webkit-scrollbar { height: 0; }

.pos-cat-chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.pos-cat-chip.active {
  background: linear-gradient(135deg, var(--accent-3), var(--accent), var(--accent-2));
  color: #05100e;
  border-color: transparent;
}

.pos-product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  align-content: start;
}

.pos-product-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.08s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}
.pos-product-card:hover { border-color: var(--accent); }
.pos-product-card:active { transform: scale(0.97); }

.pos-product-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
}
.pos-product-thumb img { width: 100%; height: 100%; object-fit: cover; }

.pos-product-name {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pos-product-price {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}

.pos-product-stock {
  font-size: 10.5px;
  color: var(--text-faint);
}
.pos-product-stock.low { color: var(--warning); }
.pos-product-stock.out { color: var(--danger); }

/* -------------------- Columna derecha: carrito -------------------- */
.pos-cart {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pos-cart-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.pos-customer-select {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.pos-customer-select svg { width: 15px; height: 15px; flex-shrink: 0; }
.pos-customer-select .name { color: var(--text); font-weight: 600; }

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
}

.pos-cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pos-cart-item:last-child { border-bottom: none; }

.pos-cart-item-info { flex: 1; min-width: 0; }
.pos-cart-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pos-cart-item-price { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.pos-qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pos-qty-btn {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.pos-qty-value { font-size: 13px; font-weight: 700; min-width: 20px; text-align: center; }

.pos-cart-item-right { text-align: right; flex-shrink: 0; }
.pos-cart-item-subtotal { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--text); }
.pos-cart-item-remove {
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 11px; margin-top: 8px; padding: 0;
}
.pos-cart-item-remove:hover { color: var(--danger); }

.pos-cart-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 50px 20px;
  font-size: 13px;
}

.pos-cart-summary {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.pos-summary-row.total {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
  margin: 10px 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-cobrar {
  font-size: 16px;
  padding: 16px;
}

/* -------------------- Extras específicos de pago (el modal base vive en dashboard.css) -------------------- */
.payment-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.payment-method-chip {
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.payment-method-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.change-display {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
}
.change-display .amount { font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.cash-gate {
  height: calc(100vh - 64px - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cash-gate-box {
  text-align: center;
  max-width: 380px;
}
.cash-gate-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.cash-gate-icon svg { width: 26px; height: 26px; }

/* -------------------- Responsive -------------------- */
@media (max-width: 900px) {
  .pos-shell { grid-template-columns: 1fr; height: auto; }
  .pos-catalog { height: 60vh; }
  .pos-cart { height: auto; }
}
