/* Simple Product Rows for Order Messages - Informal Style */

/* Force maximum width for order message bubbles to prevent expansion */
.message-card.bubble-max-width-true {
  max-width: 55% !important;
  width: 55% !important;
}

.product-row-container {
  margin-bottom: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #f9f9f9;
  overflow: hidden;
  transition: background 0.2s ease;
}

.product-row-container:hover {
  background: #f5f5f5;
}

/* Product Header - Always Visible */
.product-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.product-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.product-row-line-1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-row-line-2 {
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.product-quantity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  background: #25D366;
  color: white;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.product-name-text {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-sync-warning {
  color: #ff9800;
  font-size: 12px;
  flex-shrink: 0;
}

.product-row-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.product-price-text {
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.product-toggle-icon {
  font-size: 12px;
  color: #666;
  transition: transform 0.2s ease;
}

/* Product Details - Collapsible */
.product-row-details {
  padding: 0 12px 10px 12px;
  border-top: 1px solid #e5e5e5;
  background: #fff;
}

.product-detail-image {
  padding: 10px 0 8px 0;
  text-align: center;
}

.product-detail-image img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  object-fit: cover;
}

.product-detail-item {
  display: flex;
  padding: 6px 0;
  font-size: 13px;
  gap: 8px;
}

.product-detail-label {
  color: #666;
  font-weight: 500;
  min-width: 110px;
  flex-shrink: 0;
}

.product-detail-value {
  color: #333;
  flex: 1;
  word-break: break-word;
}

.product-price-original {
  text-decoration: line-through;
  color: #999;
}

.product-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.stock-available {
  background: #d4edda;
  color: #155724;
}

.stock-unavailable {
  background: #f8d7da;
  color: #721c24;
}

.product-external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.product-external-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.product-external-link i {
  font-size: 11px;
}

/* Order Total Row */
.order-total-row {
  margin-top: 10px;
  padding: 10px 12px;
  background: #667eea;
  color: white;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.order-total-label {
  font-weight: 500;
}

.order-total-value {
  font-weight: 700;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 480px) {
  .product-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .product-row-right {
    width: 100%;
    justify-content: space-between;
  }

  .product-detail-item {
    flex-direction: column;
    gap: 2px;
  }

  .product-detail-label {
    min-width: auto;
  }
}

/* Flow Form Reply */
.flow-form-reply {
  border: 1px solid #d6ece6;
  border-radius: 10px;
  background: #f6fbf9;
  padding: 12px;
}

.flow-form-reply-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.flow-form-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #00644b;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-form-header-copy {
  min-width: 0;
}

.flow-form-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #171717;
}

.flow-form-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7090;
}

.flow-form-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.flow-form-field {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  padding: 8px 10px;
}

.flow-form-field-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7090;
  text-transform: uppercase;
}

.flow-form-field-value {
  margin: 0;
  font-size: 14px;
  color: #171717;
  white-space: pre-wrap;
  word-break: break-word;
}

.flow-form-attachments {
  margin-top: 10px;
}

.flow-form-attachments-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7090;
  text-transform: uppercase;
}

.flow-form-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.flow-form-attachment {
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.flow-form-attachment-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.flow-form-attachment-fallback {
  min-height: 120px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: flex-start;
}

.flow-form-attachment-fallback i {
  color: #00644b;
  font-size: 18px;
}

.flow-form-attachment-name {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #171717;
  word-break: break-word;
}

.flow-form-attachment-meta {
  margin: 0;
  font-size: 11px;
  color: #6b7090;
  word-break: break-word;
}

.flow-form-attachment-download {
  border: 1px solid #dcdceb;
  background: #fff;
  color: #00644b;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.flow-form-attachment-download:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
