#rootanchorcategory {
  --rac-primary: #2d2d31;
  --rac-primary-dark: #2d2d31;
  --rac-border: #dcdcdc;
  --rac-border-strong: #c9c9c9;
  --rac-bg: #ffffff;
  --rac-text: #2b2b2b;
  --rac-muted: #888888;
  --rac-shadow: 0 2px 6px rgba(0, 0, 0, 0.12); /* neutral grey shadow */
  background: var(--rac-bg);
  border: 1px solid var(--rac-border);
  border-radius: 5px;
  box-shadow: var(--rac-shadow);
  overflow: hidden;
  padding: 0 !important; /* beat the theme's #left-column .block padding (more specific) */
}

#rootanchorcategory .block-category-title {
  margin: 0;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
  background: var(--rac-primary); /* solid colour (no gradient) */
}

/* Collapsible behaviour: child branches are hidden unless the <li> is open
   (server marks the current path as is-open; the JS toggles it on click). */
#rootanchorcategory li.has-children > .rac-subtree { display: none; }
#rootanchorcategory li.has-children.is-open > .rac-subtree { display: block; }

#rootanchorcategory .block_content {
  padding: 14px;
}

#rootanchorcategory .rac-tree,
#rootanchorcategory .rac-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#rootanchorcategory .rac-tree-root > li + li {
  margin-top: 10px;
}

#rootanchorcategory .rac-subtree {
  margin-top: 8px;
  margin-left: 16px;
  padding-left: 12px;
  border-left: 1px solid var(--rac-border-strong);
}

#rootanchorcategory .rac-subtree > li {
  margin-top: 8px;
}

#rootanchorcategory .rac-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#rootanchorcategory .rac-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--rac-border-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#rootanchorcategory .rac-toggle:hover {
  border-color: var(--rac-primary);
  transform: translateY(-1px);
}

#rootanchorcategory .rac-toggle-placeholder {
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  cursor: default;
}

#rootanchorcategory .rac-toggle-icon {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--rac-primary-dark);
  border-bottom: 2px solid var(--rac-primary-dark);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-right: 1px;
}

#rootanchorcategory li.is-open > .rac-row .rac-toggle-icon {
  transform: rotate(45deg);
  margin-top: -2px;
}

#rootanchorcategory .rac-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 4px 10px;
  text-decoration: none;
  color: var(--rac-text);
  background: #fff;
  border: 1px solid var(--rac-border);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#rootanchorcategory .rac-link:hover {
  border-color: var(--rac-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

#rootanchorcategory .rac-link-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500; /* lighter for normal items */
}

#rootanchorcategory li.current > .rac-row .rac-link-text {
  font-weight: 700; /* only the current category is bold */
}

#rootanchorcategory .rac-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--rac-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

#rootanchorcategory .rac-count {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--rac-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

#rootanchorcategory li.current > .rac-row .rac-link {
  color: #fff;
  background: var(--rac-primary); /* solid, no gradient */
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

#rootanchorcategory li.current > .rac-row .rac-icon,
#rootanchorcategory li.current > .rac-row .rac-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

#rootanchorcategory li.in-path:not(.current) > .rac-row .rac-link {
  border-color: var(--rac-border);
  background: #fff;
}

#rootanchorcategory li.has-children:not(.is-open) > .rac-subtree {
  display: none;
}

#rootanchorcategory.rac-ready li.has-children > .rac-row .rac-toggle {
  visibility: visible;
}

@media (max-width: 767px) {
  #rootanchorcategory .block-category-title {
    padding: 16px;
    font-size: 18px;
  }

  #rootanchorcategory .block_content {
    padding: 12px;
  }

  #rootanchorcategory .rac-link {
    padding: 10px 12px;
  }
}
