:root {
  --bg: #f6f9fd;
  --surface: #ffffff;
  --surface-strong: #e6edf7;
  --soft: #f4f8fc;
  --ink: #2e2f31;
  --muted: #6f7884;
  --line: #dbe5f2;
  --accent: #3462aa;
  --accent-strong: #224478;
  --accent-soft: #e3f5f9;
  --signal: #60ab67;
  --warning: #e15261;
  --shadow: 0 18px 45px rgba(34, 68, 120, 0.13);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

.site-header__main {
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 10px clamp(16px, 4vw, 48px);
}

.site-header__trust {
  display: flex;
  gap: 18px;
  align-items: center;
  overflow-x: auto;
  padding: 7px clamp(16px, 4vw, 48px);
  border-top: 1px solid #e6edf7;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.site-header__trust span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--signal);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 800;
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--accent-strong);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: end;
}

.header-contact {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-align: right;
}

.header-contact strong {
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

.cart-button,
.primary-button,
.ghost-button,
.drawer__close,
.category-list button,
.panel-heading button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.cart-count {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--warning);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
}

main {
  padding: 0 clamp(14px, 4vw, 48px) 48px;
}

.workbench {
  padding: 38px 0 0;
}

.workbench__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 28px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.source-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.source-panel div {
  display: grid;
  gap: 3px;
  min-height: 88px;
  align-content: center;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.source-panel div:last-child {
  border-right: 0;
}

.source-panel span {
  font-size: 26px;
  font-weight: 800;
}

.source-panel small {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 14px;
  margin-bottom: 18px;
}

.search-box,
.select-field,
.order-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box input,
.select-field select,
.order-form input,
.order-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
}

.order-form textarea {
  min-height: 96px;
  padding-top: 12px;
  resize: vertical;
}

.catalog-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.category-panel,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.category-panel {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 110px);
  overflow: hidden;
}

.panel-heading,
.results-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.results-panel__head h2,
.results-panel__head p {
  margin: 0;
}

.results-panel__head p {
  color: var(--muted);
  font-size: 14px;
}

.panel-heading button,
.ghost-button {
  padding: 0 12px;
  color: var(--accent-strong);
}

.category-list {
  display: grid;
  gap: 3px;
  max-height: calc(100vh - 184px);
  overflow: auto;
  padding: 10px;
}

.category-list button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  color: var(--ink);
  border-color: transparent;
}

.category-list button:hover,
.category-list button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.category-list small {
  color: var(--muted);
  font-weight: 700;
}

.results-panel {
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
}

.product-card {
  display: grid;
  grid-template-rows: 150px auto;
  min-width: 0;
  min-height: 356px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(52, 98, 170, 0.14);
}

.product-card__image {
  display: grid;
  place-items: center;
  height: 150px;
  background: var(--surface-strong);
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-card__body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.product-card h3 {
  display: -webkit-box;
  min-height: 46px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-card p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.price-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  font-weight: 800;
}

.price-line small {
  color: var(--muted);
  font-weight: 600;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 0 18px 22px;
}

.primary-button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.direction-band {
  display: grid;
  gap: 18px;
  margin-top: 40px;
  padding: 28px 0 0;
}

.direction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.direction-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.direction-card strong {
  font-size: 17px;
}

.direction-card span {
  color: var(--muted);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.drawer.is-open {
  display: block;
}

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(46, 47, 49, 0.42);
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  gap: 18px;
  width: min(920px, 96vw);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.drawer__panel--cart {
  width: min(620px, 96vw);
}

.drawer__close {
  justify-self: end;
  padding: 0 12px;
}

.product-detail {
  display: grid;
  gap: 20px;
}

.product-detail__hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.product-detail__image {
  display: grid;
  width: 100%;
  min-width: 0;
  align-self: start;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.product-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.sku-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 14px;
}

.sku-table th,
.sku-table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sku-table th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

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

.sku-table button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  white-space: nowrap;
}

.cart-view {
  display: grid;
  gap: 18px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item strong {
  display: block;
  margin-bottom: 4px;
}

.cart-item small {
  color: var(--muted);
}

.qty-control {
  display: inline-grid;
  grid-template-columns: 32px 42px 32px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-control button,
.qty-control span {
  display: grid;
  place-items: center;
  border: 0;
  background: #ffffff;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-strong);
  font-weight: 800;
}

.order-form {
  display: grid;
  gap: 12px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 28px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
}

.site-footer strong {
  color: var(--ink);
}

.empty-state {
  padding: 26px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .site-header__main {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }

  .top-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    order: 3;
    overflow-x: auto;
    padding: 2px 0 4px;
  }

  .workbench__top,
  .catalog-shell,
  .product-detail__hero,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .category-panel {
    position: static;
    max-height: none;
  }

  .category-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    max-height: 360px;
  }
}

@media (max-width: 640px) {
  .site-header__main {
    gap: 10px;
    min-height: auto;
  }

  .brand-copy span,
  .cart-button__label,
  .header-contact {
    display: none;
  }

  main {
    padding-inline: 12px;
  }

  .toolbar,
  .source-panel {
    grid-template-columns: 1fr;
  }

  .source-panel div {
    min-height: 68px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .source-panel div:last-child {
    border-bottom: 0;
  }

  h1 {
    font-size: 32px;
  }

  .lead {
    font-size: 16px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .results-panel__head,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .drawer__panel {
    width: 100vw;
    padding: 16px;
  }

  .site-header__trust {
    padding-inline: 12px;
  }

  .top-nav a {
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
  }
}
