/* Core Categories List：有子分類才開合（不改 term 排序）
 * 子層先 CSS 隱藏，避免 JS 載入前閃一下全開。 */

.wp-block-categories .cat-item > .children {
  display: none;
}

.wp-block-categories .cat-item.is-expanded > .children {
  display: block;
}

.wp-block-categories .cat-item:has(> .children) {
  position: relative;
  list-style: none;
}

.wp-block-categories .cat-item:has(> .children) > a {
  display: inline;
  padding-right: 1.75em;
}
.wp-block-categories li a {
  font-size: var(--cs-font-primary-menu-size) !important;
}

.muji-cat-toggle {
  position: absolute;
  right: 0;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  color: #b9b9b9;
}

.muji-cat-toggle:hover::before {
  border-color: #333333;
}

.muji-cat-toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1px solid #999;
  border-right: 1px solid #999;
  transform: rotate(135deg);
  transition: transform 0.3s ease-in-out;
}

.muji-cat-toggle[aria-expanded="true"]::before {
  transform: rotate(-45deg);
}
