/* Estilos para o PDV */
:root {
  --primary-color: #6f42c1;
  --secondary-color: #ff6b6b;
  --success-color: #28a745;
  --light-bg: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #2c3e50;
  --text-muted: #6c757d;
  --border-radius: 12px;
  --box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  --box-shadow-inset: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
  --transition: all 0.3s ease;
}

/* Layout Principal */
.pdv-container {
  padding: 1rem;
  background-color: var(--light-bg);
  min-height: calc(100vh - 56px);
}

/* Cards de Produto */
.product-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.05);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.product-image {
  position: relative;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Botão de Adicionar */
.btn-add-to-cart {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-card:hover .btn-add-to-cart {
  opacity: 1;
  transform: translateY(0);
}

.btn-add-to-cart:hover {
  background: #5a32a8;
  transform: scale(1.1) !important;
}

/* Informações do Produto */
.product-info {
  padding: 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.8em;
  line-height: 1.4;
}

.product-price {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-top: auto;
}

.product-unit {
  font-size: 0.75rem;
  background: var(--light-bg);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
  display: inline-block;
}

/* Indicadores de Estoque */
.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 1;
  font-weight: 500;
}

/* Barra de Pesquisa */
.search-container {
  position: relative;
  max-width: 100%;
  margin-bottom: 1rem;
}

.search-input {
  padding-left: 40px;
  border-radius: 20px;
  border: 1px solid #e0e0e0;
  background: white;
  box-shadow: var(--box-shadow-inset);
  transition: var(--transition);
  height: 45px;
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.15);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 10;
}

/* Filtros */
.filters {
  margin-bottom: 1.5rem;
}

.filters .btn {
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  transition: var(--transition);
  margin-right: 8px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  background: white;
  color: var(--text-color);
}

.filters .btn.active, 
.filters .btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Carrinho */
.cart-items {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition);
}

.cart-item:hover {
  background: rgba(0,0,0,0.02);
}

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

.cart-item-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
  border: 1px solid #eee;
}

.cart-item-details {
  flex-grow: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.quantity-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.quantity-btn:hover {
  background: #e9ecef;
  color: var(--primary-color);
}

.quantity-input {
  width: 40px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin: 0 5px;
  padding: 2px;
  height: 28px;
}

.remove-item {
  color: #dc3545;
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
  margin-left: 8px;
}

.remove-item:hover {
  background: #f8d7da;
}

.cart-summary {
  background: #f8f9fa;
  padding: 20px;
  border-top: 1px solid #eee;
}

/* Responsividade */
@media (max-width: 768px) {
  .pdv-container {
    padding: 0.5rem;
  }
  
  .product-card {
    margin-bottom: 15px;
  }
  
  .cart-items {
    max-height: 300px;
  }
  
  .search-container {
    margin-bottom: 15px;
  }
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Estados */
.low-stock {
  border-left: 3px solid var(--secondary-color);
}

.out-of-stock {
  position: relative;
  opacity: 0.7;
}

.out-of-stock::after {
  content: 'ESGOTADO';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  text-align: center;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  padding: 5px;
  font-weight: bold;
  font-size: 0.8rem;
  transform: rotate(-5deg);
  pointer-events: none;
}

/* Ajustes gerais */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 1rem 1.25rem;
}

.btn {
  border-radius: var(--border-radius);
  padding: 8px 16px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(145deg, #4c1d95, #3b1a8c);
  color: white;
  box-shadow: 3px 3px 6px #2f1365,
                -1px -1px 4px #7c3aed,
                inset 1px 1px 1px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 2px 2px 6px #3b1a8c,
    0px 0px 6px #7c3aed;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.1rem;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
