/* Product Cards */

:root {
  --pc-bg: #ffffff;
  --pc-border: #f1f3f5;
  --pc-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
  --pc-shadow-hover: 0 8px 25px rgba(16, 24, 40, 0.15);
  --pc-radius: 12px;

  --pc-gray-50: #f9fafb;
  --pc-gray-100: #f3f4f6;
  --pc-gray-200: #e5e7eb;
  --pc-gray-300: #d1d5db;
  --pc-gray-400: #9ca3af;
  --pc-gray-500: #6b7280;
  --pc-gray-600: #4b5563;
  --pc-gray-700: #374151;
  --pc-gray-800: #1f2937;
  --pc-gray-900: #111827;

  --pc-primary: #2563eb;
  --pc-primary-hover: #1d4ed8;
  --pc-success: #10b981;
  --pc-success-bg: #ecfdf5;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--pc-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  box-shadow: var(--pc-shadow);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pc-shadow-hover);
  border-color: var(--pc-gray-200);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pc-primary) 0%, var(--pc-success) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-card:hover::before {
  opacity: 1;
}

/* Header */
.product-card__header {
  padding: 20px 20px 16px;
  background: var(--pc-gray-50);
  border-bottom: 1px solid var(--pc-gray-100);
}

.product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-card .store-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pc-gray-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  background: var(--pc-gray-200);
  border-radius: 6px;
}

.product-card .quantity-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--pc-success);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

/* Content */
.product-card__content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .product-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--pc-gray-900);
  line-height: 1.4;
  margin: 0 0 16px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .product-details {
  margin-bottom: 16px;
  flex: 1;
}

.product-card .detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--pc-gray-100);
}

.product-card .detail-item:last-child {
  border-bottom: none;
}

.product-card .detail-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--pc-gray-700);
}

.product-card .detail-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--pc-gray-900);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  background: var(--pc-gray-100);
  padding: 3px 8px;
  border-radius: 4px;
}

.product-card .status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--pc-success-bg);
  color: var(--pc-success);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  align-self: flex-start;
}

/* Actions */
.product-card__actions {
  padding: 16px 20px 20px;
  background: var(--pc-gray-50);
  border-top: 1px solid var(--pc-gray-100);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card .action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.product-card .action-btn--primary {
  background: var(--pc-primary);
  color: white;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.product-card .action-btn--primary:hover {
  background: var(--pc-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
  color: white;
  text-decoration: none;
}

.product-card .action-btn--secondary {
  background: white;
  color: var(--pc-gray-800);
  border-color: var(--pc-gray-300);
}

.product-card .action-btn--secondary:hover {
  background: var(--pc-gray-800);
  border-color: var(--pc-gray-800);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .product-card__content,
  .product-card__header,
  .product-card__actions {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 768px) {
  .product-card .product-title {
    font-size: 16px;
  }

  .product-card .action-btn {
    padding: 12px 16px;
  }
}

/* Loading state */
.products-card-container.loading {
  position: relative;
  pointer-events: none;
}

.products-card-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid var(--pc-gray-200);
  border-top: 3px solid var(--pc-primary);
  border-radius: 50%;
  animation: pc-spin 1s linear infinite;
  z-index: 10;
}

@keyframes pc-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Empty state */
.products-card-container .card.bg-light {
  border: 2px dashed var(--pc-gray-300) !important;
  background: var(--pc-gray-50) !important;
  border-radius: var(--pc-radius) !important;
}

.products-card-container .card.bg-light .card-body {
  padding: 3rem 2rem;
  text-align: center;
}

.products-card-container .card.bg-light i {
  color: var(--pc-gray-400);
  margin-bottom: 1rem;
}

/* Focus styles for accessibility */
.product-card .action-btn:focus {
  outline: 2px solid var(--pc-primary);
  outline-offset: 2px;
}

.product-card .action-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  :root {
    --pc-bg: #1f2937;
    --pc-border: #374151;
    --pc-gray-50: #374151;
    --pc-gray-100: #4b5563;
    --pc-gray-900: #f9fafb;
  }
}