:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e1ec;
  --surface: #ffffff;
  --wash: #f5f7fb;
  --soft: #eef6f5;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--wash);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(16px, 5vw, 44px);
  background: #0f172a;
  color: white;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}

.eyebrow {
  margin: 0 0 3px;
  color: #99f6e4;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
}

.status {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: #e2e8f0;
}

main {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 4vw, 28px) 34px;
}

.tools {
  display: block;
  margin: 8px 0 14px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search {
  position: relative;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.category-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  background: white;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.category-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
}

.suggestions {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.suggestion {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 6px 9px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover,
.suggestion:focus {
  background: #f8fafc;
}

.suggestion img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.suggestion-title {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.suggestion strong {
  color: var(--accent-strong);
  font-size: 12px;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.catalog {
  border: 0;
  background: transparent;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.product-row {
  display: flex;
  min-width: 0;
  min-height: 324px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.product-main {
  min-width: 0;
  padding: 10px;
}

.image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.product-text {
  min-width: 0;
}

.brand {
  display: none;
}

.product-row h2 {
  display: -webkit-box;
  min-height: 42px;
  margin: 8px 0 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.meta {
  display: none;
}

.price-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
}

.price-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.price-cell strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-align: right;
}

.public-price {
  background: #fbfdfd;
}

.product-row.retail-only .bulk-price {
  display: none;
}

.locked-prices {
  min-width: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
}

.lock-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.lock-icon {
  font-size: 20px;
}

.private-prices {
  display: none;
  height: 100%;
  grid-template-columns: 1fr;
}

.locked-prices.unlocked .lock-button {
  display: none;
}

.locked-prices.unlocked .private-prices {
  display: grid;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
}

.pagination button {
  min-width: 44px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-buttons {
  display: flex;
  gap: 6px;
}

dialog {
  width: min(420px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dialog-card {
  padding: 20px;
}

.dialog-card h2 {
  margin: 0 0 8px;
}

.dialog-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.error {
  min-height: 18px;
  color: var(--danger) !important;
  font-size: 13px;
}

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

.dialog-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
  cursor: pointer;
}

.dialog-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

@media (max-width: 1180px) {
  .product-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .product-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary {
    flex-direction: column;
  }

  .product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-row {
    min-height: 294px;
  }

  .product-main {
    padding: 8px;
  }

  .image-wrap {
    max-height: 112px;
  }

  .product-row h2 {
    min-height: 48px;
    font-size: 12px;
  }

  .price-cell {
    padding: 6px 8px;
  }

  .price-cell strong {
    font-size: 12px;
  }
}
