/* ====================
   TABELA DE PRODUTOS
   ==================== */

.products-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.products-table table {
  width: 100%;
  border-collapse: collapse;
}

.products-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.products-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.products-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.products-table tbody tr:hover {
  background: #f7fafc;
}

.products-table tbody tr.row-hidden {
  opacity: 0.5;
  background: #f1f5f9;
}

.products-table td {
  padding: 1rem;
  vertical-align: middle;
}

/* Imagem do Produto na Tabela */
.table-product-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
}

.table-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-product-image .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7fafc;
  color: #a0aec0;
}

/* Info do Produto */
.table-product-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.table-product-info strong {
  font-size: 1rem;
  color: #2d3748;
}

.table-product-info small {
  font-size: 0.85rem;
  color: #718096;
}

/* Preços */
.price-normal {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
}

.input-preco-promo {
  width: 120px;
  padding: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e53e3e;
  transition: all 0.3s ease;
}

.input-preco-promo:focus {
  outline: none;
  border-color: #f56565;
  box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.1);
}

.input-preco-promo::placeholder {
  color: #cbd5e0;
}

.input-preco-promo.changed {
  border-color: #f59e0b;
  background: #fff7ed;
}

.promo-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.promo-save-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #4b5563;
  transition: all 0.2s ease;
}

.promo-save-btn.active {
  background: #4f46e5;
  border-color: #4338ca;
  color: #ffffff;
}

.promo-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
}

.promo-save-btn:not(:disabled):hover {
  background: #4338ca;
  color: #ffffff;
}

.icon-spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Badge de Estoque */
.stock-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.stock-badge.in-stock {
  background: #c6f6d5;
  color: #22543d;
}

.stock-badge.out-stock {
  background: #fed7d7;
  color: #742a2a;
}

/* Status Badges */
.status-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.badge-success {
  background: #c6f6d5;
  color: #22543d;
  border-color: #9ae6b4;
}

.badge-secondary {
  background: #e2e8f0;
  color: #4a5568;
  border-color: #cbd5e0;
}

.badge-info {
  background: #bee3f8;
  color: #2c5282;
  border-color: #90cdf4;
}

.badge-warning {
  background: #feebc8;
  color: #7c2d12;
  border-color: #fbd38d;
}

.badge-light {
  background: #f7fafc;
  color: #a0aec0;
  border-color: #e2e8f0;
  cursor: pointer;
}

.badge-light:hover {
  background: #e2e8f0;
  border-color: #cbd5e0;
}

/* Ações da Tabela */
.table-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  padding: 0.6rem;
  border: none;
  background: #f7fafc;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4a5568;
}

.btn-icon:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* Responsividade */
@media (max-width: 1024px) {
  .products-table {
    overflow-x: auto;
  }
  
  .products-table table {
    min-width: 900px;
  }
}

@media (max-width: 768px) {
  .products-table th,
  .products-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }
  
  .table-product-image {
    width: 50px;
    height: 50px;
  }
  
  .input-preco-promo {
    width: 100px;
  }
  
  .status-badges {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

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

.products-table tbody tr {
  animation: fadeIn 0.3s ease;
}

.products-table tbody tr:nth-child(even) {
  animation-delay: 0.05s;
}
