.catalog {
  margin-top: clamp(34px, 3.8vw, 54px);
  scroll-margin-top: 16px;
}
.catalog-header { display: grid; gap: 10px; margin-bottom: 16px; }
.catalog-header h2 {
  font-size: clamp(2rem, 4.4vw, 4rem);
  line-height: 1.07;
  font-weight: 780;
  letter-spacing: -.028em;
}
.catalog-demo { max-width: 64ch; color: var(--muted); font-size: .89rem; }
.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: clamp(14px, 2vw, 26px);
  border-bottom: 1px solid var(--divider);
}
.catalog-filters button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: 580 .91rem/1.2 var(--font-text);
  min-height: 44px;
  padding: 8px 5px;
  cursor: pointer;
}
.catalog-filters button:hover { color: var(--ink); }
.catalog-filters button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--ink); }

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  list-style: none;
  padding: 0;
  margin: 0;
}
.product-card {
  display: grid;
  grid-template-columns: minmax(90px, .85fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  width: 100%;
  height: 100%;
  border: 1px solid var(--divider);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  padding: 9px;
  text-align: left;
}
.product-photo { display: block; background: var(--paper); }
.product-photo img, .detail-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.product-photo img { aspect-ratio: 1; }
.product-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 13px 8px 0;
  font: 650 clamp(.98rem, 1.4vw, 1.3rem)/1.18 var(--font-text);
}
.product-copy::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid var(--accent);
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
  position: absolute;
  bottom: 15px;
  right: 2px;
}
.product-price { font-size: clamp(1.13rem, 2vw, 1.8rem); white-space: normal; }
.product-price span, .detail-price span { color: var(--muted); font: 500 .84rem/1.2 var(--font-text); }
.product-card:hover { border-color: var(--accent); }
.product-card:hover .product-name { text-decoration: underline; text-underline-offset: .15em; }

.product-details {
  width: min(840px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.product-details::backdrop { background: rgba(16, 16, 16, .8); }
.detail-panel {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  column-gap: clamp(16px, 3vw, 32px);
  row-gap: 12px;
  align-items: start;
  padding: 18px;
}
.detail-close { grid-column: 1 / -1; justify-self: end; }
.detail-close button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font: 650 .9rem/1.2 var(--font-text);
  min-height: 44px;
  padding: 8px 14px;
  cursor: pointer;
}
.detail-close button:hover { border-color: var(--accent); }
.detail-media p { color: var(--muted); margin-top: 6px; font-size: .82rem; }
.detail-copy { display: grid; gap: 12px; }
.detail-copy h2 { font-size: clamp(1.6rem, 3.2vw, 2.75rem); line-height: 1.05; text-align: left; letter-spacing: -.035em; }
.detail-price { font: 760 2.3rem/1 var(--font-text); }
.detail-description { font-size: 1rem; }

@media (max-width: 980px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 570px) {
  .catalog-grid, .detail-panel { grid-template-columns: minmax(0, 1fr); }
  .product-card { grid-template-columns: minmax(90px, .64fr) minmax(0, 1fr); }
}
