:root {
  --theme-base-color: #163760;
  --theme-base-hover: #1c4575;
  --theme-base-opacity: #1637601a;
  --text: #555;
  --heading: #222;
  --border: #dadada;
  --stroke: #ededed;
  --bg: #fff;
  --bg-soft: #f7f8fa;
  --radius: 8px;
  --font: "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: linear-gradient(180deg, #eef2f6 0%, var(--bg) 220px);
}

a {
  color: var(--theme-base-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--stroke);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.brand img {
  display: block;
  height: 36px;
  width: auto;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  color: var(--heading);
}

.header-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--theme-base-color);
}

.header-link {
  font-weight: 600;
  white-space: nowrap;
}

main.container {
  padding: 40px 0 64px;
}

.search-panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--heading);
}

.lead {
  margin: 0 0 24px;
  max-width: 640px;
  line-height: 1.5;
}

.search-form {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(22, 55, 96, 0.06);
}

.search-row-wrap {
  position: relative;
}

.search-row {
  display: flex;
  gap: 12px;
}

.suggest-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 132px;
  z-index: 20;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(22, 55, 96, 0.12);
  overflow: hidden;
}

.suggest-title {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #888;
}

.suggest-list {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
}

.suggest-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--heading);
}

.suggest-item:hover {
  background: #f3f6fa;
}

.suggest-query {
  font-weight: 600;
}

.suggest-meta {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

.history-section {
  margin-top: 36px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
}

.btn-text {
  border: 0;
  background: transparent;
  color: var(--theme-base-color);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  text-decoration: underline;
}

.history-table {
  min-width: 560px;
}

.history-date {
  white-space: nowrap;
  color: #666;
  font-size: 13px;
}

.history-query {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--theme-base-color);
  cursor: pointer;
  text-align: left;
}

.history-query:hover {
  text-decoration: underline;
}

.mpn-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #777;
}

.stock-expected {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #8a6d1b;
  font-weight: 600;
}

.search-input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 16px;
  color: var(--heading);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--theme-base-color);
  box-shadow: 0 0 0 3px var(--theme-base-opacity);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--theme-base-color);
  border-color: var(--theme-base-color);
  color: #fff;
  min-width: 120px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--theme-base-hover);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.search-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: center;
  margin-top: 16px;
}

.check,
.sort-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--heading);
}

.sort-label select {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  font: inherit;
  background: var(--bg);
}

.status {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--bg-soft);
}

.status.is-error {
  border-color: #f0c2c2;
  background: #fff5f5;
  color: #8a1f1f;
}

.status.is-empty {
  color: var(--heading);
}

.results {
  margin-top: 24px;
}

.th-photo,
.td-photo {
  width: 72px;
}

.product-photo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 6px;
}

.product-photo.is-empty {
  background:
    linear-gradient(135deg, #f3f5f8 0%, #e8edf3 100%);
}

.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--theme-base-color);
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none !important;
}

.btn-card:hover {
  background: var(--theme-base-hover);
}

.btn-card.is-existing {
  background: #1f7a3f;
  border-color: #1f7a3f;
}

.btn-card.is-existing:hover {
  background: #186334;
}

.supplier-badge.is-lvt {
  background: #e8f5ee;
  color: #1f7a3f;
}

.mpn-sub.on-site {
  color: #1f7a3f;
}

.results-meta {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
}

.table-wrap {
  overflow-x: auto;
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

.results-table th,
.results-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
  vertical-align: top;
}

.results-table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--theme-base-color);
  background: var(--bg-soft);
}

.results-table tbody tr:hover {
  background: #f3f6fa;
}

.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.supplier-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--theme-base-opacity);
  color: var(--theme-base-color);
  font-size: 12px;
  font-weight: 700;
}

.mpn {
  font-weight: 600;
  color: var(--heading);
}

.desc {
  max-width: 280px;
  line-height: 1.4;
  font-size: 14px;
}

.stock-ok {
  color: #1f7a3f;
  font-weight: 600;
}

.stock-out {
  color: #a33;
}

.price {
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 20px 0 32px;
  font-size: 13px;
  color: #777;
}

@media (max-width: 720px) {
  .suggest-panel {
    right: 0;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
    gap: 12px;
  }

  .header-link {
    margin-left: auto;
  }

  .search-row {
    flex-direction: column;
  }

  .btn-primary {
    width: 100%;
  }

  .search-panel h1 {
    font-size: 24px;
  }
}

.check-hint {
  color: #999;
  font-size: 12px;
  font-weight: 400;
}
