:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-strong: #eef3f2;
  --text: #172126;
  --muted: #66767c;
  --line: #d8e0e4;
  --accent: #0f766e;
  --accent-strong: #0a514c;
  --amber: #b7791f;
  --steel: #46565e;
  --danger: #a33d2d;
  --shadow: 0 18px 42px rgba(30, 42, 48, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  min-height: 38px;
  padding: 8px 11px;
}

button:hover {
  border-color: #aebbc0;
}

.catalog-shell {
  min-height: 100vh;
  padding: 20px;
}

.catalog-hero {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 20px;
  max-width: 1500px;
  margin: 0 auto 16px;
  min-height: 270px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 28px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.brand-mark {
  color: var(--accent-strong);
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 620px;
  font-size: 44px;
  line-height: 1.02;
  font-weight: 780;
}

.hero-media {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 270px;
}

.catalog-hero img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 270px;
  object-fit: cover;
}

.catalog-workspace {
  display: grid;
  grid-template-columns: 282px minmax(0, 1fr);
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto;
}

.filter-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.filter-panel {
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #36484f;
  font-size: 12px;
  font-weight: 720;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  min-height: 38px;
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

#clearFilters {
  background: var(--surface-strong);
}

.results-panel {
  min-width: 0;
  padding: 16px;
}

.results-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.results-bar h2 {
  font-size: 18px;
  line-height: 1.2;
}

.results-bar p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.category-picker {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.category-nav {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-height: 52px;
  padding: 0;
  background: #f7f9fa;
  color: var(--steel);
  font-size: 26px;
  line-height: 1;
}

.category-nav:disabled {
  cursor: default;
  opacity: 0.38;
}

.category-strip {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 3px max(16px, calc(50% - 130px)) 12px;
  scroll-padding-inline: 50%;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-strip button {
  align-items: center;
  display: flex;
  flex: 0 0 clamp(178px, 27vw, 260px);
  gap: 8px;
  justify-content: center;
  min-height: 52px;
  padding: 8px 10px;
  background: #f7f9fa;
  color: var(--steel);
  scroll-snap-align: center;
  text-align: center;
}

.category-strip button:focus-visible,
.category-nav:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
  outline: none;
}

.category-strip button.is-active {
  border-color: var(--accent);
  background: #e7f3f1;
  color: var(--accent-strong);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.12);
}

.category-name {
  display: -webkit-box;
  line-height: 1.18;
  max-height: 2.36em;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.category-count {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(70, 86, 94, 0.1);
  color: inherit;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  min-width: 30px;
  padding: 5px 7px;
}

.category-strip button.is-active .category-count {
  background: rgba(15, 118, 110, 0.15);
}

.table-frame {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f6;
  color: #43545b;
  font-size: 12px;
  font-weight: 760;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:hover {
  background: #fbfcfd;
}

.item-title {
  display: block;
  max-width: 320px;
  font-weight: 760;
  line-height: 1.35;
}

.item-detail,
.source-note,
.field-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-preview {
  max-width: 430px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 760;
  padding: 4px 8px;
}

.status-in-stock {
  background: #e6f3ed;
  color: #146c43;
}

.status-out-of-stock {
  background: #f8e7e2;
  color: var(--danger);
}

.status-on-request {
  background: #fbf0da;
  color: var(--amber);
}

.status-unknown {
  background: #eef2f4;
  color: var(--steel);
}

.view-button {
  min-width: 74px;
  min-height: 34px;
  padding: 6px 10px;
}

.empty-row td {
  color: var(--muted);
  padding: 28px 11px;
}

.detail-drawer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: flex-end;
  background: rgba(17, 28, 34, 0.28);
  z-index: 20;
}

.detail-drawer.is-open {
  display: flex;
}

.drawer-card {
  width: min(540px, 100%);
  height: 100%;
  overflow: auto;
  background: var(--surface);
  box-shadow: -18px 0 42px rgba(20, 35, 43, 0.16);
  padding: 20px;
}

.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.drawer-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.drawer-heading h2 {
  font-size: 22px;
  line-height: 1.2;
  margin-top: 4px;
}

dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.drawer-field {
  display: grid;
  grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 1040px) {
  .catalog-hero,
  .catalog-workspace {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .catalog-shell {
    padding: 12px;
  }

  .catalog-hero {
    gap: 0;
  }

  .hero-copy {
    padding: 18px;
  }

  h1 {
    font-size: 32px;
  }

  .results-bar {
    flex-direction: column;
  }

  .category-picker {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
    margin-left: -4px;
    margin-right: -4px;
  }

  .category-nav {
    width: 36px;
    min-height: 50px;
    font-size: 23px;
  }

  .category-strip {
    gap: 8px;
    padding-inline: max(12px, calc(50% - 112px));
  }

  .category-strip button {
    flex-basis: min(72vw, 224px);
    min-height: 50px;
  }

  .drawer-field {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
