:root {
  --red: #21536c;
  --ink: #0f0f0f;
  --muted: #737373;
  --line: rgba(0, 0, 0, 0.1);
  --content: min(87%, 1440px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button, a { font: inherit; }

button { cursor: pointer; }

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

.product-catalog {
  width: var(--content);
  margin: 0 auto;
  padding: 30px 0 100px;
}

.catalog-tabs-wrap {
  display: block;
  min-height: 64px;
}

.catalog-tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.catalog-tabs::-webkit-scrollbar { display: none; }

.catalog-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  padding: 20px 28px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292929;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  transition: color 300ms ease;
}

.catalog-tab::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 550ms ease;
}

.catalog-tab:hover, .catalog-tab:focus-visible, .catalog-tab.is-active { color: var(--red); }
.catalog-tab:hover::after, .catalog-tab:focus-visible::after, .catalog-tab.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  outline: none;
}

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

.product-card__image {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1.15;
  border-radius: 10px;
  background: #fff;
}

.product-card img {
  display: block;
  width: 64%;
  height: auto;
  max-height: 80%;
  object-fit: contain;
  transition: transform 450ms cubic-bezier(0.2, 0.65, 0.2, 1);
}

.product-card__body {
  display: block;
  min-height: 83px;
  padding-top: 20px;
}

.product-card strong, .product-card small { display: block; }

.product-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.product-card__line {
  display: block;
  height: 1px;
  margin-top: 20px;
  background: var(--line);
  transform-origin: left;
  transition: background 220ms ease, transform 220ms ease;
}

.product-card:hover img, .product-card:focus-visible img { transform: scale(1.055); }
.product-card:hover .product-card__line, .product-card:focus-visible .product-card__line { background: var(--red); transform: scaleX(1.04); }
.product-card:focus-visible { border-radius: 10px; box-shadow: 0 0 0 3px rgba(33, 83, 108, 0.28); }

@media (max-width: 900px) {
  :root { --content: calc(100% - 40px); }

  .product-catalog { padding: 30px 0 58px; }
  .catalog-tabs-wrap { min-height: 36px; }
  .catalog-tab { min-width: 0; min-height: 0; padding: 8px 14px; font-size: 14px; line-height: 1.4; }
  .catalog-tab::after { right: 0; left: 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; margin-top: 60px; }
  .product-card__body { min-height: 76px; padding-top: 13px; }
  .product-card strong { font-size: 14px; }
  .product-card small { font-size: 11px; }
  .product-card__line { margin-top: 15px; }
}

@media (max-width: 420px) {
  .product-grid { gap: 25px 14px; }
}
