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

.product-category-grid {
  display: grid;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-category-card {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.product-category-card:last-child {
  border-bottom: 0;
}

.product-category-card:hover,
.product-category-card.is-active {
  background: #f7f4ed;
  color: #ff2b1f;
}

.product-category-card.is-active {
  box-shadow: inset 3px 0 0 #ff2b1f;
}

.product-category-card span {
  display: block;
}

.compact-product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-product-card {
  display: grid;
  grid-template-columns: minmax(180px, 42%) minmax(0, 1fr);
  grid-template-areas:
    "image header"
    "image note"
    "image specs"
    "image tags"
    "image action";
  column-gap: 18px;
  align-content: start;
  min-height: 300px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(40, 34, 24, 0.08);
}

.compact-product-image {
  display: block;
  overflow: hidden;
  grid-area: image;
  min-height: 270px;
  border-radius: 6px;
  background: #f4f1ea;
}

.compact-product-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 270px;
  object-fit: contain;
  transition: transform 220ms ease;
}

.compact-product-image:hover img {
  transform: scale(1.03);
}

.compact-product-placeholder {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 220px;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(31, 111, 91, 0.35);
  color: var(--primary-strong);
  background:
    linear-gradient(135deg, rgba(31, 111, 91, 0.08), rgba(179, 71, 46, 0.06)),
    var(--surface-strong);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
}

.placeholder-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-product-card[hidden] {
  display: none;
}

.compact-product-top {
  display: flex;
  grid-area: header;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.compact-product-card h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

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

.product-code {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.product-specs {
  display: grid;
  grid-area: specs;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.product-specs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.product-specs strong {
  color: var(--ink);
  text-align: right;
}

.product-tags {
  display: flex;
  grid-area: tags;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.product-link-row {
  display: flex;
  grid-area: action;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.qc-state {
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 1080px) {
  .product-browser {
    grid-template-columns: 1fr;
  }

  .product-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-category-card {
    border-right: 1px solid var(--line);
  }

  .compact-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-product-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "header"
      "note"
      "specs"
      "tags"
      "action";
  }

  .compact-product-image,
  .compact-product-image img {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .product-category-grid {
    grid-template-columns: 1fr;
  }

  .product-category-card {
    border-right: 0;
  }

  .compact-product-grid {
    grid-template-columns: 1fr;
  }

  .compact-product-card {
    min-height: 0;
  }

  .compact-product-image,
  .compact-product-image img {
    min-height: 280px;
  }
}
