/* Products Container */
.products-container {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
}

/* Mobile responsive adjustments for container */
@media (max-width: 991px) {
  .products-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6b7280;
}

.loading-state .spinning {
  animation: spin 1s linear infinite;
}

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

/* Error State */
.error-state {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  color: #dc2626;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.error-close {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
}

/* Filters Panel */
.filters-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 500;
  color: #374151;
  min-width: 60px;
}

.filter-group select {
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #374151;
}

/* Refresh Button */
.refresh-btn {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.refresh-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Product Info in Table */
.product-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-thumbnail {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.product-title {
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.25rem;
}

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

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  min-width: 200px;
}

.action-btn.primary {
  background: #1679e4;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.action-btn.primary:hover {
  background: #1d4ed8;
}

.action-btn.secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.action-btn.shopify {
  background: #95bf47;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-btn.shopify:hover:not(:disabled) {
  background: #7da639;
  transform: translateY(-1px);
}

.action-btn.shopify:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Upload Message */
.upload-message {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.upload-message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.upload-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.upload-message.info {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.products-container .spline-background {
  opacity: 0.3;
}

/* Products Main */
.products-main {
  flex: 1;
  margin-left: 80px; /* Only account for collapsed sidebar */
  padding: 2rem; /* Padding uniforme */

  position: relative;
  z-index: 1;
  width: auto; /* Larghezza automatica */
  max-width: 100%; /* Usa tutto lo spazio disponibile */
  transition: margin-left 0.3s ease;
  font-size: 0.875rem; /* Font size standard */
}

@media (max-width: 768px) {
  .products-main {
    margin-left: 0;
    margin-right: 0;
    width: 100vw;
    padding: 1rem;
  }
}

/* Specific mobile responsive adjustments for content (991px breakpoint) */
@media (max-width: 991px) {
  .products-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Products Header */
.products-header-clean {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.products-title-clean {
  font-size: 1.2rem; /* Much smaller */
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.products-subtitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Stats Row */
.products-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.product-stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.product-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.product-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #1679e4;
}

.product-stat-icon.active {
  background: #d4f4dd;
  color: #22c55e;
}

.product-stat-icon.draft {
  background: #fed7aa;
  color: #f97316;
}

.product-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.product-stat-label {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

/* Toolbar */
.products-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: #1679e4;
  box-shadow: 0 0 0 3px rgba(22, 121, 228, 0.1);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.875rem;
  color: #0f172a;
  background: transparent;
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box svg {
  color: #94a3b8;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Products Table */
.products-table-container {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);

}

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

.products-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.products-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.products-table tr:last-child td {
  border-bottom: none;
}

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

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
}

.status-badge.attivo {
  background: #d4f4dd;
  color: #16a34a;
}

.status-badge.bozza {
  background: #fed7aa;
  color: #ea580c;
}

.action-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #475569;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Mobile responsive adjustments for empty state */
@media (max-width: 991px) {
  .empty-state {
    margin-top: 11px;
  }
}

.empty-state svg {
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 1.5rem 0;
}













/* Responsive */
@media (max-width: 640px) {
  .products-header-clean {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .products-toolbar {
    flex-direction: column;
  }

  .products-table-container {
    overflow-x: auto;
  }

  .products-table {
    min-width: 600px;
  }
}
