body.type-category #content > .category-top:has(> ul.subcategories) {
  display: flex;
  flex-direction: column;
  reading-flow: flex-visual;
}

body.type-category #content > .category-top:has(> ul.subcategories) > .category-title {
  order: -2;
}

body.type-category #content > .category-top > ul.subcategories {
  order: -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  margin: 16px 0 20px;
}

body.type-category #content > .category-top > ul.subcategories > li {
  width: auto;
  min-width: 0;
  padding: 0;
}

body.type-category #content > .category-top > ul.subcategories > li.divider {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
}

body.type-category #content > .category-top > ul.subcategories > li > a {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 100%;
  min-height: 112px;
  padding: 12px 24px 12px 12px;
  background: #f4f4f4;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  color: #072a36;
  font-weight: 600;
}

body.type-category #content > .category-top > ul.subcategories > li > a:has(> .image) {
  grid-template-columns: 104px minmax(0, 1fr);
}

body.type-category #content > .category-top > ul.subcategories > li > a:hover,
body.type-category #content > .category-top > ul.subcategories > li > a:focus-visible {
  background: #ebebeb;
  border-color: #888;
  color: #072a36;
}

body.type-category #content > .category-top > ul.subcategories > li > a .image,
body.type-category #content > .category-top > ul.subcategories > li > a .text {
  width: auto;
  max-height: none;
  padding: 0;
  overflow: visible;
}

body.type-category #content > .category-top > ul.subcategories > li > a .image img {
  width: 104px;
  max-width: 100%;
  height: 84px;
  max-height: none;
  object-fit: contain;
  mix-blend-mode: multiply;
}

body.type-category #content > .category-top > ul.subcategories > li > a .text {
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
  body.type-category #content > .category-top > ul.subcategories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  body.type-category #content > .category-top > ul.subcategories > li > a {
    padding: 10px 20px 10px 10px;
  }

  body.type-category #content > .category-top > ul.subcategories > li > a:has(> .image) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 76px 1fr;
    align-items: start;
    gap: 6px;
  }

  body.type-category #content > .category-top > ul.subcategories > li > a .image img {
    height: 76px;
  }
}
