/* ===========================
   PRODUCTO.CSS
   Carga: Solo vista producto
=========================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.product-card {
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
  transition: all 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: #444;
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #2a2a2a;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #666;
  background: #2a2a2a;
  padding: 10px;
  text-align: center;
}

.image-placeholder .material-icons {
  font-size: 48px;
  color: #444;
}

.image-loading {
  background: #252525;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(102, 102, 102, 0.3);
  border-radius: 50%;
  border-top-color: #666;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.product-body {
  padding: 20px;
}

.product-name {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.product-price {
  font-size: 24px;
  font-weight: 700;
  color: #10b981;
}

.stock-badge {
  padding: 4px 12px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
}

.product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-edit,
.btn-delete,
.btn-image {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  font-size: 13px;
}

.btn-edit {
  background: #3b82f6;
  color: white;
}

.btn-edit:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-image {
  background: #8b5cf6;
  color: white;
}

.btn-image:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

.btn-delete {
  background: #dc2626;
  color: white;
}

.btn-delete:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-actions {
    flex-direction: column;
  }

  .product-actions button {
    width: 100%;
    justify-content: center;
  }

  .product-price {
    font-size: 20px;
  }
}