.xref-tool {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.xref-primary-search-container,
.xref-secondary-search-container {
  margin-bottom: 30px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.search-box input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.form-select, #find-equivalents {
  padding: 10px 15px !important;
  font-size: 16px !important;
  border-radius: 4px !important;
}

.search-box button {
  padding: 10px 20px;
  background-color: #005EB8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.search-box button:hover {
  background-color: #004c94;
}

.xref-results-container,
.saved-products-container {
  margin-bottom: 30px;
  border: 1px solid #eee;
  border-radius: 5px;
  padding: 20px;
  background-color: #f9f9f9;
}

.results-info {
  margin-bottom: 15px;
  font-style: italic;
  color: #666;
}

.results-table-wrapper,
.saved-table-wrapper {
  overflow-x: auto;
}

table.results-table,
table.saved-products-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

table.results-table th,
table.saved-products-table th {
  background-color: #f1f1f1;
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
  border-bottom: 2px solid #ddd;
}

table.results-table td,
table.saved-products-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
}

table.results-table tr:hover,
table.saved-products-table tr:hover {
  background-color: #f5f5f5;
}

/* Add a "Best Match" label */
.highlighted-match td:nth-child(2)::after {
  content: "Best Match";
  background-color: #e1ffe2;
  color: #000;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
  display: inline-block;
}

/* Make sure the brand column can expand as needed (for best match label) */
table.results-table td:nth-child(2),
table.saved-products-table td:nth-child(2) {
  white-space: nowrap;
  min-width: 120px;
}

/* Let columns to expand */
table.results-table,
table.saved-products-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  table-layout: auto;
}

.saved-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#print-saved-products {
  background-color: #005EB8;
  color: white;
}

#print-saved-products:hover {
  background-color: #00498d;
}

#clear-saved-products {
  background-color: #f44336;
  color: white;
}

#clear-saved-products:hover {
  background-color: #d32f2f;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: #666;
}

/* Multi-search */
.search-group-header td {
  background-color: #e0e0e0;
  font-weight: bold;
  padding: 10px 15px;
  border-bottom: 2px solid #888;
  border-top: 2px solid #888;
}

.search-group-label {
  text-align: left;
  font-size: 1.1em;
}

/* Bootstrap overrides */
.btn-primary {
  background-color: #005EB8;
  border-color: #005EB8;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #004c94 !important;
  border-color: #004c94 !important;
}

.position-badge {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 3px;
  font-size: 0.8em;
  background-color: #e9ecef;
  color: #495057;
}

/* Product links */
.product-link {
  color: #005EB8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.product-link:hover {
  color: #004c94;
  text-decoration: underline;
}

.product-link:visited {
  color: #005EB8;
}

/* Help for PDF */
@media print {
  .product-link {
    color: #005EB8 !important;
    text-decoration: underline !important;
  }
}